Re: [PATCH] add "VmUsers: N" to /proc/$PID/status

From: Denys Vlasenko
Date: Thu Jul 16 2009 - 19:44:33 EST


On Friday 17 July 2009 01:24, Valdis.Kletnieks@xxxxxx wrote:
> > I, indeed, want to have just an N I can divide RSS/VSZ/etc by,
> > to get, say, top display which do not mislead user
> > into thinking that he has 3 processes with 100 megabyte RSS
> > when in reality he has 3 processes sharing a single VM
> > with 100 meg RSS.
>
> Thinking about it a bit more - it's probably *usually* possible to sort out
> which processes are sharing because if you have 2 sets of shared memory,
> they'll *usually* have different RSS values - so the 2 processes with a
> count of 2 and an RSS of 179M are one set, and the 2 processes with a count
> of 2 and an RSS of 198M are probably another.

Hmm. We can just expose the raw value of task->mm pointer.
For all tasks which share a VM, it will have the same value.

It would be an "information leak", yes, but it isn't obvious
whether it can be exploited at all. We can also obscure it
a bit by XORing or summing it with randomly selected constant
or some such.
--
vda
--
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/