Skip to content

Commit

Permalink
[PATCH] Save NVGPRS in 32-bit signal frame
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
David Woodhouse authored and Paul Mackerras committed Jan 9, 2006
1 parent 31df167 commit 9687c58
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions arch/powerpc/kernel/signal_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -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(&regs->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);
}

Expand Down

0 comments on commit 9687c58

Please sign in to comment.