Re: overlayfs: overlapping upperdir path

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Apr 1, 2021 at 6:09 PM Miklos Szeredi <miklos@xxxxxxxxxx> wrote:
>
> On Thu, Apr 1, 2021 at 4:30 PM Amir Goldstein <amir73il@xxxxxxxxx> wrote:
> >
> > On Thu, Apr 1, 2021 at 4:37 PM Miklos Szeredi <miklos@xxxxxxxxxx> wrote:
> > >
> > > Commit 146d62e5a586 ("ovl: detect overlapping layers") made sure we
> > > don't have overapping layers, but it also broke the arguably valid use
> > > case of
> > >
> > >  mount -olowerdir=/,upperdir=/subdir,..
> > >
> > > where subdir also resides on the root fs.
> >
> > How is 'ls /merged/subdir' expected to behave in that use case?
> > Error?
>
> -ELOOP is the error returned.
>
> >
> > >
> > > I also see that we check for a trap at lookup time, so the question is
> > > what does the up-front layer check buy us?
> > >
> >
> > I'm not sure. I know it bought us silence from syzbot that started
> > mutating many overlapping layers repos....
> > Will the lookup trap have stopped it too? maybe. We did not try.
> >
> > In general I think that if we can error out to user on mount time
> > it is preferred, but if we need to make that use case work, I'd try
> > to relax as minimum as possible from the check.
>
> Certainly.  Like lower inside upper makes zero sense, OTOH upper
> inside lower does.   So I think we just need to relax the
> upperdir/workdir layer check in this case.
>
> Like attached patch.
>

Fine by me.
Let's let syzbot have fun ;-)

Thanks,
Amir.



[Index of Archives]     [Linux Filesystems Devel]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux