Re: [PATCH net-next v7 05/10] landlock: Add LSM hooks related to filesystem

2017-08-27 Thread Alexei Starovoitov
On Sun, Aug 27, 2017 at 03:31:35PM +0200, Mickaël Salaün wrote: > > > How can you add 3rd argument? All FS events would have to get it, > > but in some LSM hooks such argument will be meaningless, whereas > > in other places it will carry useful info that rule can operate on. > > Would that mean t

Re: [PATCH net-next v7 05/10] landlock: Add LSM hooks related to filesystem

2017-08-27 Thread Mickaël Salaün
On 26/08/2017 03:16, Alexei Starovoitov wrote: > On Fri, Aug 25, 2017 at 10:16:39AM +0200, Mickaël Salaün wrote: >>> +/* a directory inode contains only one dentry */ +HOOK_NEW_FS(inode_create, 3, + struct inode *, dir, + struct dentry *, dentry, + umode_t, mode,

Re: [PATCH net-next v7 05/10] landlock: Add LSM hooks related to filesystem

2017-08-25 Thread Alexei Starovoitov
On Fri, Aug 25, 2017 at 10:16:39AM +0200, Mickaël Salaün wrote: > > > >> +/* WRAP_ARG_SB */ > >> +#define WRAP_ARG_SB_TYPE WRAP_TYPE_FS > >> +#define WRAP_ARG_SB_DEC(arg) \ > >> + EXPAND_C(WRAP_TYPE_FS) wrap_##arg = \ > >> + { .type = BPF

Re: [PATCH net-next v7 05/10] landlock: Add LSM hooks related to filesystem

2017-08-25 Thread Mickaël Salaün
On 24/08/2017 04:50, Alexei Starovoitov wrote: > On Mon, Aug 21, 2017 at 02:09:28AM +0200, Mickaël Salaün wrote: >> Handle 33 filesystem-related LSM hooks for the Landlock filesystem >> event: LANDLOCK_SUBTYPE_EVENT_FS. >> >> A Landlock event wrap LSM hooks for similar kernel object types (e.g. >>

Re: [PATCH net-next v7 05/10] landlock: Add LSM hooks related to filesystem

2017-08-23 Thread Alexei Starovoitov
On Mon, Aug 21, 2017 at 02:09:28AM +0200, Mickaël Salaün wrote: > Handle 33 filesystem-related LSM hooks for the Landlock filesystem > event: LANDLOCK_SUBTYPE_EVENT_FS. > > A Landlock event wrap LSM hooks for similar kernel object types (e.g. > struct file, struct path...). Multiple LSM hooks can

Re: [PATCH net-next v7 05/10] landlock: Add LSM hooks related to filesystem

2017-08-22 Thread Mickaël Salaün
On 21/08/2017 02:09, Mickaël Salaün wrote: > Handle 33 filesystem-related LSM hooks for the Landlock filesystem > event: LANDLOCK_SUBTYPE_EVENT_FS. > > A Landlock event wrap LSM hooks for similar kernel object types (e.g. > struct file, struct path...). Multiple LSM hooks can trigger the same > L

[PATCH net-next v7 05/10] landlock: Add LSM hooks related to filesystem

2017-08-20 Thread Mickaël Salaün
Handle 33 filesystem-related LSM hooks for the Landlock filesystem event: LANDLOCK_SUBTYPE_EVENT_FS. A Landlock event wrap LSM hooks for similar kernel object types (e.g. struct file, struct path...). Multiple LSM hooks can trigger the same Landlock event. Landlock handle nine coarse-grained acti