Skip to content

Commit ca29cfc

Browse files
author
Russell King (Oracle)
committed
ARM: fix cacheflush with PAN
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: 7af5b90 ("ARM: 9358/2: Implement PAN for LPAE by TTBR0 page table walks disablement") Reported-by: Michał Pecio <[email protected]> Tested-by: Michał Pecio <[email protected]> Signed-off-by: Russell King (Oracle) <[email protected]>
1 parent fb5af7d commit ca29cfc

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
@@ -570,6 +570,7 @@ static int bad_syscall(int n, struct pt_regs *regs)
570570
static inline int
571571
__do_cache_op(unsigned long start, unsigned long end)
572572
{
573+
unsigned int ua_flags;
573574
int ret;
574575

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

582+
ua_flags = uaccess_save_and_enable();
581583
ret = flush_icache_user_range(start, start + chunk);
584+
uaccess_restore(ua_flags);
582585
if (ret)
583586
return ret;
584587

0 commit comments

Comments
 (0)