um/Stop conflating task_struct::stack with thread_info
authorLinus Torvalds <[email protected]>
Tue, 13 Sep 2016 21:29:23 +0000 (14:29 -0700)
committerIngo Molnar <[email protected]>
Thu, 15 Sep 2016 06:25:12 +0000 (08:25 +0200)
thread_info may move in the future, so use the accessors.

[ Andy Lutomirski wrote this changelog message and changed
  "task_thread_info(child)->cpu" to "task_cpu(child)". ]

Signed-off-by: Linus Torvalds <[email protected]>
Signed-off-by: Andy Lutomirski <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Brian Gerst <[email protected]>
Cc: Denys Vlasenko <[email protected]>
Cc: H. Peter Anvin <[email protected]>
Cc: Jann Horn <[email protected]>
Cc: Josh Poimboeuf <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Link: http://lkml.kernel.org/r/3439705d9838940cc82733a7335fa8c654c37db8.1473801993.git.luto@kernel.org
Signed-off-by: Ingo Molnar <[email protected]>
arch/x86/um/ptrace_32.c

index a7ef7b131e2564fd50d1614e8047f95841335c46..5766ead6fdb9679907c63aa78f8becccc8d9ecff 100644 (file)
@@ -194,7 +194,7 @@ int peek_user(struct task_struct *child, long addr, long data)
 
 static int get_fpregs(struct user_i387_struct __user *buf, struct task_struct *child)
 {
-       int err, n, cpu = ((struct thread_info *) child->stack)->cpu;
+       int err, n, cpu = task_cpu(child);
        struct user_i387_struct fpregs;
 
        err = save_i387_registers(userspace_pid[cpu],
@@ -211,7 +211,7 @@ static int get_fpregs(struct user_i387_struct __user *buf, struct task_struct *c
 
 static int set_fpregs(struct user_i387_struct __user *buf, struct task_struct *child)
 {
-       int n, cpu = ((struct thread_info *) child->stack)->cpu;
+       int n, cpu = task_cpu(child);
        struct user_i387_struct fpregs;
 
        n = copy_from_user(&fpregs, buf, sizeof(fpregs));
@@ -224,7 +224,7 @@ static int set_fpregs(struct user_i387_struct __user *buf, struct task_struct *c
 
 static int get_fpxregs(struct user_fxsr_struct __user *buf, struct task_struct *child)
 {
-       int err, n, cpu = ((struct thread_info *) child->stack)->cpu;
+       int err, n, cpu = task_cpu(child);
        struct user_fxsr_struct fpregs;
 
        err = save_fpx_registers(userspace_pid[cpu], (unsigned long *) &fpregs);
@@ -240,7 +240,7 @@ static int get_fpxregs(struct user_fxsr_struct __user *buf, struct task_struct *
 
 static int set_fpxregs(struct user_fxsr_struct __user *buf, struct task_struct *child)
 {
-       int n, cpu = ((struct thread_info *) child->stack)->cpu;
+       int n, cpu = task_cpu(child);
        struct user_fxsr_struct fpregs;
 
        n = copy_from_user(&fpregs, buf, sizeof(fpregs));