Re: [RFC PATCH] fanotify, inotify, dnotify, security: add security hook for fs notifications

2019-07-11 Thread James Morris
On Wed, 10 Jul 2019, Casey Schaufler wrote: > On 7/10/2019 6:34 AM, Aaron Goidel wrote: > > > Furthermore, fanotify watches grant more power to > > an application in the form of permission events. While notification events > > are solely, unidirectional (i.e. they only pass information to the > >

Re: [RFC PATCH] fanotify, inotify, dnotify, security: add security hook for fs notifications

2019-07-10 Thread Casey Schaufler
On 7/10/2019 11:39 AM, Stephen Smalley wrote: > On 7/10/19 12:38 PM, Casey Schaufler wrote: >> On 7/10/2019 6:34 AM, Aaron Goidel wrote: >>> As of now, setting watches on filesystem objects has, at most, applied a >>> check for read access to the inode, and in the case of fanotify, requires >>> CAP

Re: [RFC PATCH] fanotify, inotify, dnotify, security: add security hook for fs notifications

2019-07-10 Thread Stephen Smalley
On 7/10/19 12:38 PM, Casey Schaufler wrote: On 7/10/2019 6:34 AM, Aaron Goidel wrote: As of now, setting watches on filesystem objects has, at most, applied a check for read access to the inode, and in the case of fanotify, requires CAP_SYS_ADMIN. No specific security hook or permission check ha

Re: [RFC PATCH] fanotify, inotify, dnotify, security: add security hook for fs notifications

2019-07-10 Thread Randy Dunlap
On 7/10/19 10:22 AM, Joe Perches wrote: > On Wed, 2019-07-10 at 10:18 -0700, Joe Perches wrote: >> On Wed, 2019-07-10 at 09:49 -0700, Randy Dunlap wrote: >>> On 7/10/19 9:38 AM, Casey Schaufler wrote: On 7/10/2019 6:34 AM, Aaron Goidel wrote: > @@ -3261,6 +3262,26 @@ static int selinux_ino

Re: [Non-DoD Source] Re: [RFC PATCH] fanotify, inotify, dnotify, security: add security hook for fs notifications

2019-07-10 Thread Aaron Goidel
On 7/10/19 10:55 AM, Amir Goldstein wrote: On Wed, Jul 10, 2019 at 4:34 PM Aaron Goidel wrote: As of now, setting watches on filesystem objects has, at most, applied a check for read access to the inode, and in the case of fanotify, requires CAP_SYS_ADMIN. No specific security hook or permissi

Re: [RFC PATCH] fanotify, inotify, dnotify, security: add security hook for fs notifications

2019-07-10 Thread Joe Perches
On Wed, 2019-07-10 at 10:18 -0700, Joe Perches wrote: > On Wed, 2019-07-10 at 09:49 -0700, Randy Dunlap wrote: > > On 7/10/19 9:38 AM, Casey Schaufler wrote: > > > On 7/10/2019 6:34 AM, Aaron Goidel wrote: > > > > @@ -3261,6 +3262,26 @@ static int selinux_inode_removexattr(struct > > > > dentry *d

Re: [RFC PATCH] fanotify, inotify, dnotify, security: add security hook for fs notifications

2019-07-10 Thread Joe Perches
On Wed, 2019-07-10 at 09:49 -0700, Randy Dunlap wrote: > On 7/10/19 9:38 AM, Casey Schaufler wrote: > > On 7/10/2019 6:34 AM, Aaron Goidel wrote: > > > @@ -3261,6 +3262,26 @@ static int selinux_inode_removexattr(struct dentry > > > *dentry, const char *name) > > > return -EACCES; > > > } > > >

Re: [RFC PATCH] fanotify, inotify, dnotify, security: add security hook for fs notifications

2019-07-10 Thread Casey Schaufler
On 7/10/2019 9:49 AM, Randy Dunlap wrote: > On 7/10/19 9:38 AM, Casey Schaufler wrote: >> On 7/10/2019 6:34 AM, Aaron Goidel wrote: >>> @@ -3261,6 +3262,26 @@ static int selinux_inode_removexattr(struct dentry >>> *dentry, const char *name) >>> return -EACCES; >>> } >>> >>> +static int seli

Re: [RFC PATCH] fanotify, inotify, dnotify, security: add security hook for fs notifications

2019-07-10 Thread Randy Dunlap
On 7/10/19 9:38 AM, Casey Schaufler wrote: > On 7/10/2019 6:34 AM, Aaron Goidel wrote: >> @@ -3261,6 +3262,26 @@ static int selinux_inode_removexattr(struct dentry >> *dentry, const char *name) >> return -EACCES; >> } >> >> +static int selinux_inode_notify(struct inode *inode, u64 mask) >

Re: [RFC PATCH] fanotify, inotify, dnotify, security: add security hook for fs notifications

2019-07-10 Thread Casey Schaufler
On 7/10/2019 6:34 AM, Aaron Goidel wrote: > As of now, setting watches on filesystem objects has, at most, applied a > check for read access to the inode, and in the case of fanotify, requires > CAP_SYS_ADMIN. No specific security hook or permission check has been > provided to control the setting

Re: [RFC PATCH] fanotify, inotify, dnotify, security: add security hook for fs notifications

2019-07-10 Thread Amir Goldstein
On Wed, Jul 10, 2019 at 4:34 PM Aaron Goidel wrote: > > As of now, setting watches on filesystem objects has, at most, applied a > check for read access to the inode, and in the case of fanotify, requires > CAP_SYS_ADMIN. No specific security hook or permission check has been > provided to control

[RFC PATCH] fanotify, inotify, dnotify, security: add security hook for fs notifications

2019-07-10 Thread Aaron Goidel
As of now, setting watches on filesystem objects has, at most, applied a check for read access to the inode, and in the case of fanotify, requires CAP_SYS_ADMIN. No specific security hook or permission check has been provided to control the setting of watches. Using any of inotify, dnotify, or fano