Skip to content

Commit d896fa2

Browse files
torvaldsIngo Molnar
authored andcommitted
um/Stop conflating task_struct::stack with thread_info
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 <torvalds@linux-foundation.org> Signed-off-by: Andy Lutomirski <luto@kernel.org> Cc: Borislav Petkov <bp@alien8.de> Cc: Brian Gerst <brgerst@gmail.com> Cc: Denys Vlasenko <dvlasenk@redhat.com> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Jann Horn <jann@thejh.net> Cc: Josh Poimboeuf <jpoimboe@redhat.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Link: http://lkml.kernel.org/r/3439705d9838940cc82733a7335fa8c654c37db8.1473801993.git.luto@kernel.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
1 parent 97245d0 commit d896fa2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

arch/x86/um/ptrace_32.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ int peek_user(struct task_struct *child, long addr, long data)
194194

195195
static int get_fpregs(struct user_i387_struct __user *buf, struct task_struct *child)
196196
{
197-
int err, n, cpu = ((struct thread_info *) child->stack)->cpu;
197+
int err, n, cpu = task_cpu(child);
198198
struct user_i387_struct fpregs;
199199

200200
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
211211

212212
static int set_fpregs(struct user_i387_struct __user *buf, struct task_struct *child)
213213
{
214-
int n, cpu = ((struct thread_info *) child->stack)->cpu;
214+
int n, cpu = task_cpu(child);
215215
struct user_i387_struct fpregs;
216216

217217
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
224224

225225
static int get_fpxregs(struct user_fxsr_struct __user *buf, struct task_struct *child)
226226
{
227-
int err, n, cpu = ((struct thread_info *) child->stack)->cpu;
227+
int err, n, cpu = task_cpu(child);
228228
struct user_fxsr_struct fpregs;
229229

230230
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 *
240240

241241
static int set_fpxregs(struct user_fxsr_struct __user *buf, struct task_struct *child)
242242
{
243-
int n, cpu = ((struct thread_info *) child->stack)->cpu;
243+
int n, cpu = task_cpu(child);
244244
struct user_fxsr_struct fpregs;
245245

246246
n = copy_from_user(&fpregs, buf, sizeof(fpregs));

0 commit comments

Comments
 (0)