Public bug reported:

[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 is 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).

However, we made this patch dependent on AUFS, starting with Jammy we're
not enabling AUFS anymore, so this fix becomes a no-op.

So we need to re-introduce this fix with a bit of refactoring to not
depend on AUFS.

[Test case]

The following script can be used to trigger the issue:

  #!/bin/bash

  cat > test.py << EOF
  import sys

  f = open("/proc/self/maps")

  for l in f.readlines():
    if "python" not in l:
      continue
    print(l)
    s = l.split()
    start, end = s[0].split("-")
    fname = s[-1]
    print(start, end, fname)
    break
  else:
    sys.exit(1)

  test_file1 = open(fname)
  test_file2 = open("/proc/self/map_files/%s-%s" % (start, end))

  fdinfo1 = open("/proc/self/fdinfo/%d" % test_file1.fileno()).read()
  fdinfo2 = open("/proc/self/fdinfo/%d" % test_file2.fileno()).read()

  if fdinfo1 != fdinfo2:
    print("FAIL")
    print(test_file1)
    print(fdinfo1)
    print(test_file2)
    print(fdinfo2)
    sys.exit(1)
  print("PASS")
  EOF
  sudo docker run -it --privileged --rm -v `pwd`:/mnt python python /mnt/test.py

[Fix]

Import the right pieces from AUFS to properly support the fix and get
rid of the AUFS dependency across all our kernels.

[Regression potential]

This patch is touching overlayfs, so we may see potential regressions in
overlayfs, especially when containers are used.

** Affects: linux (Ubuntu)
     Importance: Undecided
         Status: New

** Affects: linux (Ubuntu Focal)
     Importance: Undecided
         Status: New

** Affects: linux (Ubuntu Jammy)
     Importance: Undecided
         Status: New

** Affects: linux (Ubuntu Kinetic)
     Importance: Undecided
         Status: New

** Also affects: linux (Ubuntu Focal)
   Importance: Undecided
       Status: New

** Also affects: linux (Ubuntu Jammy)
   Importance: Undecided
       Status: New

** Also affects: linux (Ubuntu Kinetic)
   Importance: Undecided
       Status: New

-- 
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/1983640

Title:
  refactoring of overlayfs fix to report the right mnt_id of files
  opened from map_files

Status in linux package in Ubuntu:
  New
Status in linux source package in Focal:
  New
Status in linux source package in Jammy:
  New
Status in linux source package in Kinetic:
  New

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 is 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).

  However, we made this patch dependent on AUFS, starting with Jammy
  we're not enabling AUFS anymore, so this fix becomes a no-op.

  So we need to re-introduce this fix with a bit of refactoring to not
  depend on AUFS.

  [Test case]

  The following script can be used to trigger the issue:

    #!/bin/bash

    cat > test.py << EOF
    import sys

    f = open("/proc/self/maps")

    for l in f.readlines():
      if "python" not in l:
        continue
      print(l)
      s = l.split()
      start, end = s[0].split("-")
      fname = s[-1]
      print(start, end, fname)
      break
    else:
      sys.exit(1)

    test_file1 = open(fname)
    test_file2 = open("/proc/self/map_files/%s-%s" % (start, end))

    fdinfo1 = open("/proc/self/fdinfo/%d" % test_file1.fileno()).read()
    fdinfo2 = open("/proc/self/fdinfo/%d" % test_file2.fileno()).read()

    if fdinfo1 != fdinfo2:
      print("FAIL")
      print(test_file1)
      print(fdinfo1)
      print(test_file2)
      print(fdinfo2)
      sys.exit(1)
    print("PASS")
    EOF
    sudo docker run -it --privileged --rm -v `pwd`:/mnt python python 
/mnt/test.py

  [Fix]

  Import the right pieces from AUFS to properly support the fix and get
  rid of the AUFS dependency across all our kernels.

  [Regression potential]

  This patch is touching overlayfs, so we may see potential regressions
  in overlayfs, especially when containers are used.

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


-- 
Mailing list: https://launchpad.net/~kernel-packages
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~kernel-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to