diff options
author | David Woodhouse <dwmw2@infradead.org> | 2005-11-24 12:51:40 (GMT) |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-01-09 03:50:45 (GMT) |
commit | 9687c587596b54a77f08620595f5686ea35eed97 (patch) | |
tree | bc2886ec26d992b20a887a355b2240129f6e0423 /arch/powerpc | |
parent | 31df1678d7732b94178a6e457ed6666e4431212f (diff) | |
download | linux-fsl-qoriq-9687c587596b54a77f08620595f5686ea35eed97.tar.xz |
[PATCH] Save NVGPRS in 32-bit signal frame
Somehow this one slipped through the cracks; when we ended up in
do_signal() on a 32-bit kernel but without having the caller-saved
registers into the regs, we didn't set the TIF_SAVE_NVGPRS flag to
ensure they got saved later.
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc')
-rw-r--r-- | arch/powerpc/kernel/signal_32.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/signal_32.c b/arch/powerpc/kernel/signal_32.c index c9d0275..d3f0b6d 100644 --- a/arch/powerpc/kernel/signal_32.c +++ b/arch/powerpc/kernel/signal_32.c @@ -219,6 +219,15 @@ static inline int get_old_sigaction(struct k_sigaction *new_ka, static inline int save_general_regs(struct pt_regs *regs, struct mcontext __user *frame) { + if (!FULL_REGS(regs)) { + /* Zero out the unsaved GPRs to avoid information + leak, and set TIF_SAVE_NVGPRS to ensure that the + registers do actually get saved later. */ + memset(®s->gpr[14], 0, 18 * sizeof(unsigned long)); + current_thread_info()->nvgprs_frame = &frame->mc_gregs; + set_thread_flag(TIF_SAVE_NVGPRS); + } + return __copy_to_user(&frame->mc_gregs, regs, GP_REGS_SIZE); } |