pkexec attempts to close all file descriptors up to sysconf(_SC_OPEN_MAX)

Bug #2101825 reported by Matthew Hagemann
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gnome-initial-setup (Ubuntu)
Fix Released
Undecided
Matthew Hagemann

Bug Description

pkexec attempts to close all file descriptors up to
sysconf(_SC_OPEN_MAX) before executing any commands.
See: https://github.com/polkit-org/polkit/blob/11c4a81f6f732e4b1887a96cab69a1ad6a000e00/src/programs/pkexec.c#L259-L267

As of 24.10, systemd is no longer compile for Ubuntu using the
-Dbump-proc-sys-fs-nr-open=false flag. The absence of this flag causes systemd
to set file descriptor limits to their maximum.

24.04 LTS: https://git.launchpad.net/ubuntu/+source/systemd/tree/debian/rules?h=ubuntu/noble#n82
24.10: https://git.launchpad.net/ubuntu/+source/systemd/tree/debian/rules?h=ubuntu/oracular

This is causing pkexec to sit attempting to close 1073741816 file descriptors
which takes several minutes every time it was called to install a lang pack.

Changed in gnome-initial-setup (Ubuntu):
assignee: nobody → Matthew Hagemann (matt-hagemann)
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gnome-initial-setup - 48~rc-1ubuntu1

---------------
gnome-initial-setup (48~rc-1ubuntu1) plucky; urgency=medium

  [ Marco Trevisan (Treviño) ]
  * Merge with debian
  * debian/salsa-ci: Use ubuntu recipe

  [ Matthew Hagemann ]
  * debian/patches/Dynamic-lang-pack-installation-support.patch
    - Removed dynamic lang pack installation from language chooser, moving it
      instead to the summary page right at the end of the flow (LP: #2101826)
    - Download is skipped if no active network connection is detected.
    - Explicitly set max file descriptors before launching GIS (LP: #2101825)

gnome-initial-setup (48~rc-1) unstable; urgency=medium

  * New upstream release

 -- Marco Trevisan (Treviño) <email address hidden> Fri, 14 Mar 2025 03:29:39 +0100

Changed in gnome-initial-setup (Ubuntu):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.