Skip to content

Commit df11348

Browse files
ebiedermgregkh
authored andcommitted
mn10300/misalignment: Use SIGSEGV SEGV_MAPERR to report a failed user copy
commit 6ac1dc7 upstream. Setting si_code to 0 is the same a setting si_code to SI_USER which is definitely not correct. With si_code set to SI_USER si_pid and si_uid will be copied to userspace instead of si_addr. Which is very wrong. So fix this by using a sensible si_code (SEGV_MAPERR) for this failure. Fixes: b920de1 ("mn10300: add the MN10300/AM33 architecture to the kernel") Cc: David Howells <dhowells@redhat.com> Cc: Masakazu Urade <urade.masakazu@jp.panasonic.com> Cc: Koichi Yasutake <yasutake.koichi@jp.panasonic.com> Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 38e3bc5 commit df11348

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

arch/mn10300/mm/misalignment.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ asmlinkage void misalignment(struct pt_regs *regs, enum exception_code code)
437437

438438
info.si_signo = SIGSEGV;
439439
info.si_errno = 0;
440-
info.si_code = 0;
440+
info.si_code = SEGV_MAPERR;
441441
info.si_addr = (void *) regs->pc;
442442
force_sig_info(SIGSEGV, &info, current);
443443
return;

0 commit comments

Comments
 (0)