Skip to content

Commit 581ac5f

Browse files
mrutland-armgregkh
authored andcommitted
arm64: ensure __dump_instr() checks addr_limit
commit 7a7003b1da010d2b0d1dc8bf21c10f5c73b389f1 upstream. 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") Acked-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Mark Rutland <mark.rutland@arm.com> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 97d64b7 commit 581ac5f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

arch/arm64/kernel/traps.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ static void dump_instr(const char *lvl, struct pt_regs *regs)
129129
for (i = -4; i < 1; i++) {
130130
unsigned int val, bad;
131131

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

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

0 commit comments

Comments
 (0)