[Top] [All Lists]

Re: [PATCH] fs/vfs/security: pass last path component to LSM on inode cr

To: John Stoffel <john@xxxxxxxxxxx>
Subject: Re: [PATCH] fs/vfs/security: pass last path component to LSM on inode creation
From: Serge Hallyn <serge.hallyn@xxxxxxxxxxxxx>
Date: Thu, 9 Dec 2010 10:05:49 -0600
Cc: Eric Paris <eparis@xxxxxxxxxx>, xfs-masters@xxxxxxxxxxx, linux-btrfs@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, linux-ext4@xxxxxxxxxxxxxxx, cluster-devel@xxxxxxxxxx, linux-mtd@xxxxxxxxxxxxxxxxxxx, jfs-discussion@xxxxxxxxxxxxxxxxxxxxx, ocfs2-devel@xxxxxxxxxxxxxx, reiserfs-devel@xxxxxxxxxxxxxxx, xfs@xxxxxxxxxxx, linux-mm@xxxxxxxxx, linux-security-module@xxxxxxxxxxxxxxx, chris.mason@xxxxxxxxxx, jack@xxxxxxx, akpm@xxxxxxxxxxxxxxxxxxxx, adilger.kernel@xxxxxxxxx, tytso@xxxxxxx, swhiteho@xxxxxxxxxx, dwmw2@xxxxxxxxxxxxx, shaggy@xxxxxxxxxxxxxxxxxx, mfasheh@xxxxxxxx, joel.becker@xxxxxxxxxx, aelder@xxxxxxx, hughd@xxxxxxxxxx, jmorris@xxxxxxxxx, sds@xxxxxxxxxxxxx, eparis@xxxxxxxxxxxxxx, hch@xxxxxx, dchinner@xxxxxxxxxx, viro@xxxxxxxxxxxxxxxxxx, tao.ma@xxxxxxxxxx, shemminger@xxxxxxxxxx, jeffm@xxxxxxxx, serue@xxxxxxxxxx, paul.moore@xxxxxx, penguin-kernel@xxxxxxxxxxxxxxxxxxx, casey@xxxxxxxxxxxxxxxx, kees.cook@xxxxxxxxxxxxx, dhowells@xxxxxxxxxx
In-reply-to: <19712.61515.201226.938553@xxxxxxxxxxxxxxxxx>
References: <20101208194527.13537.77202.stgit@xxxxxxxxxxxxxxxxxxxx> <19712.61515.201226.938553@xxxxxxxxxxxxxxxxx>
User-agent: Mutt/1.5.20 (2009-06-14)
Quoting John Stoffel (john@xxxxxxxxxxx):
> >>>>> "Eric" == Eric Paris <eparis@xxxxxxxxxx> writes:
> Eric> SELinux would like to implement a new labeling behavior of newly
> Eric> created inodes.  We currently label new inodes based on the
> Eric> parent and the creating process.  This new behavior would also
> Eric> take into account the name of the new object when deciding the
> Eric> new label.  This is not the (supposed) full path, just the last
> Eric> component of the path.
> Eric> This is very useful because creating /etc/shadow is different
> Eric> than creating /etc/passwd but the kernel hooks are unable to
> Eric> differentiate these operations.  We currently require that
> Eric> userspace realize it is doing some difficult operation like that
> Eric> and than userspace jumps through SELinux hoops to get things set
> Eric> up correctly.  This patch does not implement new behavior, that
> Eric> is obviously contained in a seperate SELinux patch, but it does
> Eric> pass the needed name down to the correct LSM hook.  If no such
> Eric> name exists it is fine to pass NULL.
> I've looked this patch over, and maybe I'm missing something, but how
> does knowing the name of the file really tell you anything, esp when
> you only get the filename, not the path?  What threat are you
> addressing with this change?  

Like you, I keep thinking back to this patch and going back and forth.
But to answer your question:  in some cases, the name of the file
(plus the context of the directory in which it is created) can tell
you what assumptions userspace will make about it.  And userspace most
definately is a part of the TCB, i.e. /bin/passwd and /bin/login.


<Prev in Thread] Current Thread [Next in Thread>