Re: [PATCH 1/3] namei: implement O_BENEATH-style AT_* flags

2018-10-04 Thread Christian Brauner
On Tue, Oct 02, 2018 at 02:04:31AM +1000, Aleksa Sarai wrote: > On 2018-10-01, Christian Brauner wrote: > > On Mon, Oct 01, 2018 at 02:28:03PM +0200, Jann Horn wrote: > > > On Sat, Sep 29, 2018 at 4:28 PM Aleksa Sarai wrote: > > > > * AT_BENEATH: Disallow ".." or absolute paths (either in the pat

Re: [PATCH 1/3] namei: implement O_BENEATH-style AT_* flags

2018-10-01 Thread Aleksa Sarai
On 2018-10-01, Christian Brauner wrote: > On Mon, Oct 01, 2018 at 02:28:03PM +0200, Jann Horn wrote: > > On Sat, Sep 29, 2018 at 4:28 PM Aleksa Sarai wrote: > > > * AT_BENEATH: Disallow ".." or absolute paths (either in the path or > > > found during symlink resolution) to escape the starting p

Re: [PATCH 1/3] namei: implement O_BENEATH-style AT_* flags

2018-10-01 Thread Christian Brauner
On Mon, Oct 01, 2018 at 02:28:03PM +0200, Jann Horn wrote: > On Sat, Sep 29, 2018 at 4:28 PM Aleksa Sarai wrote: > > Add the following flags for path resolution. The primary justification > > for these flags is to allow for programs to be far more strict about how > > they want path resolution to

Re: [PATCH 1/3] namei: implement O_BENEATH-style AT_* flags

2018-10-01 Thread Jann Horn
On Sat, Sep 29, 2018 at 4:28 PM Aleksa Sarai wrote: > Add the following flags for path resolution. The primary justification > for these flags is to allow for programs to be far more strict about how > they want path resolution to handle symlinks, mountpoint crossings, and > paths that escape the

Re: [PATCH 1/3] namei: implement O_BENEATH-style AT_* flags

2018-09-29 Thread Aleksa Sarai
On 2018-09-29, Aleksa Sarai wrote: > * AT_XDEV: Disallow mount-point crossing (both *down* into one, or *up* > from one). The primary "scoping" use is to blocking resolution that > crosses a bind-mount, which has a similar property to a symlink (in > the way that it allows for escape from th

Re: [PATCH 1/3] namei: implement O_BENEATH-style AT_* flags

2018-09-29 Thread Aleksa Sarai
On 2018-09-29, Christian Brauner wrote: > > Cc: Andy Lutomirski > > Cc: Eric Biederman > > Cc: Christian Brauner > > Signed-off-by: Aleksa Sarai > > Not to be a stickler about protocol but given that this is based heavily > on ideas from prior patchsets and suggestions as you mentioned it mig

Re: [PATCH 1/3] namei: implement O_BENEATH-style AT_* flags

2018-09-29 Thread Christian Brauner
On Sat, Sep 29, 2018 at 08:34:51PM +1000, Aleksa Sarai wrote: > Add the following flags for path resolution. The primary justification > for these flags is to allow for programs to be far more strict about how > they want path resolution to handle symlinks, mountpoint crossings, and > paths that es

[PATCH 1/3] namei: implement O_BENEATH-style AT_* flags

2018-09-29 Thread Aleksa Sarai
Add the following flags for path resolution. The primary justification for these flags is to allow for programs to be far more strict about how they want path resolution to handle symlinks, mountpoint crossings, and paths that escape the dirfd (through an absolute path or ".." shenanigans). This i