[Bug 2110040] [NEW] dbus-broker: fix compatibility with newer kernel's error code for SO_PEERPIDFD error case

Luca Boccassi 2110040 at bugs.launchpad.net
Tue May 6 12:24:38 UTC 2025


Public bug reported:

[Original Description/Impact]

dbus-broker in noble, oracular and plucky only checks for EINVAL when
calling the SO_PEERPIDFD getsockopt to check if a process already
exited.

The kernel in 6.16 is changing the return value from EINVAL to ESRCH so
that the particular case can be distinguished from generic errors:

https://lore.kernel.org/all/20250411-work-pidfs-
enoent-v2-2-60b2d3bb545f at kernel.org/

The upstream main branch of dbus-broker has a fix for this:

https://github.com/bus1/dbus-
broker/commit/4b1d9da51dc2703b7596243cb555a689bb27b4c1

Without this fix, running a new kernel with the old dbus-broker won't be
able to detect this failure mode anymore, and dbus-broker will stop
working in case that happens, as it has been reported at:

https://lore.kernel.org/all/20250415223454.GA1852104@ax162/

Backporting this back to noble/oracular/plucky will ensure that users
running with a new kernel (e.g.: HWE, local backport) won't face this
issue.

[Test Plan]

Build and install the patched dbus-broker on a VM and check that it
doesn't break.

[Where problems could occur]

The updated logic adds a new expected error code from the SO_PEERPIDFD
getsockopt invocation. An issue here would affect the ability of dbus-
broker to get pidfds from clients, which would cause systemd and other
clients to fall back to pid-based tracking of requests.

** Affects: dbus-broker (Ubuntu)
     Importance: Undecided
         Status: Fix Released

** Affects: dbus-broker (Ubuntu Noble)
     Importance: Undecided
         Status: New

** Affects: dbus-broker (Ubuntu Oracular)
     Importance: Undecided
         Status: New

** Affects: dbus-broker (Ubuntu Plucky)
     Importance: Undecided
         Status: New

** Affects: dbus-broker (Ubuntu Questing)
     Importance: Undecided
         Status: Fix Released

** Also affects: dbus-broker (Ubuntu Noble)
   Importance: Undecided
       Status: New

** Also affects: dbus-broker (Ubuntu Oracular)
   Importance: Undecided
       Status: New

** Also affects: dbus-broker (Ubuntu Plucky)
   Importance: Undecided
       Status: New

** Also affects: dbus-broker (Ubuntu Questing)
   Importance: Undecided
       Status: New

** Changed in: dbus-broker (Ubuntu Questing)
       Status: New => Fix Released

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

Title:
  dbus-broker: fix compatibility with newer kernel's error code for
  SO_PEERPIDFD error case

Status in dbus-broker package in Ubuntu:
  Fix Released
Status in dbus-broker source package in Noble:
  New
Status in dbus-broker source package in Oracular:
  New
Status in dbus-broker source package in Plucky:
  New
Status in dbus-broker source package in Questing:
  Fix Released

Bug description:
  [Original Description/Impact]

  dbus-broker in noble, oracular and plucky only checks for EINVAL when
  calling the SO_PEERPIDFD getsockopt to check if a process already
  exited.

  The kernel in 6.16 is changing the return value from EINVAL to ESRCH so
  that the particular case can be distinguished from generic errors:

  https://lore.kernel.org/all/20250411-work-pidfs-
  enoent-v2-2-60b2d3bb545f at kernel.org/

  The upstream main branch of dbus-broker has a fix for this:

  https://github.com/bus1/dbus-
  broker/commit/4b1d9da51dc2703b7596243cb555a689bb27b4c1

  Without this fix, running a new kernel with the old dbus-broker won't
  be able to detect this failure mode anymore, and dbus-broker will stop
  working in case that happens, as it has been reported at:

  https://lore.kernel.org/all/20250415223454.GA1852104@ax162/

  Backporting this back to noble/oracular/plucky will ensure that users
  running with a new kernel (e.g.: HWE, local backport) won't face this
  issue.

  [Test Plan]

  Build and install the patched dbus-broker on a VM and check that it
  doesn't break.

  [Where problems could occur]

  The updated logic adds a new expected error code from the SO_PEERPIDFD
  getsockopt invocation. An issue here would affect the ability of dbus-
  broker to get pidfds from clients, which would cause systemd and other
  clients to fall back to pid-based tracking of requests.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/dbus-broker/+bug/2110040/+subscriptions




More information about the foundations-bugs mailing list