Skip to content

Commit 7a7003b

Browse files
mrutland-armctmarinas
authored andcommitted
arm64: ensure __dump_instr() checks addr_limit
It's possible for a user to deliberately trigger __dump_instr with a chosen kernel address. Let's avoid problems resulting from this by using get_user() rather than __get_user(), ensuring that we don't erroneously access kernel memory. Where we use __dump_instr() on kernel text, we already switch to KERNEL_DS, so this shouldn't adversely affect those cases. Fixes: 60ffc30 ("arm64: Exception handling") Cc: [email protected] Acked-by: Will Deacon <[email protected]> Signed-off-by: Mark Rutland <[email protected]> Signed-off-by: Catalin Marinas <[email protected]>
1 parent 0b07194 commit 7a7003b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/arm64/kernel/traps.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ static void __dump_instr(const char *lvl, struct pt_regs *regs)
118118
for (i = -4; i < 1; i++) {
119119
unsigned int val, bad;
120120

121-
bad = __get_user(val, &((u32 *)addr)[i]);
121+
bad = get_user(val, &((u32 *)addr)[i]);
122122

123123
if (!bad)
124124
p += sprintf(p, i == 0 ? "(%08x) " : "%08x ", val);

0 commit comments

Comments
 (0)