aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/ia32
diff options
context:
space:
mode:
authorAndi Kleen <ak@suse.de>2007-10-17 12:04:34 -0400
committerThomas Gleixner <tglx@inhelltoy.tec.linutronix.de>2007-10-17 14:15:34 -0400
commit2f62c94176af875f22ecd01887a550d5d48092fc (patch)
treea88a4a31dc1b5ea55d93835897624dca1c36eb77 /arch/x86/ia32
parentf68fd5f480248ca49e20e30a8e2387bc54694580 (diff)
x86_64: Fix compat emulation of PTRACE_GET/SET_THREAD_AREA
Since the 64bit kernel has different indexes for this TLS segments the address needs to be adjusted in the ptrace 32bit emulation. [ tglx: arch/x86 adaptation ] Reported-by: Amnon Shiloh Signed-off-by: Andi Kleen <ak@suse.de> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/ia32')
-rw-r--r--arch/x86/ia32/ptrace32.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/arch/x86/ia32/ptrace32.c b/arch/x86/ia32/ptrace32.c
index 4a233ad6269c..f52770ef0ee3 100644
--- a/arch/x86/ia32/ptrace32.c
+++ b/arch/x86/ia32/ptrace32.c
@@ -228,6 +228,8 @@ static long ptrace32_siginfo(unsigned request, u32 pid, u32 addr, u32 data)
228 return ret; 228 return ret;
229} 229}
230 230
231#define COMPAT_GDT_ENTRY_TLS_MIN 6
232
231asmlinkage long sys32_ptrace(long request, u32 pid, u32 addr, u32 data) 233asmlinkage long sys32_ptrace(long request, u32 pid, u32 addr, u32 data)
232{ 234{
233 struct task_struct *child; 235 struct task_struct *child;
@@ -246,8 +248,6 @@ asmlinkage long sys32_ptrace(long request, u32 pid, u32 addr, u32 data)
246 case PTRACE_SYSCALL: 248 case PTRACE_SYSCALL:
247 case PTRACE_OLDSETOPTIONS: 249 case PTRACE_OLDSETOPTIONS:
248 case PTRACE_SETOPTIONS: 250 case PTRACE_SETOPTIONS:
249 case PTRACE_SET_THREAD_AREA:
250 case PTRACE_GET_THREAD_AREA:
251 return sys_ptrace(request, pid, addr, data); 251 return sys_ptrace(request, pid, addr, data);
252 252
253 default: 253 default:
@@ -271,6 +271,12 @@ asmlinkage long sys32_ptrace(long request, u32 pid, u32 addr, u32 data)
271 case PTRACE_SETSIGINFO: 271 case PTRACE_SETSIGINFO:
272 case PTRACE_GETSIGINFO: 272 case PTRACE_GETSIGINFO:
273 return ptrace32_siginfo(request, pid, addr, data); 273 return ptrace32_siginfo(request, pid, addr, data);
274
275 case PTRACE_SET_THREAD_AREA:
276 case PTRACE_GET_THREAD_AREA:
277 return sys_ptrace(request, pid,
278 addr + GDT_ENTRY_TLS_MIN - COMPAT_GDT_ENTRY_TLS_MIN,
279 data);
274 } 280 }
275 281
276 child = ptrace_get_task_struct(pid); 282 child = ptrace_get_task_struct(pid);