From: ebiederm@xmission.com (Eric W. Biederman)
To: Andrew Morton <akpm@osdl.org>
Cc: <linux-kernel@vger.kernel.org>, <containers@lists.osdl.org>
Cc: Stephen Smalley <sds@tycho.nsa.gov>
Subject: Re: [PATCH 4/7] proc: Make the generation of the self symlink table driven.
Date: Sat, 19 Aug 2006 13:04:34 -0600 [thread overview]
Message-ID: <m1veootum5.fsf@ebiederm.dsl.xmission.com> (raw)
In-Reply-To: <20060819090322.1b991a33.akpm@osdl.org> (Andrew Morton's message of "Sat, 19 Aug 2006 09:03:22 -0700")
Andrew Morton <akpm@osdl.org> writes:
> On Sat, 19 Aug 2006 03:07:37 -0600
> ebiederm@xmission.com (Eric W. Biederman) wrote:
>
>> Andrew Morton <akpm@osdl.org> writes:
>>
>> > On Tue, 15 Aug 2006 12:05:27 -0600
>> > "Eric W. Biederman" <ebiederm@xmission.com> wrote:
>> >
>> >> By not rolling our own inode we get a little more code reuse,
>> >> and things get a little simpler and we don't have special
>> >> cases to contend with later.
>> >
>> > On a standard FC5 install (which has selinux enabled) things get very ugly.
>> >
>> > udev: MAKEDEV: mkdir: file exists
>> >
>> > followed by a stream of udev errors of various sorts and then an infinite
>> > loop of auditd complaints about klogd and "/" and tmpfs. Nothing makes it
>> > to logs because klogd itself is failing.
>>
>> I'm not feeling very generous today. I'm wondering what selinux bug
>> I have found now. Without selinux everything is fine on FC5.
>>
>> Any chance of a search through that patchset to see which patch selinux
>> trips on?
>>
>
> This one. "PATCH 4/7] proc: Make the generation of the self symlink table
> driven."
Thanks. I have reproduced it and I can see what is different. There
is a call of security_task_to_inode that was added to the /proc/self
inode creation.
The following patch works around the problem, by preserving the
current behavior of security label assignment. I have yet to work out
why having a different security label causes failure for a world
accessible symlink.
I am starting to suspect that security_task_to_inode is a fundamentally
flawed concept, as I can get around it by opening a file before the security
label changes, and still have access to it. Which in proc is a bad
thing. But there are already checks on the paths that have sensitive
data so I'm not certain what the point of security_task_to_inode.
I have a bunch more digging to do to understand what is really going
on and if any of it makes sense.
Currently it looks like the good fix will be to just delete security_task_to_inode.
But I won't generate the patch for that until I dig into this farther.
---
security/selinux/hooks.c | 13 ++++++++++++-
1 files changed, 12 insertions(+), 1 deletions(-)
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index 180b26b..59bfd3c 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -2868,7 +2868,18 @@ static void selinux_task_to_inode(struct
struct task_security_struct *tsec = p->security;
struct inode_security_struct *isec = inode->i_security;
- isec->sid = tsec->sid;
+ if (S_ISLNK(inode->i_mode)) {
+ struct superblock_security_struct *sbsec;
+ sbsec = inode->i_sb->s_security;
+ if (!sbsec->initialized) {
+ /* Defer initialization */
+ printk(KERN_EMERG "%s sb not initialized\n", __func__);
+ return;
+ }
+ isec->sid = sbsec->sid;
+ } else {
+ isec->sid = tsec->sid;
+ }
isec->initialized = 1;
return;
}
next prev parent reply other threads:[~2006-08-19 19:05 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-15 18:00 The rest of my proc cleanup Eric W. Biederman
2006-08-15 18:05 ` [PATCH 1/7] proc: Reorder the functions in base.c Eric W. Biederman
2006-08-15 18:05 ` [PATCH 2/7] proc: Modify proc_pident_lookup to be completely table driven Eric W. Biederman
2006-08-15 18:31 ` Dave Hansen
2006-08-15 18:55 ` Eric W. Biederman
2006-08-16 14:48 ` Jan Engelhardt
2006-08-15 18:05 ` [PATCH 3/7] proc: Give the root directory a task Eric W. Biederman
2006-08-15 18:05 ` [PATCH 4/7] proc: Make the generation of the self symlink table driven Eric W. Biederman
2006-08-19 8:06 ` Andrew Morton
2006-08-19 9:07 ` Eric W. Biederman
2006-08-19 16:03 ` Andrew Morton
2006-08-19 19:04 ` Eric W. Biederman [this message]
2006-08-19 9:54 ` Eric W. Biederman
2006-08-15 18:05 ` [PATCH 5/7] proc: Factor out an instantiate method from every lookup method Eric W. Biederman
2006-08-16 14:52 ` Jan Engelhardt
2006-08-15 18:05 ` [PATCH 6/7] proc: Remove the hard coded inode numbers Eric W. Biederman
2006-08-15 18:05 ` [PATCH 7/7] proc: Merge proc_tid_attr and proc_tgid_attr Eric W. Biederman
2006-08-15 18:33 ` The rest of my proc cleanup Paul Jackson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m1veootum5.fsf@ebiederm.dsl.xmission.com \
--to=ebiederm@xmission.com \
--cc=akpm@osdl.org \
--cc=containers@lists.osdl.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.