Skip to content

Commit

Permalink
mn10300/misalignment: Use SIGSEGV SEGV_MAPERR to report a failed user…
Browse files Browse the repository at this point in the history
… copy

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.

Cc: [email protected]
Fixes: b920de1 ("mn10300: add the MN10300/AM33 architecture to the kernel")
Cc: David Howells <[email protected]>
Cc: Masakazu Urade <[email protected]>
Cc: Koichi Yasutake <[email protected]>
Signed-off-by: "Eric W. Biederman" <[email protected]>
  • Loading branch information
ebiederm committed Jan 12, 2018
1 parent faf1f22 commit 6ac1dc7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/mn10300/mm/misalignment.c
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ asmlinkage void misalignment(struct pt_regs *regs, enum exception_code code)

info.si_signo = SIGSEGV;
info.si_errno = 0;
info.si_code = 0;
info.si_code = SEGV_MAPERR;
info.si_addr = (void *) regs->pc;
force_sig_info(SIGSEGV, &info, current);
return;
Expand Down

0 comments on commit 6ac1dc7

Please sign in to comment.