lkml.org 
[lkml]   [2000]   [Jan]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Date
SubjectPatch for arch/i386/kernel/ptrace.c
Hi,

In both 2.3.39 and 2.2.14 on i386, sys_ptrace appears to be able to return
without unlocking the kernel.

Patch included - not tested (I don't have a SMP machine).

Ralph.

--- arch/i386/kernel/ptrace.c.orig Wed Oct 13 06:05:53 1999
+++ arch/i386/kernel/ptrace.c Sat Jan 15 20:32:40 2000
@@ -258,15 +258,15 @@
have to be selective about what portions we allow someone
to modify. */

+ ret = -EIO;
if(addr >= (long) &dummy->u_debugreg[0] &&
addr <= (long) &dummy->u_debugreg[7]){

- if(addr == (long) &dummy->u_debugreg[4]) return -EIO;
- if(addr == (long) &dummy->u_debugreg[5]) return -EIO;
+ if(addr == (long) &dummy->u_debugreg[4]) goto out;
+ if(addr == (long) &dummy->u_debugreg[5]) goto out;
if(addr < (long) &dummy->u_debugreg[4] &&
- ((unsigned long) data) >= TASK_SIZE-3) return -EIO;
+ ((unsigned long) data) >= TASK_SIZE-3) goto out;

- ret = -EIO;
if(addr == (long) &dummy->u_debugreg[7]) {
data &= ~DR_CONTROL_RESERVED;
for(i=0; i<4; i++)
@@ -280,7 +280,6 @@
ret = 0;
goto out;
};
- ret = -EIO;
goto out;

case PTRACE_SYSCALL: /* continue and stop at next (return from) syscall */

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:55    [W:0.021 / U:0.376 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site