Re: ptrace allows you to read -r files

From: Daniel Jacobowitz (dan@debian.org)
Date: Mon Feb 04 2002 - 22:06:28 EST


On Tue, Feb 05, 2002 at 11:33:32AM +1100, Andrew Griffiths wrote:
> Hello everyone,
>
> While playing around I noticed that if I fork()ed, then did ptrace(PTRACE_TRACEME,...) then exec'd a non-readable binary, the ptrace interface would let me read the binary.
>
> This was tested on 2.4.17ctx-5 (the security context patch), however I have been told it works on vanilla kernels, also I tested it on 2.4.2-pax on an old machine. (pentium 75...)
>
> For those who want some demo code, you can find it at http://203.39.161.186/readbin.tgz.
>
> For testing it, I used /usr/bin/ssh which was rws--x--x.
>
> Since I'm not subscribed to this list, could any replies be cc'd to me? Thanks.

I think this is just 'known'. Note that it isn't a security problem
otherwise; you'll find that the setuid application does not setuid if
it is ptraced. On 2.4.17 at least.

-- 
Daniel Jacobowitz                           Carnegie Mellon University
MontaVista Software                         Debian GNU/Linux Developer
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu Feb 07 2002 - 21:00:40 EST