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

From: Paul Jackson
Date: Sun Jul 18 2004 - 18:19:08 EST

> What exactly is passed then ...

The patch /proc/self/mem will be evaluated just once, on the open
by the original shell. Whatever bucket of bits that resolves to
will remain the source for fd == 0 reads.

That original shell's mem file will be read by whatever follows, exec or
not. The 'exec' just stops the shell from forking before it exec's, and
certainly won't cause the path that was used earlier to open fd 0 to be

The setuidapp will see the shell's memory. In general, a app, setuid or
not, should make no assumption that any open fd's handed to it at birth
were opened using the same priviledges that the app itself has.

Or, more to the point, no higher priviledge app, when calling down to a
lessor priviledge app (say a setuid or root app invoking a less trusted
app) should allow any open file descriptors across the fork or exec,
except those open on files to which it determines the lessor context has

I won't rest till it's the best ...
Programmer, Linux Scalability
Paul Jackson <pj@xxxxxxx> 1.650.933.1373
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at