aboutsummaryrefslogtreecommitdiff
path: root/arch/ia64/kernel/ptrace.c
diff options
context:
space:
mode:
authorJeff Garzik <jgarzik@pobox.com>2005-06-30 00:49:38 -0400
committerJeff Garzik <jgarzik@pobox.com>2005-06-30 00:49:38 -0400
commite9dd2561793c05d70c9df1bc16a2dde6f23388df (patch)
tree20099972569cc0748133a6351600fff9cbb15f4a /arch/ia64/kernel/ptrace.c
parentd011e151bc5d1a581bf35b492a4fde44d30382b9 (diff)
parent0c168775709faa74c1b87f1e61046e0c51ade7f3 (diff)
Merge /spare/repo/netdev-2.6 branch 'ieee80211'
Diffstat (limited to 'arch/ia64/kernel/ptrace.c')
-rw-r--r--arch/ia64/kernel/ptrace.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/arch/ia64/kernel/ptrace.c b/arch/ia64/kernel/ptrace.c
index 6d57aebad48..bbb8bc7c055 100644
--- a/arch/ia64/kernel/ptrace.c
+++ b/arch/ia64/kernel/ptrace.c
@@ -725,12 +725,32 @@ convert_to_non_syscall (struct task_struct *child, struct pt_regs *pt,
break;
}
+ /*
+ * Note: at the time of this call, the target task is blocked
+ * in notify_resume_user() and by clearling PRED_LEAVE_SYSCALL
+ * (aka, "pLvSys") we redirect execution from
+ * .work_pending_syscall_end to .work_processed_kernel.
+ */
unw_get_pr(&prev_info, &pr);
- pr &= ~(1UL << PRED_SYSCALL);
+ pr &= ~((1UL << PRED_SYSCALL) | (1UL << PRED_LEAVE_SYSCALL));
pr |= (1UL << PRED_NON_SYSCALL);
unw_set_pr(&prev_info, pr);
pt->cr_ifs = (1UL << 63) | cfm;
+ /*
+ * Clear the memory that is NOT written on syscall-entry to
+ * ensure we do not leak kernel-state to user when execution
+ * resumes.
+ */
+ pt->r2 = 0;
+ pt->r3 = 0;
+ pt->r14 = 0;
+ memset(&pt->r16, 0, 16*8); /* clear r16-r31 */
+ memset(&pt->f6, 0, 6*16); /* clear f6-f11 */
+ pt->b7 = 0;
+ pt->ar_ccv = 0;
+ pt->ar_csd = 0;
+ pt->ar_ssd = 0;
}
static int