]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
selinux: fix labeling of /proc/net inodes
authorStephen Smalley <sds@tycho.nsa.gov>
Fri, 25 Jan 2008 18:03:42 +0000 (13:03 -0500)
committerJames Morris <jmorris@namei.org>
Sat, 26 Jan 2008 01:16:16 +0000 (12:16 +1100)
The proc net rewrite had a side effect on selinux, leading it to mislabel
the /proc/net inodes, thereby leading to incorrect denials.  Fix
security_genfs_sid to ignore extra leading / characters in the path supplied
by selinux_proc_get_sid since we now get "//net/..." rather than "/net/...".

Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
Signed-off-by: James Morris <jmorris@namei.org>
security/selinux/ss/services.c

index f83b19daed16181a86ede00b8d1455432f05acec..4bf715d4cf29e2090ab2d7d97b346a5e4087f9dd 100644 (file)
@@ -1744,6 +1744,9 @@ int security_genfs_sid(const char *fstype,
        struct ocontext *c;
        int rc = 0, cmp = 0;
 
+       while (path[0] == '/' && path[1] == '/')
+               path++;
+
        POLICY_RDLOCK;
 
        for (genfs = policydb.genfs; genfs; genfs = genfs->next) {