diff --git a/arch/x86/kernel/ptrace.c b/arch/x86/kernel/ptrace.c index 5026738..16455c0 100644 --- a/arch/x86/kernel/ptrace.c +++ b/arch/x86/kernel/ptrace.c @@ -419,6 +419,10 @@ static int putreg(struct task_struct *child, if (child->thread.gs != value) return do_arch_prctl(child, ARCH_SET_GS, value); return 0; + + case sizeof(struct user_regs_struct) + 0 * sizeof(long): + /* Modifying of thread_info->status is not allowed */ + return 0; #endif } @@ -469,6 +473,10 @@ static unsigned long getreg(struct task_struct *task, unsigned long offset) return 0; return get_desc_base(&task->thread.tls_array[GS_TLS]); } + + case sizeof(struct user_regs_struct) + 0 * sizeof(long): + /* One day we might want to expose other bits too */ + return (task_thread_info(task)->status & TS_COMPAT); #endif } @@ -1203,7 +1211,7 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request, static struct user_regset x86_64_regsets[] __read_mostly = { [REGSET_GENERAL] = { .core_note_type = NT_PRSTATUS, - .n = sizeof(struct user_regs_struct) / sizeof(long), + .n = (sizeof(struct user_regs_struct) + 1 * sizeof(long)) / sizeof(long), .size = sizeof(long), .align = sizeof(long), .get = genregs_get, .set = genregs_set },