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: a68c31fc ("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
Showing
- arch/powerpc/include/asm/book3s/32/kup.h 7 additions, 2 deletionsarch/powerpc/include/asm/book3s/32/kup.h
- arch/powerpc/include/asm/book3s/64/kup-radix.h 2 additions, 1 deletionarch/powerpc/include/asm/book3s/64/kup-radix.h
- arch/powerpc/include/asm/kup.h 5 additions, 1 deletionarch/powerpc/include/asm/kup.h
- arch/powerpc/include/asm/nohash/32/kup-8xx.h 2 additions, 1 deletionarch/powerpc/include/asm/nohash/32/kup-8xx.h
- arch/powerpc/mm/fault.c 1 addition, 1 deletionarch/powerpc/mm/fault.c
Loading
Please register or sign in to comment