Skip to content

Commit 3813733

Browse files
mrutland-armwilldeacon
authored andcommitted
arm64: mm: fix inverted PAR_EL1.F check
When detecting a spurious EL1 translation fault, we have the CPU retry the translation using an AT S1E1R instruction, and inspect PAR_EL1 to determine if the fault was spurious. When PAR_EL1.F == 0, the AT instruction successfully translated the address without a fault, which implies the original fault was spurious. However, in this case we return false and treat the original fault as if it was not spurious. Invert the return value so that we treat such a case as spurious. Cc: Catalin Marinas <[email protected]> Fixes: 42f9109 ("arm64: mm: Ignore spurious translation faults taken from the kernel") Tested-by: James Morse <[email protected]> Signed-off-by: Mark Rutland <[email protected]> Signed-off-by: Will Deacon <[email protected]>
1 parent 29a0f5a commit 3813733

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

arch/arm64/mm/fault.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,8 +268,12 @@ static bool __kprobes is_spurious_el1_translation_fault(unsigned long addr,
268268
par = read_sysreg(par_el1);
269269
local_irq_restore(flags);
270270

271+
/*
272+
* If we now have a valid translation, treat the translation fault as
273+
* spurious.
274+
*/
271275
if (!(par & SYS_PAR_EL1_F))
272-
return false;
276+
return true;
273277

274278
/*
275279
* If we got a different type of fault from the AT instruction,

0 commit comments

Comments
 (0)