diff options
author | Kay Sievers <kay.sievers@vrfy.org> | 2009-03-24 15:43:30 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-06-15 21:30:23 -0700 |
commit | 3959214f971417f4162926ac52ad4cd042958caa (patch) | |
tree | 1e73536b383a2a8337c09c5630871b2f94a8bcfa /ipc | |
parent | f6ee649f4b191d316a463ce7e514f9d12fa31c01 (diff) | |
download | linux-3.10-3959214f971417f4162926ac52ad4cd042958caa.tar.gz linux-3.10-3959214f971417f4162926ac52ad4cd042958caa.tar.bz2 linux-3.10-3959214f971417f4162926ac52ad4cd042958caa.zip |
sched: delayed cleanup of user_struct
During bootup performance tracing we see repeated occurrences of
/sys/kernel/uid/* events for the same uid, leading to a,
in this case, rather pointless userspace processing for the
same uid over and over.
This is usually caused by tools which change their uid to "nobody",
to run without privileges to read data supplied by untrusted users.
This change delays the execution of the (already existing) scheduled
work, to cleanup the uid after one second, so the allocated and announced
uid can possibly be re-used by another process.
This is the current behavior, where almost every invocation of a
binary, which changes the uid, creates two events:
$ read START < /sys/kernel/uevent_seqnum; \
for i in `seq 100`; do su --shell=/bin/true bin; done; \
read END < /sys/kernel/uevent_seqnum; \
echo $(($END - $START))
178
With the delayed cleanup, we get only two events, and userspace finishes
a bit faster too:
$ read START < /sys/kernel/uevent_seqnum; \
for i in `seq 100`; do su --shell=/bin/true bin; done; \
read END < /sys/kernel/uevent_seqnum; \
echo $(($END - $START))
1
Acked-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'ipc')
0 files changed, 0 insertions, 0 deletions