--- linux-2.6.12.2/arch/alpha/kernel/ptrace.c 2005-06-22 02:37:51 +0200 +++ linux-2.6.12.2-vs2.0-rc6.1/arch/alpha/kernel/ptrace.c 2005-07-02 22:38:30 +0200 @@ -289,6 +289,8 @@ do_sys_ptrace(long request, long pid, lo read_unlock(&tasklist_lock); if (!child) goto out_notsk; + if (!vx_check(vx_task_xid(child), VX_WATCH|VX_IDENT)) + goto out; if (request == PTRACE_ATTACH) { ret = ptrace_attach(child); --- linux-2.6.12.2/arch/arm/kernel/ptrace.c 2005-06-22 02:37:52 +0200 +++ linux-2.6.12.2-vs2.0-rc6.1/arch/arm/kernel/ptrace.c 2005-07-02 22:38:30 +0200 @@ -809,6 +809,8 @@ asmlinkage int sys_ptrace(long request, read_unlock(&tasklist_lock); if (!child) goto out; + if (!vx_check(vx_task_xid(child), VX_WATCH|VX_IDENT)) + goto out_tsk; ret = -EPERM; if (pid == 1) /* you may not mess with init */ --- linux-2.6.12.2/arch/arm26/kernel/ptrace.c 2005-06-22 02:37:53 +0200 +++ linux-2.6.12.2-vs2.0-rc6.1/arch/arm26/kernel/ptrace.c 2005-07-02 22:38:30 +0200 @@ -692,6 +692,8 @@ asmlinkage int sys_ptrace(long request, read_unlock(&tasklist_lock); if (!child) goto out; + if (!vx_check(vx_task_xid(child), VX_WATCH|VX_IDENT)) + goto out_tsk; ret = -EPERM; if (pid == 1) /* you may not mess with init */ --- linux-2.6.12.2/arch/h8300/kernel/ptrace.c 2005-06-22 02:37:53 +0200 +++ linux-2.6.12.2-vs2.0-rc6.1/arch/h8300/kernel/ptrace.c 2005-07-02 22:38:30 +0200 @@ -81,6 +81,8 @@ asmlinkage int sys_ptrace(long request, read_unlock(&tasklist_lock); if (!child) goto out; + if (!vx_check(vx_task_xid(child), VX_WATCH|VX_IDENT)) + goto out_tsk; ret = -EPERM; if (pid == 1) /* you may not mess with init */ --- linux-2.6.12.2/arch/i386/kernel/ptrace.c 2005-06-22 02:37:53 +0200 +++ linux-2.6.12.2-vs2.0-rc6.1/arch/i386/kernel/ptrace.c 2005-07-02 22:38:30 +0200 @@ -381,6 +381,8 @@ asmlinkage int sys_ptrace(long request, read_unlock(&tasklist_lock); if (!child) goto out; + if (!vx_check(vx_task_xid(child), VX_WATCH|VX_IDENT)) + goto out_tsk; ret = -EPERM; if (pid == 1) /* you may not mess with init */ --- linux-2.6.12.2/arch/ia64/kernel/ptrace.c 2005-07-02 21:56:06 +0200 +++ linux-2.6.12.2-vs2.0-rc6.1/arch/ia64/kernel/ptrace.c 2005-07-02 22:38:30 +0200 @@ -1436,6 +1436,9 @@ sys_ptrace (long request, pid_t pid, uns read_unlock(&tasklist_lock); if (!child) goto out; + if (!vx_check(vx_task_xid(child), VX_WATCH|VX_IDENT)) + goto out_tsk; + ret = -EPERM; if (pid == 1) /* no messing around with init! */ goto out_tsk; --- linux-2.6.12.2/arch/m68k/kernel/ptrace.c 2005-06-22 02:37:55 +0200 +++ linux-2.6.12.2-vs2.0-rc6.1/arch/m68k/kernel/ptrace.c 2005-07-02 22:38:30 +0200 @@ -141,6 +141,8 @@ asmlinkage int sys_ptrace(long request, read_unlock(&tasklist_lock); if (!child) goto out; + if (!vx_check(vx_task_xid(child), VX_WATCH|VX_IDENT)) + goto out_tsk; ret = -EPERM; if (pid == 1) /* you may not mess with init */ --- linux-2.6.12.2/arch/m68knommu/kernel/ptrace.c 2005-06-22 02:37:55 +0200 +++ linux-2.6.12.2-vs2.0-rc6.1/arch/m68knommu/kernel/ptrace.c 2005-07-02 22:38:30 +0200 @@ -125,6 +125,8 @@ asmlinkage int sys_ptrace(long request, read_unlock(&tasklist_lock); if (!child) goto out; + if (!vx_check(vx_task_xid(child), VX_WATCH|VX_IDENT)) + goto out_tsk; ret = -EPERM; if (pid == 1) /* you may not mess with init */ --- linux-2.6.12.2/arch/mips/kernel/ptrace.c 2005-06-22 02:37:55 +0200 +++ linux-2.6.12.2-vs2.0-rc6.1/arch/mips/kernel/ptrace.c 2005-07-02 22:38:30 +0200 @@ -78,6 +78,8 @@ asmlinkage int sys_ptrace(long request, read_unlock(&tasklist_lock); if (!child) goto out; + if (!vx_check(vx_task_xid(child), VX_WATCH|VX_IDENT)) + goto out_tsk; ret = -EPERM; if (pid == 1) /* you may not mess with init */ --- linux-2.6.12.2/arch/parisc/kernel/ptrace.c 2005-06-22 02:37:56 +0200 +++ linux-2.6.12.2-vs2.0-rc6.1/arch/parisc/kernel/ptrace.c 2005-07-02 22:38:30 +0200 @@ -111,6 +111,9 @@ long sys_ptrace(long request, pid_t pid, read_unlock(&tasklist_lock); if (!child) goto out; + if (!vx_check(vx_task_xid(child), VX_WATCH|VX_IDENT)) + goto out_tsk; + ret = -EPERM; if (pid == 1) /* no messing around with init! */ goto out_tsk; --- linux-2.6.12.2/arch/ppc/kernel/ptrace.c 2005-06-22 02:37:56 +0200 +++ linux-2.6.12.2-vs2.0-rc6.1/arch/ppc/kernel/ptrace.c 2005-07-02 22:38:30 +0200 @@ -263,6 +263,8 @@ int sys_ptrace(long request, long pid, l read_unlock(&tasklist_lock); if (!child) goto out; + if (!vx_check(vx_task_xid(child), VX_WATCH|VX_IDENT)) + goto out_tsk; ret = -EPERM; if (pid == 1) /* you may not mess with init */ --- linux-2.6.12.2/arch/ppc64/kernel/ptrace.c 2005-06-22 02:37:58 +0200 +++ linux-2.6.12.2-vs2.0-rc6.1/arch/ppc64/kernel/ptrace.c 2005-07-02 22:38:30 +0200 @@ -78,6 +78,8 @@ int sys_ptrace(long request, long pid, l read_unlock(&tasklist_lock); if (!child) goto out; + if (!vx_check(vx_task_xid(child), VX_WATCH|VX_IDENT)) + goto out_tsk; ret = -EPERM; if (pid == 1) /* you may not mess with init */ --- linux-2.6.12.2/arch/s390/kernel/ptrace.c 2005-06-22 02:37:59 +0200 +++ linux-2.6.12.2-vs2.0-rc6.1/arch/s390/kernel/ptrace.c 2005-07-02 22:38:30 +0200 @@ -738,9 +738,11 @@ sys_ptrace(long request, long pid, long read_unlock(&tasklist_lock); if (!child) goto out; + if (!vx_check(vx_task_xid(child), VX_WATCH|VX_IDENT)) + goto out_tsk; ret = do_ptrace(child, request, addr, data); - +out_tsk: put_task_struct(child); out: unlock_kernel(); --- linux-2.6.12.2/arch/sh/kernel/ptrace.c 2005-06-22 02:37:59 +0200 +++ linux-2.6.12.2-vs2.0-rc6.1/arch/sh/kernel/ptrace.c 2005-07-02 22:38:30 +0200 @@ -108,6 +108,8 @@ asmlinkage int sys_ptrace(long request, read_unlock(&tasklist_lock); if (!child) goto out; + if (!vx_check(vx_task_xid(child), VX_WATCH|VX_IDENT)) + goto out_tsk; ret = -EPERM; if (pid == 1) /* you may not mess with init */ --- linux-2.6.12.2/arch/sparc/kernel/ptrace.c 2005-06-22 02:37:59 +0200 +++ linux-2.6.12.2-vs2.0-rc6.1/arch/sparc/kernel/ptrace.c 2005-07-02 22:38:30 +0200 @@ -322,6 +322,10 @@ asmlinkage void do_ptrace(struct pt_regs pt_error_return(regs, ESRCH); goto out; } + if (!vx_check(vx_task_xid(child), VX_WATCH|VX_IDENT)) { + pt_error_return(regs, ESRCH); + goto out_tsk; + } if ((current->personality == PER_SUNOS && request == PTRACE_SUNATTACH) || (current->personality != PER_SUNOS && request == PTRACE_ATTACH)) { --- linux-2.6.12.2/arch/sparc64/kernel/ptrace.c 2005-06-22 02:38:00 +0200 +++ linux-2.6.12.2-vs2.0-rc6.1/arch/sparc64/kernel/ptrace.c 2005-07-02 22:38:30 +0200 @@ -222,6 +222,10 @@ asmlinkage void do_ptrace(struct pt_regs pt_error_return(regs, ESRCH); goto out; } + if (!vx_check(vx_task_xid(child), VX_WATCH|VX_IDENT)) { + pt_error_return(regs, ESRCH); + goto out_tsk; + } if ((current->personality == PER_SUNOS && request == PTRACE_SUNATTACH) || (current->personality != PER_SUNOS && request == PTRACE_ATTACH)) { --- linux-2.6.12.2/arch/um/kernel/ptrace.c 2005-06-22 02:38:00 +0200 +++ linux-2.6.12.2-vs2.0-rc6.1/arch/um/kernel/ptrace.c 2005-07-02 22:38:30 +0200 @@ -72,6 +72,8 @@ long sys_ptrace(long request, long pid, read_unlock(&tasklist_lock); if (!child) goto out; + if (!vx_check(vx_task_xid(child), VX_WATCH|VX_IDENT)) + goto out_tsk; ret = -EPERM; if (pid == 1) /* you may not mess with init */ --- linux-2.6.12.2/arch/v850/kernel/ptrace.c 2005-06-22 02:38:01 +0200 +++ linux-2.6.12.2-vs2.0-rc6.1/arch/v850/kernel/ptrace.c 2005-07-02 22:38:30 +0200 @@ -139,6 +139,8 @@ int sys_ptrace(long request, long pid, l read_unlock(&tasklist_lock); if (!child) goto out; + if (!vx_check(vx_task_xid(child), VX_WATCH|VX_IDENT)) + goto out_tsk; rval = -EPERM; if (pid == 1) /* you may not mess with init */ --- linux-2.6.12.2/arch/x86_64/kernel/ptrace.c 2005-06-22 02:38:01 +0200 +++ linux-2.6.12.2-vs2.0-rc6.1/arch/x86_64/kernel/ptrace.c 2005-07-02 22:38:30 +0200 @@ -342,6 +342,8 @@ asmlinkage long sys_ptrace(long request, read_unlock(&tasklist_lock); if (!child) goto out; + if (!vx_check(vx_task_xid(child), VX_WATCH|VX_IDENT)) + goto out_tsk; ret = -EPERM; if (pid == 1) /* you may not mess with init */