Hi Andrea,

thanks a lot!

1. In my original patch here:
https://patchwork.ozlabs.org/project/ubuntu-kernel/patch/20210426081121.37363-1-alexan...@mihalicyn.com/

there was no "fput" call inside ovl_vm_prfile_set helper. fput was in
the outer ovl_mmap() function in fs/overlayfs/file.c

You last fix looks fully correct.

2. If we compare ovl_mmap function between 5.8 branch and 5.15:
https://git.launchpad.net/~ubuntu-kernel/ubuntu/+source/linux/+git/focal/tree/fs/overlayfs/file.c?h=hwe-5.8#n461

https://git.launchpad.net/~ubuntu-
kernel/ubuntu/+source/linux/+git/focal/tree/fs/overlayfs/file.c?h=hwe-5.15-next&id=e3e60b65fa4db4722bd4b02a9dae58f7ff5d83d2#n528

we can see that ovl_mmap function was changed after:
https://git.launchpad.net/~ubuntu-kernel/ubuntu/+source/linux/+git/focal/commit/fs/overlayfs/file.c?h=hwe-5.15-next&id=2896900e22f8212606a1837d89a6bbce314ceeda

that's the point where the problem was introduced and ovl_vm_prfile_set
with this "fput" become incorrect.

Right now, with your fix all seems correct.

3. But there is a question. Can we split this thing out of AUFS? As I mentioned 
before all that we really need here is this part:
https://github.com/JPyke3/mbp-manjaro-kernel/blob/master/aufs5-mmap.patch

Why we can't remove this `#if IS_ENABLED(CONFIG_AUFS_FS)` and use "shadow file" 
helper all the time?
I'm ready to prepare and test full version of patches to achieve that if it's 
needed.

Regards,
Alex

-- 
You received this bug notification because you are a member of Kernel
Packages, which is subscribed to linux in Ubuntu.
https://bugs.launchpad.net/bugs/1967924

Title:
  re-apply missing overlayfs SAUCE patch

Status in linux package in Ubuntu:
  Fix Committed
Status in linux source package in Impish:
  Fix Committed
Status in linux source package in Jammy:
  In Progress

Bug description:
  [Impact]

  Starting with 5.13 we've incorrectly dropped the following sauce
  patch:

      UBUNTU: SAUCE: overlayfs: fix incorrect mnt_id of files opened
  from map_files

  This patch seems to be required to use overlayfs on top of shiftfs and
  without this patch we may break containers that rely on shiftfs (using
  zfs/ceph as storage pool w/ shiftfs enabled).

  [Test case]

  No specific test case provided.

  [Fix]

  The original SAUCE patch relies on AUFS in order to use
  vma->vm_prfile, but we're not providing AUFS anymore in jammy,.

  The fix consists of re-apply this patch with a little refactoring to
  be dependent on CONFIG_AUFS_FS.

  [Regression potential]

  This patch is touching overlayfs, so we may see potential regressions
  in overlayfs.

  [Original bug report]

  The next patch has not been ported to the the 5.13 branch:

  $ git show Ubuntu-azure-5.8-5.8.0-1033.35_20.04.1~656
  commit 5f5716d1f7ece06c66d7d8145dd6b3a5886b3e56
  Author: Alexander Mikhalitsyn <alexan...@mihalicyn.com>
  Date:   Mon Apr 26 10:11:00 2021 +0200

      UBUNTU: SAUCE: overlayfs: fix incorrect mnt_id of files opened
  from map_files

      BugLink: https://bugs.launchpad.net/bugs/1857257

  ...

      Fixes: d24b8a5 ("UBUNTU: SAUCE: overlayfs: allow with shiftfs as
  underlay")

  But it isn't in the 5.13 branch:

  $ git log --pretty=oneline origin/azure-5.13-next fs/overlayfs/file.c
  1e6145d8708c831d2aa5c26aa15eb98e1a1683b9 ovl: fix use after free in struct 
ovl_aio_req
  7b5bda27d1fc4d7bde20cf6ed203fe88c458169a ovl: fix IOCB_DIRECT if underlying 
fs doesn't support direct IO
  1626e7f7ab7eb74e142fec7fe6b7c9614972a56b ovl: fix deadlock in splice write
  1443bc4a25ca84d60d39a8ae1dc6215abdd637a4 UBUNTU: SAUCE: overlayfs: allow with 
shiftfs as underlay

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1967924/+subscriptions


-- 
Mailing list: https://launchpad.net/~kernel-packages
Post to     : kernel-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kernel-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to