From a26578dbb93dbaab1910b52f9fa1c87f8c9e6d1e Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Thu, 24 Apr 2014 13:38:29 -0400 Subject: 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 Signed-off-by: Ray Strode Signed-off-by: Keith Packard --- Xext/xselinux_hooks.c | 4 ++-- 1 file 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(); } -- cgit v1.2.3