platform_external_selinux/policycoreutils
Martin Orr c588b44219 restorecond: Ignore IN_IGNORED inotify events
With kernel 2.6.31, restorecond uses 99% of my CPU.

This is because removing and readding the watch on utmp triggers inotify to
return an IN_IGNORED event for the old watch descriptor.  If the watch gets
allocated the same wd when it is readded, then restorecond thinks that utmp
has changed, so removes and readds the watch again, potentially looping.

With kernel <= 2.6.30, this never happened, because the kernel didn't reuse
watch descriptors.  So the IN_IGNORED event comes with a wd that is no
longer in use, and gets ignored.  But kernel 2.6.31 reuses the same watch
descriptor.

This patch fixes that by ignoring inotify events whose only bit set is
IN_IGNORED.

Note: it is not clear to me why it is necessary to remove and readd the
watch in the first place.

Note for testing: you need to log in (to cause a change in utmp) after
starting restorecond to trigger the bug.  In fact you need to log in twice
before the kernel reuses a watch descriptor.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-08-01 13:40:20 -04:00
..
audit2allow Rearranged audit2allow.1 to match the newer ways we use the tool. 2011-08-01 13:40:20 -04:00
audit2why initial import from svn trunk revision 2950 2008-08-19 15:30:36 -04:00
load_policy Author: Daniel J Walsh 2009-11-18 15:33:00 -05:00
mcstrans mcstransd select correct colour range. 2011-04-11 10:27:13 -04:00
newrole Exit newrole if capabilities can't be dropped 2010-12-20 15:13:33 -05:00
po remove gui from po/Makefile and po/POTFILES and regenerate po files 2009-06-24 10:54:56 -04:00
restorecond restorecond: Ignore IN_IGNORED inotify events 2011-08-01 13:40:20 -04:00
run_init Author: Manoj Srivastava 2009-09-16 11:16:19 -04:00
sandbox Author: Steve Lawrence 2010-06-10 16:37:59 -04:00
scripts This patch removes OUTPUT from fixfiles which was never used and was broken 2009-11-27 12:44:16 -05:00
secon initial import from svn trunk revision 2950 2008-08-19 15:30:36 -04:00
semanage Fix bug in semanage fcontext 2009-11-19 15:01:13 -05:00
semodule Last attempt at upstreaming semodule_disable patch. 2010-03-06 17:56:24 -05:00
semodule_deps initial import from svn trunk revision 2950 2008-08-19 15:30:36 -04:00
semodule_expand initial import from svn trunk revision 2950 2008-08-19 15:30:36 -04:00
semodule_link initial import from svn trunk revision 2950 2008-08-19 15:30:36 -04:00
semodule_package initial import from svn trunk revision 2950 2008-08-19 15:30:36 -04:00
sestatus initial import from svn trunk revision 2950 2008-08-19 15:30:36 -04:00
setfiles Author: Thomas Liu 2009-11-02 17:02:25 -05:00
setsebool initial import from svn trunk revision 2950 2008-08-19 15:30:36 -04:00
.gitignore Add subdirectory .gitignore files. 2009-10-20 21:25:55 -04:00
ChangeLog Minor version bump for release 2011-07-27 15:32:54 -04:00
COPYING initial import from svn trunk revision 2950 2008-08-19 15:30:36 -04:00
Makefile Author: Daniel J Walsh 2010-06-10 16:35:55 -04:00
VERSION Minor version bump for release 2011-07-27 15:32:54 -04:00