Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=2f62c94176af875f22ecd01887a550d5d48092fc
Commit:     2f62c94176af875f22ecd01887a550d5d48092fc
Parent:     f68fd5f480248ca49e20e30a8e2387bc54694580
Author:     Andi Kleen <[EMAIL PROTECTED]>
AuthorDate: Wed Oct 17 18:04:34 2007 +0200
Committer:  Thomas Gleixner <[EMAIL PROTECTED]>
CommitDate: Wed Oct 17 20:15:34 2007 +0200

    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 <[EMAIL PROTECTED]>
    Signed-off-by: Ingo Molnar <[EMAIL PROTECTED]>
    Signed-off-by: Thomas Gleixner <[EMAIL PROTECTED]>
---
 arch/x86/ia32/ptrace32.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/arch/x86/ia32/ptrace32.c b/arch/x86/ia32/ptrace32.c
index 4a233ad..f52770e 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)
        return ret;
 }
 
+#define COMPAT_GDT_ENTRY_TLS_MIN 6
+
 asmlinkage long sys32_ptrace(long request, u32 pid, u32 addr, u32 data)
 {
        struct task_struct *child;
@@ -246,8 +248,6 @@ asmlinkage long sys32_ptrace(long request, u32 pid, u32 
addr, u32 data)
        case PTRACE_SYSCALL:
        case PTRACE_OLDSETOPTIONS:
        case PTRACE_SETOPTIONS:
-       case PTRACE_SET_THREAD_AREA:
-       case PTRACE_GET_THREAD_AREA:
                return sys_ptrace(request, pid, addr, data); 
 
        default:
@@ -271,6 +271,12 @@ asmlinkage long sys32_ptrace(long request, u32 pid, u32 
addr, u32 data)
        case PTRACE_SETSIGINFO:
        case PTRACE_GETSIGINFO:
                return ptrace32_siginfo(request, pid, addr, data);
+
+       case PTRACE_SET_THREAD_AREA:
+       case PTRACE_GET_THREAD_AREA:
+               return sys_ptrace(request, pid,
+                       addr + GDT_ENTRY_TLS_MIN - COMPAT_GDT_ENTRY_TLS_MIN,
+                       data);
        }
 
        child = ptrace_get_task_struct(pid);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to