Re: Minor PTRACE security bug

Cezary Sliwa (sliwa@blue.cft.edu.pl)
Tue, 15 Sep 1998 15:51:17 +0200 (CEST)


On Tue, 15 Sep 1998, David Luyer wrote:

> > Hello everybody,
> >
> > This bug should normally not be dangerous, but you never know.
> >
> > Consider a file which is execute only.
> >
> > ---x--x--x 1 andi users 8576 Sep 14 21:45 foobar
> >
> > You can not debug it, but 'strace' works, which should not, IMHO.
> > Things even get worse, if the binary does a fork. In this
> > case strace fails, if tries to trace the child process, which is
> > correct.
> > The same problem is on 2.1.x, I think.
> > My suggestion is to allow ptrace only on readable executables.
>
> You can also attack it with an LD_PRELOAD overriding various functions
> with versions that dump their arguments to a file before executing.

This is a user space problem, not a kernel related one.
It does not apply to statically linked binaries.

IMHO ptracing should not be allowed, at least in some
cases (eg. scripts), since this may give full access to the code.

-
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/