noble SRU debdiff: xdg-dbus-proxy 0.1.5-1ubuntu0.3 ** Description changed:
+ [ Impact ] + + In Ubuntu 24.04, an application in a Flatpak can't connect to the session bus when its D-Bus + library pipelines the SASL handshake or sends method calls from more than one thread. Flatpak + puts xdg-dbus-proxy between the application and the bus, and the proxy in noble (0.1.5) has two + bugs that upstream fixed in 0.1.6: + + * It reads the client's data as D-Bus messages as soon as it has forwarded BEGIN, before the + bus has answered the earlier authentication lines. A client that sends AUTH, NEGOTIATE_UNIX_FD, + BEGIN and its first message in one write, as sd-bus and zbus 6 do, gets "Invalid message + header read" and the proxy closes the connection + (https://github.com/flatpak/xdg-dbus-proxy/issues/21). + + * It requires client serials to increase strictly. A client that sends serial 3 before serial + 2, which a multithreaded client does, gets "Invalid client serial" and the proxy closes the + connection (https://github.com/flatpak/xdg-dbus-proxy/issues/46). + + The application sees a socket error on its first D-Bus call. It can't reach any portal, so it + loses file choosers, screen casting, notifications and secrets. zbus 6 removed its own + workarounds for these bugs, so every Rust application built against it fails this way on noble, + and so does every sd-bus client. Questing (0.1.6) and resolute (0.1.7) aren't affected. + + The upload backports the six upstream commits that fix the two bugs, unchanged except for + context, and nothing else from 0.1.6. + + [ Test Plan ] + + On noble with flatpak and org.freedesktop.Platform//25.08 (or 24.08) + installed: + + 1. Save the attached lp2142415-reproducer.py to /var/tmp. It uses only Python's standard + library. Test 1 sends the whole handshake and Hello in one write. Test 2 completes a + lock-step handshake, then sends two method calls with serials 3 and 2, in that order. + + 2. With the current package (0.1.5-1ubuntu0.2), run + + flatpak run --filesystem=/var/tmp --command=python3 org.freedesktop.Platform//25.08 \ + /var/tmp/lp2142415-reproducer.py + + It prints "FAIL: pipelined SASL handshake (connection closed)" and "FAIL: out-of-order + client serials (connection closed)", and the proxy logs "Invalid message header read" and + "Invalid client serial". + + 3. Install xdg-dbus-proxy from -proposed and run the same command. It prints "PASS" for both + tests and exits 0. + + 4. Check that the proxy still filters. Each of these gives the same result before and after + the update: + + # allowed by --talk-name: Prints the systemd version + flatpak run --talk-name=org.freedesktop.systemd1 --command=gdbus org.freedesktop.Platform//25.08 \ + call --session --dest org.freedesktop.systemd1 --object-path /org/freedesktop/systemd1 \ + --method org.freedesktop.DBus.Properties.Get org.freedesktop.systemd1.Manager Version + # not allowed: org.freedesktop.DBus.Error.ServiceUnknown + (the same command without --talk-name) + # owning an allowed name works, an unallowed one gives ServiceUnknown + flatpak run --own-name=io.test.Sru --command=gdbus org.freedesktop.Platform//25.08 call --session \ + --dest org.freedesktop.DBus --object-path /org/freedesktop/DBus \ + --method org.freedesktop.DBus.RequestName io.test.Sru 0 + (the same with io.test.Other and no --own-name) + + 5. Run an ordinary GDBus or libdbus Flatpak application (or gdbus and dbus-send from the + runtime, as in step 4) and confirm it still connects. + + The upload adds an autopkgtest, pipelined-clients, that runs the same reproducer through + xdg-dbus-proxy on a private session bus (dbus-run-session), so no desktop or Flatpak is needed. + With the 0.1.5-1ubuntu0.2 binaries it fails both tests; with the new ones it passes. The existing + autopkgtest (gnome-desktop-testing over xdg-dbus-proxy-tests) covers the basic proxy path and + passes with both. + + [ Where problems could occur ] + + The changes are in the proxy's handling of the authentication phase and of serial numbers, so a + regression would show up as Flatpak applications failing to connect to the session or system bus, + or as replies reaching the wrong caller. + + * The handshake change keeps reading authentication lines until the bus has answered every one + the client sent, instead of switching to message parsing when it forwards BEGIN. A client + whose authentication the bus rejects, or one that sends an unusually long handshake, takes the + changed path. The second patch raises the authentication buffer limit so a pipelined + handshake fits. + + * The serial change stops requiring increasing client serials and tells the proxy's own fake + messages apart from the client's by the lowest bit of the serial, mapping client serials + accordingly. A mistake there would send a reply to the wrong caller or drop it. The filtering + decisions themselves (which names a sandbox may see, call or own) aren't touched, and step 4 + checks they behave as before. + + Both changes have been in upstream since 0.1.6 (August 2024), which Debian 13, Ubuntu 25.10 and + 26.04 and the copy Flatpak bundles (1.15.11 onward) have shipped since. + + [ Other Info ] + + * Upstream commits: 4607d58 (pipelined SASL handshakes), 65cde98 (larger authentication + buffer), 5073e0c (side_in_cb cleanup the next commits depend on), 4f081c7 (split serials by + the lowest bit), 22d8333 (higher number of client serials), 4e7f20e (comment on fake-message + serials). They apply on top of the two patches already in 0.1.5-1ubuntu0.2. + + * The 0.1.6 release isn't proposed as a whole: It also carries 0297845, which was later + reverted, and other changes outside these two bugs. + + * Tested on noble: The package builds, its build-time test passes, and autopkgtest (null + runner) passes both tests with the new binaries and fails pipelined-clients with the old + ones. On an Ubuntu 24.04 desktop with flatpak 1.14.6-1ubuntu0.1, the reproducer in a + Flatpak fails both tests with 0.1.5-1ubuntu0.2 and passes both with the patched package, + and the step 4 checks give identical results with both. + + * Jammy (0.1.3-1ubuntu0.1) has the same two bugs. The same commits need adapting there and + can follow once this is reviewed. + + [ Original Description ] + The 0.1.5 version shipped with LTS has serious issues that were resolved in 0.1.6 three years ago. In particular, zbus is currently providing workarounds for these issues at the cost of efficiency and I would very much like to remove them after 3 years. Given that 0.1.6 was a bugfix release, this should be pretty straightforward? ** Patch added: "xdg-dbus-proxy_0.1.5-1ubuntu0.3.debdiff" https://bugs.launchpad.net/bugs/2142415/+attachment/6019877/+files/xdg-dbus-proxy_0.1.5-1ubuntu0.3.debdiff -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/2142415 Title: Update on latest (0.1.6) for important bug fixes To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/xdg-dbus-proxy/+bug/2142415/+subscriptions -- ubuntu-bugs mailing list [email protected] https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
