Christophe Leroy 6ec20aa2e5 powerpc/32s: Fix bad_kuap_fault()
At the moment, bad_kuap_fault() reports a fault only if a bad access
to userspace occurred while access to userspace was not granted.

But if a fault occurs for a write outside the allowed userspace
segment(s) that have been unlocked, bad_kuap_fault() fails to
detect it and the kernel loops forever in do_page_fault().

Fix it by checking that the accessed address is within the allowed
range.

Fixes: a68c31fc01ef ("powerpc/32s: Implement Kernel Userspace Access Protection")
Cc: stable@vger.kernel.org # v5.2+
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/f48244e9485ada0a304ed33ccbb8da271180c80d.1579866752.git.christophe.leroy@c-s.fr
2020-01-28 23:13:17 +11:00
..
2020-01-28 23:13:17 +11:00
2020-01-28 23:13:17 +11:00
2019-11-18 22:27:51 +11:00
2019-09-14 00:01:14 +10:00
2019-07-13 16:08:36 -07:00
2019-11-19 19:38:38 +11:00
2018-06-07 10:23:33 -07:00
2019-11-18 22:27:52 +11:00
2016-03-01 19:27:20 +11:00
2019-08-27 13:03:35 +10:00
2019-08-30 09:52:57 +10:00
2019-05-03 01:20:26 +10:00
2019-12-03 13:58:22 -08:00
2020-01-28 23:13:17 +11:00
2019-07-13 16:08:36 -07:00
2019-09-05 14:22:41 +10:00
2019-07-13 16:08:36 -07:00
2019-11-30 14:35:43 -08:00
2016-06-14 13:58:26 +10:00
2019-07-13 16:08:36 -07:00
2019-07-13 16:08:36 -07:00
2019-07-13 16:08:36 -07:00
2019-06-15 12:25:49 +02:00
2019-07-13 16:08:36 -07:00
2019-11-30 14:35:43 -08:00
2018-05-25 12:04:43 +10:00
2019-11-30 14:35:43 -08:00
2019-07-16 19:23:24 -07:00
2018-07-30 22:48:21 +10:00
2019-05-01 16:45:05 +10:00
2019-07-29 09:34:27 +10:00
2019-07-13 16:08:36 -07:00
2019-09-20 11:48:06 -07:00