diff options
-rw-r--r-- | arch/x86/kernel/ptrace.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/x86/kernel/ptrace.c b/arch/x86/kernel/ptrace.c index f41fdc98efb1..8f64abe699fd 100644 --- a/arch/x86/kernel/ptrace.c +++ b/arch/x86/kernel/ptrace.c | |||
@@ -323,6 +323,16 @@ static int putreg(struct task_struct *child, | |||
323 | return set_flags(child, value); | 323 | return set_flags(child, value); |
324 | 324 | ||
325 | #ifdef CONFIG_X86_64 | 325 | #ifdef CONFIG_X86_64 |
326 | /* | ||
327 | * Orig_ax is really just a flag with small positive and | ||
328 | * negative values, so make sure to always sign-extend it | ||
329 | * from 32 bits so that it works correctly regardless of | ||
330 | * whether we come from a 32-bit environment or not. | ||
331 | */ | ||
332 | case offsetof(struct user_regs_struct, orig_ax): | ||
333 | value = (long) (s32) value; | ||
334 | break; | ||
335 | |||
326 | case offsetof(struct user_regs_struct,fs_base): | 336 | case offsetof(struct user_regs_struct,fs_base): |
327 | if (value >= TASK_SIZE_OF(child)) | 337 | if (value >= TASK_SIZE_OF(child)) |
328 | return -EIO; | 338 | return -EIO; |