Commit debf122c authored by Christophe Leroy's avatar Christophe Leroy Committed by Michael Ellerman

powerpc/signal32: Simplify logging in handle_rt_signal32()

If something is bad in the frame, there is no point in
knowing which part of the frame exactly is wrong as it
got allocated as a single block.

Always print the root address of the frame in case of
failed user access, just like handle_signal32().
Signed-off-by: default avatarChristophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/691895bd31fee89a2d8370befd66ad4eff5b63f2.1597770847.git.christophe.leroy@csgroup.eu
parent 7fe8f773
...@@ -754,7 +754,6 @@ int handle_rt_signal32(struct ksignal *ksig, sigset_t *oldset, ...@@ -754,7 +754,6 @@ int handle_rt_signal32(struct ksignal *ksig, sigset_t *oldset,
struct rt_sigframe __user *rt_sf; struct rt_sigframe __user *rt_sf;
struct mcontext __user *frame; struct mcontext __user *frame;
struct mcontext __user *tm_frame = NULL; struct mcontext __user *tm_frame = NULL;
void __user *addr;
unsigned long newsp = 0; unsigned long newsp = 0;
int sigret; int sigret;
unsigned long tramp; unsigned long tramp;
...@@ -767,7 +766,6 @@ int handle_rt_signal32(struct ksignal *ksig, sigset_t *oldset, ...@@ -767,7 +766,6 @@ int handle_rt_signal32(struct ksignal *ksig, sigset_t *oldset,
/* Set up Signal Frame */ /* Set up Signal Frame */
/* Put a Real Time Context onto stack */ /* Put a Real Time Context onto stack */
rt_sf = get_sigframe(ksig, tsk, sizeof(*rt_sf), 1); rt_sf = get_sigframe(ksig, tsk, sizeof(*rt_sf), 1);
addr = rt_sf;
if (!access_ok(rt_sf, sizeof(*rt_sf))) if (!access_ok(rt_sf, sizeof(*rt_sf)))
goto badframe; goto badframe;
...@@ -782,7 +780,6 @@ int handle_rt_signal32(struct ksignal *ksig, sigset_t *oldset, ...@@ -782,7 +780,6 @@ int handle_rt_signal32(struct ksignal *ksig, sigset_t *oldset,
/* Save user registers on the stack */ /* Save user registers on the stack */
frame = &rt_sf->uc.uc_mcontext; frame = &rt_sf->uc.uc_mcontext;
addr = frame;
if (vdso32_rt_sigtramp && tsk->mm->context.vdso_base) { if (vdso32_rt_sigtramp && tsk->mm->context.vdso_base) {
sigret = 0; sigret = 0;
tramp = tsk->mm->context.vdso_base + vdso32_rt_sigtramp; tramp = tsk->mm->context.vdso_base + vdso32_rt_sigtramp;
...@@ -818,7 +815,6 @@ int handle_rt_signal32(struct ksignal *ksig, sigset_t *oldset, ...@@ -818,7 +815,6 @@ int handle_rt_signal32(struct ksignal *ksig, sigset_t *oldset,
/* create a stack frame for the caller of the handler */ /* create a stack frame for the caller of the handler */
newsp = ((unsigned long)rt_sf) - (__SIGNAL_FRAMESIZE + 16); newsp = ((unsigned long)rt_sf) - (__SIGNAL_FRAMESIZE + 16);
addr = (void __user *)regs->gpr[1];
if (put_user(regs->gpr[1], (u32 __user *)newsp)) if (put_user(regs->gpr[1], (u32 __user *)newsp))
goto badframe; goto badframe;
...@@ -835,7 +831,7 @@ int handle_rt_signal32(struct ksignal *ksig, sigset_t *oldset, ...@@ -835,7 +831,7 @@ int handle_rt_signal32(struct ksignal *ksig, sigset_t *oldset,
return 0; return 0;
badframe: badframe:
signal_fault(tsk, regs, "handle_rt_signal32", addr); signal_fault(tsk, regs, "handle_rt_signal32", rt_sf);
return 1; return 1;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment