Re: Is /proc/*/mem broken?

Albert D. Cahalan (acahalan@cs.uml.edu)
Sun, 16 May 1999 02:09:58 -0400 (EDT)


Andi Kleen writes:

> I would propose to drop this silly requirement in 2.3, and instead forbid
> the really bad uses of /proc/*/mem (e.g. mmaping /proc/self/mem causes
> lots of problem in the VM subsystem, unfortunately dosemu depends on it)

I don't know if this would satisfy dosemu, but...

mmap() on /proc/self/mem could act on whatever is already mapped.
If a file is mapped in the area, you get an extra copy, etc.

Let's say you have this...

40000000-40009000 r-xp 00000000 03:07 28750 /lib/ld-2.0.7.so
40009000-4000b000 rw-p 00008000 03:07 28750 /lib/ld-2.0.7.so
4000b000-4000e000 r--p 00000000 03:07 4146 /etc/ld.so.cache
4000e000-4009f000 r-xp 00000000 03:07 28754 /lib/libc-2.0.7.so
4009f000-400a6000 rw-p 00090000 03:07 28754 /lib/libc-2.0.7.so

...and you mmap() bytes 40000000-400a6000 of /proc/self/mem. That ought
to get you another 5 mappings, as above, with new addresses.

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