On Thu, 2007-02-08 at 15:55 -0700, Eric W. Biederman wrote: > 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]> > --- > 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 47fb937..de16b9f 100644 > --- a/security/selinux/hooks.c > +++ b/security/selinux/hooks.c > @@ -1445,6 +1445,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); -- Stephen Smalley National Security Agency - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
- References:
- [PATCH] sysctl selinux: Don't look at table->de
- From: [email protected] (Eric W. Biederman)
- Re: [PATCH] sysctl selinux: Don't look at table->de
- From: Stephen Smalley <[email protected]>
- [PATCH 1/2] sysctl: Add a parent entry to ctl_table and set the parent entry.
- From: [email protected] (Eric W. Biederman)
- [PATCH 2/2] sysctl: Restore the selinux path based label lookup for sysctls.
- From: [email protected] (Eric W. Biederman)
- Re: [PATCH 2/2] sysctl: Restore the selinux path based label lookup for sysctls.
- From: Stephen Smalley <[email protected]>
- Re: [PATCH 2/2] sysctl: Restore the selinux path based label lookup for sysctls.
- From: Stephen Smalley <[email protected]>
- Re: [PATCH 2/2] sysctl: Restore the selinux path based label lookup for sysctls.
- From: [email protected] (Eric W. Biederman)
- Re: [PATCH 2/2] sysctl: Restore the selinux path based label lookup for sysctls.
- From: Stephen Smalley <[email protected]>
- Re: [PATCH 2/2] sysctl: Restore the selinux path based label lookup for sysctls.
- From: [email protected] (Eric W. Biederman)
- Re: [PATCH 2/2] sysctl: Restore the selinux path based label lookup for sysctls.
- From: Stephen Smalley <[email protected]>
- Re: [PATCH 2/2] sysctl: Restore the selinux path based label lookup for sysctls.
- From: [email protected] (Eric W. Biederman)
- [PATCH 0/5] sysctl cleanup selinux fixes
- From: [email protected] (Eric W. Biederman)
- [PATCH 1/5] sysctl: Remove declaration of nonexistent sysctl_init()
- From: [email protected] (Eric W. Biederman)
- [PATCH 2/5] sysctl: Set the parent field in the root sysctl table
- From: [email protected] (Eric W. Biederman)
- [PATCH 3/5] sysctl: Fix the selinux_sysctl_get_sid
- From: [email protected] (Eric W. Biederman)
- [PATCH] sysctl selinux: Don't look at table->de
- Prev by Date: Re: [2.6.20] tifm_7xx1/mmc not working
- Next by Date: Re: [PATCH 4/5] selinux: Enhance selinux to always ignore private inodes.
- Previous by thread: Re: [PATCH 4/5] selinux: Enhance selinux to always ignore private inodes.
- Next by thread: Re: [PATCH 0/5] sysctl cleanup selinux fixes
- Index(es):