Skip to content

Commit 1a1220a

Browse files
Russell King (Oracle)smb49
authored andcommitted
ARM: fix cacheflush with PAN
BugLink: https://bugs.launchpad.net/bugs/2101042 [ Upstream commit ca29cfcc4a21083d671522ad384532e28a43f033 ] It seems that the cacheflush syscall got broken when PAN for LPAE was implemented. User access was not enabled around the cache maintenance instructions, causing them to fault. Fixes: 7af5b901e847 ("ARM: 9358/2: Implement PAN for LPAE by TTBR0 page table walks disablement") Reported-by: Michał Pecio <michal.pecio@gmail.com> Tested-by: Michał Pecio <michal.pecio@gmail.com> Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Manuel Diewald <manuel.diewald@canonical.com> Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
1 parent a572e73 commit 1a1220a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

arch/arm/kernel/traps.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -569,6 +569,7 @@ static int bad_syscall(int n, struct pt_regs *regs)
569569
static inline int
570570
__do_cache_op(unsigned long start, unsigned long end)
571571
{
572+
unsigned int ua_flags;
572573
int ret;
573574

574575
do {
@@ -577,7 +578,9 @@ __do_cache_op(unsigned long start, unsigned long end)
577578
if (fatal_signal_pending(current))
578579
return 0;
579580

581+
ua_flags = uaccess_save_and_enable();
580582
ret = flush_icache_user_range(start, start + chunk);
583+
uaccess_restore(ua_flags);
581584
if (ret)
582585
return ret;
583586

0 commit comments

Comments
 (0)