Re: question about /proc/<PID>/mem in 2.4

From: Alan Cox
Date: Tue Jul 06 2004 - 11:33:08 EST


On Tue, Jul 06, 2004 at 02:08:04PM +0100, Tigran Aivazian wrote:
> > This code was added to stop the ptrace/kmod vulnerabilities. I do not
> > fully understand the issues around tsk->is_dumpable and the fix itself,
> > but I agree on that the checks here could be relaxed for the super user.

is_dumpable tells you various things in 2.4, including whether the
curent memory image is valid, and as a race preventor for ptrace during
exec of setuid apps. You should probably talk to Solar Designer about
the whole design of the dump/suid race fixing work rather than me.

We also had to deal with another nasty case which could be fixed by grabbing
the mm at open time (which then opens a resource attack bug).

Consider what happens if your setuid app reads stdin

setuidapp < /proc/self/mem

(No idea how 2.6 deals with these but if its got better backportable ways
that *actually work* it might make sense).


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