ARM: mm: fix alignment handler faults under memory pressure
authorRussell King <rmk+kernel@armlinux.org.uk>
Sat, 31 Aug 2019 16:01:58 +0000 (17:01 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 10 Nov 2019 10:27:18 +0000 (11:27 +0100)
commit9d27ba401eca6d504c2f2f539cd1598c1a60e6f7
treed0b4c53579ce4267ec714c4fa87a09ea78171c7a
parentf0eabc9e9acb68122bfb1e0321b13032ab20f2f3
ARM: mm: fix alignment handler faults under memory pressure

[ Upstream commit 67e15fa5b487adb9b78a92789eeff2d6ec8f5cee ]

When the system has high memory pressure, the page containing the
instruction may be paged out.  Using probe_kernel_address() means that
if the page is swapped out, the resulting page fault will not be
handled because page faults are disabled by this function.

Use get_user() to read the instruction instead.

Reported-by: Jing Xiangfeng <jingxiangfeng@huawei.com>
Fixes: b255188f90e2 ("ARM: fix scheduling while atomic warning in alignment handling code")
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/arm/mm/alignment.c