Commit:     b599fdfdb4bb4941e9076308efcf3bb89e577db5
Parent:     3fbfa98112fc3962c416452a0baf2214381030e6
Author:     Eric W. Biederman <[EMAIL PROTECTED]>
AuthorDate: Wed Feb 14 00:34:15 2007 -0800
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Wed Feb 14 08:10:00 2007 -0800

    [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]>
 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 118ddfb..b8ede1c 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);
        free_page((unsigned long)buffer);
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to