No description
Find a file
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
checkpolicy checkpolicy: fix dispol/dismod display for filename trans rules 2011-08-01 13:40:20 -04:00
libselinux Minor version bump for release 2011-07-27 15:32:54 -04:00
libsemanage Minor version bump for release 2011-07-27 15:32:54 -04:00
libsepol libsepol: store all filename transition rules when parsing a policy 2011-08-01 13:40:19 -04:00
policycoreutils restorecond: Ignore IN_IGNORED inotify events 2011-08-01 13:40:20 -04:00
scripts release script 2009-03-12 01:23:32 -04:00
sepolgen Minor version bump for release 2011-07-27 15:32:54 -04:00
.gitignore Add pkgconfig files for libsepol, libselinux, and libsemanage. 2009-10-22 14:50:07 -04:00
Makefile initial import from svn trunk revision 2950 2008-08-19 15:30:36 -04:00