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

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

** Also affects: linux-meta-hwe-5.11 (Ubuntu Hirsute)
   Importance: Undecided
       Status: New

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

** Also affects: linux-meta-hwe-5.11 (Ubuntu Impish)
   Importance: Undecided
       Status: Confirmed

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

** Also affects: linux-meta-hwe-5.11 (Ubuntu Focal)
   Importance: Undecided
       Status: New

** Changed in: linux-meta-hwe-5.11 (Ubuntu Focal)
       Status: New => Confirmed

** Changed in: linux (Ubuntu Hirsute)
       Status: New => Confirmed

** Changed in: linux-meta-hwe-5.11 (Ubuntu Hirsute)
       Status: New => Invalid

** Changed in: linux-meta-hwe-5.11 (Ubuntu Impish)
       Status: Confirmed => Invalid

** Changed in: linux (Ubuntu Focal)
       Status: New => Invalid

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

Title:
  REGRESSION: shiftfs lets sendfile fail with EINVAL

Status in linux package in Ubuntu:
  New
Status in linux-meta-hwe-5.11 package in Ubuntu:
  Invalid
Status in linux source package in Focal:
  Invalid
Status in linux-meta-hwe-5.11 source package in Focal:
  Confirmed
Status in linux source package in Hirsute:
  Confirmed
Status in linux-meta-hwe-5.11 source package in Hirsute:
  Invalid
Status in linux source package in Impish:
  New
Status in linux-meta-hwe-5.11 source package in Impish:
  Invalid

Bug description:
  With the 5.11 HWE kernel landing for Ubuntu 20.04 we noticed that LXC
  tools we're using in bionic containers as part of Anbox Cloud start to
  fail when executed on the 5.11 kernel.

  A simple reproducer looks like this:

  1. Run Ubuntu 20.04 with HWE kernel (linux-generic-hwe-20.04, 
5.11.0-25-generic #27~20.04.1-Ubuntu)
  2. Install LXD and enable shiftfs
  $ snap install lxd
  $ snap set lxd shiftfs.enable true
  $ snap restart --reload lxd
  3. Launch bionic container and run `lxc-info`
  $ lxc launch ubuntu:b c0
  $ lxc shell c0
  c0$ apt update
  c0$ apt install -y lxc-utils
  root@c1:~# apt show lxc-utils | grep Version
  Version: 3.0.3-0ubuntu1~18.04.1
  c0$ mkdir -p containers/test
  c0$ touch containers/test/config
  c0$ lxc-info -P containers -n test
  Failed to load config for test
  Failure to retrieve information on containers:test

  Looking into the failing `lxc-info` call with strace reveals:

  ...
  memfd_create(".lxc_config_file", MFD_CLOEXEC) = 4
  openat(AT_FDCWD, "containers/test/config", O_RDONLY|O_CLOEXEC) = 5
  sendfile(4, 5, NULL, 2147479552)        = -1 EINVAL (Invalid argument
  ...

  LXC >= 4.0.0 doesn't use sendfile anymore and with that isn't
  affected. Any other tool using sendfile however is affected and will
  fail. Bionic is affected as the 3.0.3 version of LXC it includes still
  uses sendfile.

  Disabling shiftfs makes things work again and can be considered as a
  workaround to a certain degree, but not be applicable in all cases.

  Further analysis with Christian (cbrauner) from the LXD team this
  morning showed that shiftfs is missing an implementation for the now
  required slice_read handler in the file_operations structure. So
  whenever shiftfs is being used, all calls to sendfile will fail
  because of the missing implementation. The generic handler for this
  got removed in the following upstream change:
  https://lore.kernel.org/lkml/20200626075836.1998185-10-...@lst.de/

  Christian implemented a quick fix:
  https://paste.ubuntu.com/p/TPsjfCpnD5/

  As of today I don't know of any customer of Anbox Cloud who is
  affected by this as most of them run with one of our cloud kernels.
  However as soon as 5.11 rolls out to the cloud kernels, we will hit
  production systems and cause them to fail.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1939301/+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