Public bug reported:

(Generated by Claude)

On Ubuntu 26.04 the fusermount3 AppArmor profile only allows umount under
@{HOME}, /mnt, @{run}/user/@{uid}, /media, /tmp, /cvmfs and the flatpak cache
paths. lxcfs's systemd unit (lxcfs 6.0.5-2) cleans up its FUSE mount with:

    ExecStopPost=-/bin/fusermount -u /var/lib/lxcfs

which that profile denies. After lxcfs dies, the dead FUSE mount stays in
place and every restart fails with "Transport endpoint is not connected";
Restart=on-failure then loops indefinitely. Units that Requires= lxcfs
(e.g. incus) are stopped along with it and cannot come back until an admin
runs `umount -l` by hand.

Observed with the Zabbly incus package's equivalent unit (incus-lxcfs.service,
mountpoint /var/lib/incus-lxcfs, identical ExecStopPost) after lxcfs segfaulted:

  apparmor="DENIED" operation="umount" class="mount" profile="fusermount3" 
name="/var/lib/incus-lxcfs/" comm="fusermount"
  /bin/fusermount: failed to unmount /var/lib/incus-lxcfs: Permission denied
  lxcfs: fuse: failed to access mountpoint /var/lib/incus-lxcfs: Transport 
endpoint is not connected
  systemd[1]: incus-lxcfs.service: Scheduled restart job, restart counter is at 
1252.

The archive lxcfs package uses the same pattern for /var/lib/lxcfs, and the
profile has no rule covering it, so it should be affected the same way
(not reproduced with the archive package itself).

Expected reproduction:
  1. apt install lxcfs
  2. sudo kill -KILL $(pidof lxcfs)
  3. journalctl -u lxcfs  -> fusermount denied, restart loop;
     findmnt /var/lib/lxcfs shows a dead fuse.lxcfs mount

Possible fixes: allow `umount /var/lib/lxcfs/,` in the fusermount3 profile,
or have lxcfs.service use `umount -l` instead of fusermount.

Versions: apparmor 5.0.2-0ubuntu1~26.04.1, lxcfs 6.0.5-2, fuse3 3.18.2-1,
linux 7.0.0-44-generic.

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

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2175757

Title:
  fusermount3 profile denies lxcfs.service's fusermount -u
  /var/lib/lxcfs, so lxcfs can never restart after a crash

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


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to