Re: [PATCH v9 08/10] open: openat2(2) syscall

2019-07-19 Thread Christian Brauner
On Fri, Jul 19, 2019 at 05:12:18AM +0300, Dmitry V. Levin wrote: > On Thu, Jul 18, 2019 at 11:29:50PM +0200, Arnd Bergmann wrote: > [...] > > 5. you get the same problem with seccomp and strace that > >clone3() has -- these and others only track the register > >arguments by default. > >

Re: [PATCH v9 08/10] open: openat2(2) syscall

2019-07-18 Thread Aleksa Sarai
On 2019-07-19, Dmitry V. Levin wrote: > On Sun, Jul 07, 2019 at 12:57:35AM +1000, Aleksa Sarai wrote: > [...] > > +/** > > + * Arguments for how openat2(2) should open the target path. If @extra is > > zero, > > + * then openat2(2) is identical to openat(2). > > + * > > + * @flags: O_* flags

Re: [PATCH v9 08/10] open: openat2(2) syscall

2019-07-18 Thread Dmitry V. Levin
On Thu, Jul 18, 2019 at 11:29:50PM +0200, Arnd Bergmann wrote: [...] > 5. you get the same problem with seccomp and strace that >clone3() has -- these and others only track the register >arguments by default. Just for the record, this is definitely not the case for strace: it decodes

Re: [PATCH v9 08/10] open: openat2(2) syscall

2019-07-18 Thread Dmitry V. Levin
On Sun, Jul 07, 2019 at 12:57:35AM +1000, Aleksa Sarai wrote: [...] > +/** > + * Arguments for how openat2(2) should open the target path. If @extra is > zero, > + * then openat2(2) is identical to openat(2). > + * > + * @flags: O_* flags (unknown flags ignored). What was the rationale for

Re: [PATCH v9 08/10] open: openat2(2) syscall

2019-07-18 Thread Arnd Bergmann
On Thu, Jul 18, 2019 at 6:12 PM Aleksa Sarai wrote: > On 2019-07-18, Arnd Bergmann wrote: > > On Sat, Jul 6, 2019 at 5:00 PM Aleksa Sarai wrote: > > > > In fact, that seems similar enough to the existing openat() that I think > > you could also just add the fifth argument to the existing call

Re: [PATCH v9 08/10] open: openat2(2) syscall

2019-07-18 Thread Aleksa Sarai
On 2019-07-18, Arnd Bergmann wrote: > On Sat, Jul 6, 2019 at 5:00 PM Aleksa Sarai wrote: > > > diff --git a/arch/alpha/kernel/syscalls/syscall.tbl > > b/arch/alpha/kernel/syscalls/syscall.tbl > > index 9e7704e44f6d..1703d048c141 100644 > > --- a/arch/alpha/kernel/syscalls/syscall.tbl > > +++

Re: [PATCH v9 08/10] open: openat2(2) syscall

2019-07-18 Thread Aleksa Sarai
On 2019-07-18, Rasmus Villemoes wrote: > On 06/07/2019 16.57, Aleksa Sarai wrote: > > --- a/fs/open.c > > +++ b/fs/open.c > > @@ -928,24 +928,32 @@ struct file *open_with_fake_path(const struct path > > *path, int flags, > > } > > EXPORT_SYMBOL(open_with_fake_path); > > > > -static inline

Re: [PATCH v9 08/10] open: openat2(2) syscall

2019-07-18 Thread Arnd Bergmann
On Sat, Jul 6, 2019 at 5:00 PM Aleksa Sarai wrote: > diff --git a/arch/alpha/kernel/syscalls/syscall.tbl > b/arch/alpha/kernel/syscalls/syscall.tbl > index 9e7704e44f6d..1703d048c141 100644 > --- a/arch/alpha/kernel/syscalls/syscall.tbl > +++ b/arch/alpha/kernel/syscalls/syscall.tbl > @@ -461,6

Re: [PATCH v9 08/10] open: openat2(2) syscall

2019-07-18 Thread Rasmus Villemoes
On 06/07/2019 16.57, Aleksa Sarai wrote: > > --- a/fs/open.c > +++ b/fs/open.c > @@ -928,24 +928,32 @@ struct file *open_with_fake_path(const struct path > *path, int flags, > } > EXPORT_SYMBOL(open_with_fake_path); > > -static inline int build_open_flags(int flags, umode_t mode, struct >

[PATCH v9 08/10] open: openat2(2) syscall

2019-07-06 Thread Aleksa Sarai
The most obvious syscall to add support for the new LOOKUP_* scoping flags would be openat(2). However, there are a few reasons to not do this: * The new LOOKUP_* flags are intended to be security features, and openat(2) will silently ignore all unknown flags. This means that users would