diff options
| author | Eric W. Biederman <[email protected]> | 2007-02-14 08:34:15 +0000 |
|---|---|---|
| committer | Linus Torvalds <[email protected]> | 2007-02-14 16:10:00 +0000 |
| commit | b599fdfdb4bb4941e9076308efcf3bb89e577db5 (patch) | |
| tree | c224273f3ef29749bf3f62e06f7ffdee595996c0 /security/selinux/hooks.c | |
| parent | [PATCH] sysctl: remove the proc_dir_entry member for the sysctl tables (diff) | |
| download | kernel-b599fdfdb4bb4941e9076308efcf3bb89e577db5.tar.gz kernel-b599fdfdb4bb4941e9076308efcf3bb89e577db5.zip | |
[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 <[email protected]>
Acked-by: Stephen Smalley <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'security/selinux/hooks.c')
| -rw-r--r-- | security/selinux/hooks.c | 6 |
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) path = end; table = table->parent; } + buflen -= 4; + if (buflen < 0) + goto out_free; + end -= 4; + memcpy(end, "/sys", 4); + path = end; rc = security_genfs_sid("proc", path, tclass, sid); out_free: free_page((unsigned long)buffer); |
