From 158eeefb1989b50eadc74575efcf5a36a6b2cfac Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Fri, 7 Mar 2008 14:56:02 -0800 Subject: [PATCH] --- yaml --- r: 87057 b: refs/heads/master c: 84c6f6046c5a2189160a8f0dca8b90427bf690ea h: refs/heads/master i: 87055: 8cf07fcbad0d2e456600cab4dc10f8849d0009a1 v: v3 --- [refs] | 2 +- trunk/arch/x86/kernel/ptrace.c | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index a3fe483c3554..a2fb76a21537 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 60d5bcec7ed6c00e3ec88749fd81229731363221 +refs/heads/master: 84c6f6046c5a2189160a8f0dca8b90427bf690ea diff --git a/trunk/arch/x86/kernel/ptrace.c b/trunk/arch/x86/kernel/ptrace.c index f41fdc98efb1..8f64abe699fd 100644 --- a/trunk/arch/x86/kernel/ptrace.c +++ b/trunk/arch/x86/kernel/ptrace.c @@ -323,6 +323,16 @@ static int putreg(struct task_struct *child, return set_flags(child, value); #ifdef CONFIG_X86_64 + /* + * Orig_ax is really just a flag with small positive and + * negative values, so make sure to always sign-extend it + * from 32 bits so that it works correctly regardless of + * whether we come from a 32-bit environment or not. + */ + case offsetof(struct user_regs_struct, orig_ax): + value = (long) (s32) value; + break; + case offsetof(struct user_regs_struct,fs_base): if (value >= TASK_SIZE_OF(child)) return -EIO;