Skip to content

Commit 9abf795

Browse files
committed
Merge tag 'xtensa-20260219' of https://github.com/jcmvbkbc/linux-xtensa
Pull Xtensa update from Max Filippov: - fix unhandled case in the load/store fault handler in configurations with MMU * tag 'xtensa-20260219' of https://github.com/jcmvbkbc/linux-xtensa: xtensa: align: validate access in fast_load_store
2 parents c8cb804 + 0d4b3ca commit 9abf795

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

arch/xtensa/kernel/align.S

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@
2121
#include <asm/asm-offsets.h>
2222
#include <asm/asmmacro.h>
2323
#include <asm/processor.h>
24+
#ifdef CONFIG_MMU
25+
#include <asm/asm-uaccess.h>
26+
#endif
2427

2528
#if XCHAL_UNALIGNED_LOAD_EXCEPTION || defined CONFIG_XTENSA_LOAD_STORE
2629
#define LOAD_EXCEPTION_HANDLER
@@ -185,8 +188,11 @@ ENTRY(fast_load_store)
185188

186189
#ifdef CONFIG_MMU
187190
/* l32e can't be used here even when it's available. */
188-
/* TODO access_ok(a3) could be used here */
189-
j .Linvalid_instruction
191+
rsr a6, ps
192+
bbci.l a6, PS_UM_BIT, 1f # kernel mode
193+
movi a5, 8
194+
access_ok a3, a5, a6, a2, .Linvalid_instruction
195+
1:
190196
#endif
191197
l32i a5, a3, 0
192198
l32i a6, a3, 4

0 commit comments

Comments
 (0)