2021-08-09 17:01:21

by Miklos Szeredi

[permalink] [raw]
Subject: [GIT PULL] overlayfs fixes for 5.14-rc6

Hi Linus,

Please pull from:

git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/vfs.git tags/ovl-fixes-5.14-rc6

Fix several bugs in overlayfs.

Thanks,
Miklos

---
Amir Goldstein (1):
ovl: skip stale entries in merge dir cache iteration

Miklos Szeredi (4):
ovl: fix mmap denywrite
ovl: fix deadlock in splice write
ovl: fix uninitialized pointer read in ovl_lookup_real_one()
ovl: prevent private clone if bind mount is not allowed

---
fs/namespace.c | 42 +++++++++++++++++++++++++++--------------
fs/overlayfs/export.c | 2 +-
fs/overlayfs/file.c | 51 ++++++++++++++++++++++++++++++++++++++++++++++++--
fs/overlayfs/readdir.c | 5 +++++
include/linux/mm.h | 2 +-
mm/mmap.c | 2 +-
mm/util.c | 27 +++++++++++++++++++++++++-
7 files changed, 111 insertions(+), 20 deletions(-)


2021-08-10 01:43:39

by Linus Torvalds

[permalink] [raw]
Subject: Re: [GIT PULL] overlayfs fixes for 5.14-rc6

On Mon, Aug 9, 2021 at 2:25 PM Linus Torvalds
<[email protected]> wrote:
>
> I've pulled this,

Actually, I take that back.

None of those things have been in linux-next either, and considering
my worries about it, I want to see more actual testing of this.

Linus

2021-08-10 02:11:42

by Matthew Wilcox

[permalink] [raw]
Subject: Re: [GIT PULL] overlayfs fixes for 5.14-rc6

On Mon, Aug 09, 2021 at 02:26:55PM -0700, Linus Torvalds wrote:
> On Mon, Aug 9, 2021 at 2:25 PM Linus Torvalds
> <[email protected]> wrote:
> >
> > I've pulled this,
>
> Actually, I take that back.
>
> None of those things have been in linux-next either, and considering
> my worries about it, I want to see more actual testing of this.

Not only that, the changes to fs/namespace.c and mm/util.c haven't been
posted to linux-mm or linux-fsdevel, as far as I can tell.

2021-08-10 03:03:16

by Linus Torvalds

[permalink] [raw]
Subject: Re: [GIT PULL] overlayfs fixes for 5.14-rc6

On Mon, Aug 9, 2021 at 10:00 AM Miklos Szeredi <[email protected]> wrote:
>
> ovl: fix mmap denywrite

Ugh. Th edances with denywrite and mapping_unmap_writable are really
really annoying.

I've pulled this, but I really get the feeling that there's duplicated
code for these things, and that all the "if error goto" cases (some
old, some new) are really really uglky.

I get the feeling that the whole thing with deny_write_access and
mapping_map_writable could possibly be done after-the-fact somehow as
part of actually inserting the vma in the vma tree, rather than done
as the vma is prepared.

And most users of vma_set_file() probably really don't want that whole
thing at all (ie the DRM stuff that just switches out a local thing.
They also don't check for the new error cases you've added.

So I really think this is quite questionable, and those cases should
probably have been done entirely inside ovlfs rather than polluting
the cases that don't care and don't check.

Linus

2021-08-10 06:57:11

by Miklos Szeredi

[permalink] [raw]
Subject: Re: [GIT PULL] overlayfs fixes for 5.14-rc6

On Tue, 10 Aug 2021 at 00:34, Matthew Wilcox <[email protected]> wrote:
>
> On Mon, Aug 09, 2021 at 02:26:55PM -0700, Linus Torvalds wrote:
> > On Mon, Aug 9, 2021 at 2:25 PM Linus Torvalds
> > <[email protected]> wrote:
> > >
> > > I've pulled this,
> >
> > Actually, I take that back.
> >
> > None of those things have been in linux-next either, and considering
> > my worries about it, I want to see more actual testing of this.

The denywrite patch has been in -next for three weeks, the others
less, but also spent some time in there. The reason the commit
timestamp is so recent is that the fixes have been pulled to the front
of the queue.

But okay, I can drop that patch from this pull request.

> Not only that, the changes to fs/namespace.c and mm/util.c haven't been
> posted to linux-mm or linux-fsdevel, as far as I can tell.

It has been posted to both and got an ACK from an MM person:

https://lore.kernel.org/linux-mm/[email protected]/

Thanks,
Miklos