]> git.baikalelectronics.ru Git - kernel.git/commit
ARM: 9131/1: mm: Fix PXN process with LPAE feature
authorWang Kefeng <wangkefeng.wang@huawei.com>
Wed, 22 Sep 2021 13:56:32 +0000 (14:56 +0100)
committerRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Tue, 19 Oct 2021 09:35:43 +0000 (10:35 +0100)
commitdcf81d6ca17e898a33ffc125c070fead676f96cb
tree61d448d752712f24bfde938cc0caa377efacc970
parent859c9c03c1cd1ba8d7ca073a9e5ae8f7814eef3e
ARM: 9131/1: mm: Fix PXN process with LPAE feature

When user code execution with privilege mode, it will lead to
infinite loop in the page fault handler if ARM_LPAE enabled,

The issue could be reproduced with
  "echo EXEC_USERSPACE > /sys/kernel/debug/provoke-crash/DIRECT"

As Permission fault shows in ARM spec,
  IFSR format when using the Short-descriptor translation table format
    Permission fault:       01101 First level      01111 Second level
  IFSR format when using the Long-descriptor translation table format
    Permission fault:       0011LL LL bits indicate levelb.

Add is_permission_fault() function to check permission fault and die
if permission fault occurred under instruction fault in do_page_fault().

Fixes: 6044c5226467 ("ARM: 8235/1: Support for the PXN CPU feature on ARMv7")
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
arch/arm/mm/fault.c
arch/arm/mm/fault.h