lkml.org 
[lkml]   [2000]   [Sep]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[ANOTHER PATCH] Re: [PATCH] 2.4.0 i386 watchpoint problems
On Fri, Sep 22, 2000 at 08:34:59PM +0200, Andi Kleen wrote:
> On Fri, Sep 22, 2000 at 11:25:21AM -0700, Linus Torvalds wrote:
> >
> >
> > On Fri, 22 Sep 2000, Andi Kleen wrote:
> > > >
> > > > No. The current process is always the same one we send the signal to, so
> > > > that test ends up being irrelevant.
> > >
> > > Really ? I thought the original user wanted the signal to be sent to the
> > > debugger (e.g. the idle process probably couldn't care less about hardware
> > > breakpoints even when they hit in an interrupt handler which it is running)
> >
> > They get sent to the original process.
>
> Unless I'm missing something switch_to does not clear debug registers on
> context switch (unless another process also uses them)

Also unless I'm missing another thing ptrace allows you to put any addresses
including kernel address into the debug registers, so you could certainly
get debug traps everywhere, making my original objection valid.

How does this patch look ?

[BTW ptrace is still broken for ups/ltrace/uml in 2.4 because of the
ORIG_EAX change for EIP PTRACE_POKEUSER]


-Andi


--- linux-work/arch/i386/kernel/ptrace.c-o Sun Sep 10 00:49:35 2000
+++ linux-work/arch/i386/kernel/ptrace.c Fri Sep 22 20:44:33 2000
@@ -281,7 +281,11 @@
for(i=0; i<4; i++)
if ((0x5f54 >> ((data >> (16 + 4*i)) & 0xf)) & 1)
goto out_tsk;
- }
+ } else {
+ if (!access_ok(VERIFY_READ, (void*)data, 4))
+ break;
+ }
+

addr -= (long) &dummy->u_debugreg;
addr = addr >> 2;



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

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