Public bug reported:
Summary
-------
Inside an Incus/LXC container, xdg-document-portal fails to mount its FUSE
filesystem at /run/user/$UID/doc. The fusermount3 AppArmor profile, loaded in
the container's own AppArmor namespace, blocks fusermount3 from sending on the
unix stream socket it inherits from libfuse (the _FUSE_COMMFD handshake). As a
result, Flatpak apps can't use the document portal. For example, Firefox
"Print -> Save to PDF" silently does nothing.
Steps to reproduce
------------------
1. Create an Ubuntu 26.04 Incus container and pass through /dev/fuse:
incus config device add <ct> fuse unix-char path=/dev/fuse mode=0666
2. Inside the container, as a normal user in a desktop session, run:
/usr/libexec/xdg-document-portal -r -v
3. Or: flatpak run org.mozilla.firefox, then try Print -> Save to PDF.
Expected
--------
xdg-document-portal mounts /run/user/$UID/doc and stays running; Save to PDF
works.
Actual
------
XDP: org.freedesktop.portal.Documents acquired
error: fuse init failed: Can't mount path /run/user/1001/doc
Flatpak Firefox logs:
F: Can't get document portal: GDBus.Error:org.freedesktop.DBus.Error.NoReply:
Message recipient disconnected from message bus without replying
Host kernel log:
apparmor="DENIED" operation="file_inherit" class="net"
namespace="root//incus-<ct>_<var-lib-incus>" profile="fusermount3"
comm="fusermount3" family="unix" sock_type="stream" protocol=0
requested="send receive" denied="send" addr=none peer_addr=none
peer="unconfined"
/dev/fuse is present (crw-rw-rw-), and fusermount3 is setuid root (-rwsr-xr-x).
There is no stale mount at /run/user/$UID/doc.
Workaround
----------
Add the following to /etc/apparmor.d/local/fusermount3 inside the container:
unix (send, receive) type=stream,
then:
sudo apparmor_parser -r /etc/apparmor.d/fusermount3
After this, xdg-document-portal mounts successfully and Firefox Save to
PDF works.
Suggested fix
-------------
Allow fusermount3 to send/receive on inherited unix stream sockets (needed for
the libfuse fd-passing handshake), at least when the peer is unconfined.
ProblemType: Bug
DistroRelease: Ubuntu 26.04
Package: apparmor 5.0.2-0ubuntu1~26.04.1
ProcVersionSignature: Ubuntu 7.0.0-44.44-generic 7.0.14
Uname: Linux 7.0.0-44-generic x86_64
ApportVersion: 2.34.1-0ubuntu0.1
Architecture: amd64
CasperMD5CheckResult: unknown
CurrentDesktop: KDE
Date: Mon Nov 30 13:03:48 2026
InstallationDate: Installed on 2024-12-16 (714 days ago)
InstallationMedia: Ubuntu-Server 24.04.1 LTS "Noble Numbat" - Release amd64
(20240827)
ProcKernelCmdline: BOOT_IMAGE=/vmlinuz-7.0.0-44-generic
root=/dev/mapper/MainVG-root ro systemd.unified_cgroup_hierarchy=0 quiet
nosplash
crashkernel=2G-4G:320M,4G-32G:512M,32G-64G:1024M,64G-128G:2048M,128G-:4096M
SourcePackage: apparmor
Syslog:
2026-11-29T03:24:29.040253+11:00 timserver dbus-daemon[2643917]: [session
uid=1005 pid=2643917 pidfd=5] AppArmor D-Bus mediation is enabled
2026-11-29T18:02:21.777338+11:00 timserver dbus-daemon[3136614]: [session
uid=1005 pid=3136614 pidfd=5] AppArmor D-Bus mediation is enabled
UpgradeStatus: Upgraded to resolute on 2026-10-26 (35 days ago)
modified.conffile..etc.apparmor.d.local.README: [deleted]
modified.conffile..etc.apparmor.d.wg-quick: [modified]
mtime.conffile..etc.apparmor.d.wg-quick: 2026-11-20T21:59:14.031628
** Affects: apparmor (Ubuntu)
Importance: Undecided
Status: New
** Tags: amd64 apport-bug resolute
--
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2178395
Title:
fusermount3 AppArmor profile denies inherited unix socket, breaking
xdg-document-portal in Incus/LXC containers
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/apparmor/+bug/2178395/+subscriptions
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs