summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRay Strode <rstrode@redhat.com>2014-04-24 13:38:29 -0400
committerKeith Packard <keithp@keithp.com>2014-04-30 08:56:35 -0700
commita26578dbb93dbaab1910b52f9fa1c87f8c9e6d1e (patch)
treea9ed50529115af2daf9065652e2f17363c2bc23f
parentbcb17b99873f020f2639b860ce99d260def0cd97 (diff)
selinux: don't checkout for AVCs on select() EINTR
wakeup handlers are called even when select() returns EINTR, and when they're called the passed fd set is undefined. This commit fixes the selinux wakeup handler to avoid checking for AVCs over the netlink socket spuriously. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Ray Strode <rstrode@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r--Xext/xselinux_hooks.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Xext/xselinux_hooks.c b/Xext/xselinux_hooks.c
index 376d57518..48219a9e0 100644
--- a/Xext/xselinux_hooks.c
+++ b/Xext/xselinux_hooks.c
@@ -812,9 +812,9 @@ SELinuxBlockHandler(void *data, struct timeval **tv, void *read_mask)
}
static void
-SELinuxWakeupHandler(void *data, int err, void *read_mask)
+SELinuxWakeupHandler(void *data, int num_fds, void *read_mask)
{
- if (FD_ISSET(netlink_fd, (fd_set *) read_mask))
+ if (num_fds > 0 && FD_ISSET(netlink_fd, (fd_set *) read_mask))
avc_netlink_check_nb();
}