[PATCH 2/2] selinux: don't checkout for AVCs on select() EINTR

Adam Jackson ajax at redhat.com
Thu Apr 24 10:38:29 PDT 2014


From: Ray Strode <rstrode at redhat.com>

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 at redhat.com>
Signed-off-by: Ray Strode <rstrode at redhat.com>
---
 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 376d575..48219a9 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();
 }
 
-- 
1.8.5.3



More information about the xorg-devel mailing list