lkml.org 
[lkml]   [2015]   [Jun]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 5/7] SELinux: Handle opening of a unioned file
Date
Stephen Smalley <sds@tycho.nsa.gov> wrote:

> Why are you talking about file_open()?

Because that's the focus of the patch 5/7 that this comment chain is in
response to. You said that it should have a common helper with the dentry and
inode init functions.

Also, would be good to create a common helper for use here, by
selinux_dentry_init_security(), selinux_inode_init_security(), and
may_create(). Already some seeming potential for inconsistencies
there.

Okay, I missed that you'd said may_create() too. I further assumed that you
meant that selinux_file_open_union() should use the common helper too.

> Until a process writes to the file, we just want to use the lower inode
> label, right?

No.

There are two issues:

(1) Non-fd accesses to an overlayfs file use the security label on the
overlay inode, not the lower inode, even before copy up because they go
through the inode ops of the overlayfs file first.

(2) I'm told that we want the ability to have a different label on the upper
file to that on the lower file. This is trivial in overlayfs since you
always have an overlay inode off which to hang the security label, but
tricky with unionmount since you may only have a dentry.

David


\
 
 \ /
  Last update: 2015-06-17 00:01    [W:0.124 / U:0.320 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site