aboutsummaryrefslogtreecommitdiffstats
path: root/security
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2007-02-14 03:34:15 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-14 11:10:00 -0500
commitb599fdfdb4bb4941e9076308efcf3bb89e577db5 (patch)
treec224273f3ef29749bf3f62e06f7ffdee595996c0 /security
parent3fbfa98112fc3962c416452a0baf2214381030e6 (diff)
[PATCH] sysctl: fix the selinux_sysctl_get_sid
I goofed and when reenabling the fine grained selinux labels for sysctls and forgot to add the "/sys" prefix before consulting the policy database. When computing the same path using proc_dir_entries we got the "/sys" for free as it was part of the tree, but it isn't true for clt_table trees. Signed-off-by: Eric W. Biederman <ebiederm@xmission.com> Acked-by: Stephen Smalley <sds@tycho.nsa.gov> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'security')
-rw-r--r--security/selinux/hooks.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index 118ddfb614ee..b8ede1c7607b 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -1451,6 +1451,12 @@ static int selinux_sysctl_get_sid(ctl_table *table, u16 tclass, u32 *sid)
1451 path = end; 1451 path = end;
1452 table = table->parent; 1452 table = table->parent;
1453 } 1453 }
1454 buflen -= 4;
1455 if (buflen < 0)
1456 goto out_free;
1457 end -= 4;
1458 memcpy(end, "/sys", 4);
1459 path = end;
1454 rc = security_genfs_sid("proc", path, tclass, sid); 1460 rc = security_genfs_sid("proc", path, tclass, sid);
1455out_free: 1461out_free:
1456 free_page((unsigned long)buffer); 1462 free_page((unsigned long)buffer);