selinux: Fix regression for Xorg
authorStephen Smalley <sds@tycho.nsa.gov>
Fri, 25 Mar 2011 14:13:43 +0000 (10:13 -0400)
committerEric Paris <eparis@redhat.com>
Thu, 7 Apr 2011 16:00:12 +0000 (12:00 -0400)
Commit 6f5317e730505d5cbc851c435a2dfe3d5a21d343 introduced a bug in the
handling of userspace object classes that is causing breakage for Xorg
when XSELinux is enabled.  Fix the bug by changing map_class() to return
SECCLASS_NULL when the class cannot be mapped to a kernel object class.

Reported-by: "Justin P. Mattock" <justinmattock@gmail.com>
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
Signed-off-by: James Morris <jmorris@namei.org>
security/selinux/ss/services.c

index 39d732145abe3ac4039f7e41f8e4c8b44a2c5ca3..f3f5dca810069e757d4e89ca54e37bf9d0960883 100644 (file)
@@ -213,7 +213,7 @@ static u16 map_class(u16 pol_value)
                        return i;
        }
 
-       return pol_value;
+       return SECCLASS_NULL;
 }
 
 static void map_decision(u16 tclass, struct av_decision *avd,