提交 9687c587 编写于 作者: D David Woodhouse 提交者: Paul Mackerras

[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: NDavid Woodhouse <dwmw2@infradead.org>
Signed-off-by: NPaul Mackerras <paulus@samba.org>
上级 31df1678
...@@ -219,6 +219,15 @@ static inline int get_old_sigaction(struct k_sigaction *new_ka, ...@@ -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, static inline int save_general_regs(struct pt_regs *regs,
struct mcontext __user *frame) 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); return __copy_to_user(&frame->mc_gregs, regs, GP_REGS_SIZE);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册