** Description changed:

- [ Impact ]                                                                    
                                                                                
                                                                                
                                                                                
                                                         
-                                                                               
                                                                                
                                                                                
                                                                                
                                                         
-  * The AppArmor profile shipped in passt (/etc/apparmor.d/usr.bin.passt)      
                                                                                
                                                                                
                                                                                
                                                         
-    lacks the attach_disconnected flag.                                        
                                                                                
                                                                                
                                                                                
                                                         
-    This causes the guests (qemu process) to not be able to connect to the 
unix                                                                            
                                                                                
                                                                                
                                                             
-    socket file passt listens on.                                              
                                                                                
                                                                                
                                                                                
                                                         
-                                                                               
                                                                                
                                                                                
                                                                                
                                                         
-  * The fix adds flags=(attach_disconnected) to the passt profile. It is       
                                                                                
                                                                                
                                                                                
                                                         
-    already in upstream passt (commit 032f082ffad0).                           
                                                                                
                                                                                
                                                                                
                                                         
-                                                                               
                                                                                
                                                                                
                                                                                
                                                         
- [ Test Plan ]                                                                 
                                                                                
                                                                                
                                                                                
                                                         
-                                                                               
                                                                                
                                                                                
                                                                                
                                                         
-  * Install passt and qemu-system-x86 (on amd64 hosts)                         
                                                                                
                                                                                
                                                                                
                                                         
-                                                                               
                                                                                
                                                                                
                                                                                
                                                         
-    $ apt install passt qemu-system-x86                                        
                                                                                
                                                                                
                                                                                
                                                         
-                                                                               
                                                                                
                                                                                
                                                                                
                                                         
-  * Run passt process                                                          
                                                                                
                                                                                
                                                                                
                                                         
-                                                                               
                                                                                
                                                                                
                                                                                
                                                         
-    $ passt --foreground -s /tmp/passt.socket -t 2222:22                       
                                                                                
                                                                                
                                                                                
                                                         
-                                                                               
                                                                                
                                                                                
                                                                                
                                                         
-  * Run the qemu VM:                                                           
                                                                                
                                                                                
                                                                                
                                                         
-                                                                               
                                                                                
                                                                                
                                                                                
                                                         
-    $ qemu-system-x86_64 -enable-kvm -m 4G -cpu host -smp 2 -nographic -drive  
                                                                                
                                                                                
                                                                                
                                                         
-      file=<ubuntu-cloud-image>,format=qcow2                                   
                                                                                
                                                                                
                                                                                
                                                         
-      -netdev 
stream,id=net0,server=off,addr.type=unix,addr.path=/tmp/passt.socket            
                                                                                
                                                                                
                                                                                
                                          
-      -device virtio-net-pci,netdev=net0                                       
                                                                                
                                                                                
                                                                                
                                                         
-                                                                               
                                                                                
                                                                                
                                                                                
                                                         
-  * WITHOUT THE FIX:                                                           
                                                                                
                                                                                
                                                                                
                                                         
-    The VM does not have any IP                                                
                                                                                
                                                                                
                                                                                
                                                         
-                                                                               
                                                                                
                                                                                
                                                                                
                                                         
-  * WITH THE FIX:                                                              
                                                                                
                                                                                
                                                                                
                                                         
-    The VM network interface has an IP and it can access the internet.         
                                                                                
                                                                                
                                                                                
                                                         
-                                                                               
                                                                                
                                                                                
                                                                                
                                                         
- [ Where problems could occur ]                                                
                                                                                
                                                                                
                                                                                
                                                         
-                                                                               
                                                                                
                                                                                
                                                                                
                                                         
-  * The change only touches the AppArmor profile of passt. attach_disconnected 
                                                                                
                                                                                
                                                                                
                                                         
-    relaxes path resolution for disconnected files, so it slightly widens      
                                                                                
                                                                                
                                                                                
                                                         
-    what the profile can match; passt (and pasta, which already has it) users  
                                                                                
                                                                                
                                                                                
                                                         
-    are the only ones affected.                                                
                                                                                
                                                                                
                                                                                
                                                         
-                                                                               
                                                                                
                                                                                
                                                                                
                                                         
-  * A malformed profile would fail to load and break passt/pasta-based         
                                                                                
                                                                                
                                                                                
                                                         
-    networking (libvirt, podman rootless, guestfs-tools); the profile is       
                                                                                
                                                                                
                                                                                
                                                         
-    loaded at package install, so failures would be visible immediately.       
                                                                                
                                                                                
                                                                                
                                                         
-                                                                               
                                                                                
                                                                                
                                                                                
                                                         
-  * The profile is already in upstream and in Tenacious -proposed, limiting 
the risk.                                                                       
                                                                                
                                                                                
                                                            
-                                                                               
                                                                                
                                                                                
                                                                                
                                                         
- [ Other Info ]                                                                
                                                                                
                                                                                
                                                                                
                                                         
-                                                                               
                                                                                
                                                                                
                                                                                
                                                         
-  * Upstream commit: 
https://passt.top/passt/commit/?id=032f082ffad094649066fa94822c5a78a246a766     
                                                                                
                                                                                
                                                                                
                                   
-  * Fixed in Tenacious: 0.0~git20261002.cba3570-1                              
                                                                                
                                                                                
                                                                                
                                                         
-  * Related bug: LP: #2172904                                                  
                                                                                
                                                                                
                                                                                
                                                         
-  * Targets: Resolute (0.0~git20260120.386b5f5-1) and Stonking                 
                                                                                
                                                                                
                                                                                
                                                         
-    (0.0~git20260728.f8df3f1-1). Noble is not targeted by this bug.            
                                                                                
                                                                                
                                                                                
                                                         
-  * Note: the upstream commit's rationale (new userns detach procedure) is     
                                                                                
                                                                                
                                                                                
                                                         
-    more recent than the Resolute version; the flag alone is what was          
                                                                                
                                                                                
                                                                                
                                                         
-    confirmed to fix the reports on Resolute (see bug comments), so only the   
                                                                                
                                                                                
                                                                                
                                                         
-    usr.bin.passt flag change should be backported, not the abstraction        
                                                                                
                                                                                
                                                                                
                                                         
-    changes (gid_map/uid_map rules), unless the package's abstractions         
                                                                                
                                                                                
                                                                                
                                                         
-    need them.  
+ [ Impact ]
+ 
+  * The AppArmor profile shipped in passt (/etc/apparmor.d/usr.bin.passt)
+    lacks the attach_disconnected flag.
+    This causes the guests (qemu process) to not be able to connect to the unix
+    socket file passt listens on.
+ 
+  * The fix adds flags=(attach_disconnected) to the passt profile. It is
+    already in upstream passt (commit 032f082ffad0).
+ 
+ [ Test Plan ]
+ 
+  * Install passt and qemu-system-x86 (on amd64 hosts)
+ 
+    $ apt install passt qemu-system-x86
+ 
+  * Run passt process
+ 
+    $ passt --foreground -s /tmp/passt.socket -t 2222:22
+ 
+  * Run the qemu VM:
+ 
+    $ qemu-system-x86_64 -enable-kvm -m 4G -cpu host -smp 2 -nographic
+ -drive  file=<ubuntu-cloud-image>,format=qcow2 -netdev
+ stream,id=net0,server=off,addr.type=unix,addr.path=/tmp/passt.socket
+ -device virtio-net-pci,netdev=net0
+ 
+  * WITHOUT THE FIX:
+    The VM does not have any IP
+ 
+  * WITH THE FIX:
+    The VM network interface has an IP and it can access the internet.
+ 
+ [ Where problems could occur ]
+ 
+  * The change only touches the AppArmor profile of passt. attach_disconnected
+    relaxes path resolution for disconnected files, so it slightly widens
+    what the profile can match; passt (and pasta, which already has it) users
+    are the only ones affected.
+ 
+  * A malformed profile would fail to load and break passt/pasta-based
+    networking (libvirt, podman rootless, guestfs-tools); the profile is
+    loaded at package install, so failures would be visible immediately.
+ 
+  * The profile is already in upstream and in Tenacious -proposed,
+ limiting the risk.
+ 
+ [ Other Info ]
+ 
+  * Upstream commit: 
https://passt.top/passt/commit/?id=032f082ffad094649066fa94822c5a78a246a766
+  * Fixed in Tenacious: 0.0~git20261002.cba3570-1
+  * Related bug: LP: #2172904
+  * Targets: Resolute (0.0~git20260120.386b5f5-1) and Stonking
+    (0.0~git20260728.f8df3f1-1). Noble is not targeted by this bug.
+  * Note: the upstream commit's rationale (new userns detach procedure) is
+    more recent than the Resolute version; the flag alone is what was
+    confirmed to fix the reports on Resolute (see bug comments), so only the
+    usr.bin.passt flag change should be backported, not the abstraction
+    changes (gid_map/uid_map rules), unless the package's abstractions
+    need them.
  
  ---- Original bug report
  
  $ lsb_release -rd
  Description: Ubuntu 26.04.1 LTS
  Release: 26.04
  
  $ apt-cache policy passt
  passt:
    Installed: 0.0~git20260120.386b5f5-1
    Candidate: 0.0~git20260120.386b5f5-1
    Version table:
   *** 0.0~git20260120.386b5f5-1 500
          500 http://es.archive.ubuntu.com/ubuntu resolute/universe amd64 
Packages
          100 /var/lib/dpkg/status
  
  Expected:
  
  When the passt backend is specified in the libvirt XML specification,
  the network interface within the VM should work and get an IP address
  assigned (automatically, or manually if specified in the XML).
  
  Minimal example which works WITHOUT passt backend:
  
  <interface type="user">
    <mac address="52:54:00:6d:b1:11"/>
    <model type="virtio"/>
    <address type="pci" domain="0x0000" bus="0x07" slot="0x00" function="0x0"/>
  </interface>
  
  Observed:
  
  As soon as the passt backend was added, the network interface within the
  VM fails to get an IP address assigned.
  
  Minimal example which fails WITH passt backend:
  
  <interface type="user">
    <mac address="52:54:00:6d:b1:11"/>
    <model type="virtio"/>
    <backend type="passt"/>
    <address type="pci" domain="0x0000" bus="0x07" slot="0x00" function="0x0"/>
  </interface>
  
  Likely reason is that the apparmor profile for passt at
  /etc/apparmor.d/usr.bin.passt, if intended to be used in
  qemu:///sessions (userland instead of privileged), requires the
  attach_disconnected flag, as shown below:
  
  -profile passt /usr/bin/passt{,.avx2} flags=(complain) {
  +profile passt /usr/bin/passt{,.avx2} flags=(complain, attach_disconnected) {
  
  Notes: originally planned to report this as a candidate for a local
  override file, but apparently you cannot specify flags in local
  overrides... these should be in the main profile.

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

Title:
  passt backend failed in qemu sessions (userland) due to apparmor
  profile

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


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

Reply via email to