Skip to content

shared/pager: enable support for more(1) secure mode at build-time#41981

Open
cgoesche wants to merge 1 commit into
systemd:mainfrom
cgoesche:make_more_pager_support_secure
Open

shared/pager: enable support for more(1) secure mode at build-time#41981
cgoesche wants to merge 1 commit into
systemd:mainfrom
cgoesche:make_more_pager_support_secure

Conversation

@cgoesche
Copy link
Copy Markdown
Contributor

@cgoesche cgoesche commented May 7, 2026

Commit 81d23b5 added more(1) (from util-linux) to the list of trusted pagers, as it supports a secure mode similar to less(1) ever since util-linux version 2.42. This same version was used to bump the baseline runtime requirement of util-linux. However, this can cause security issues in cases where the literal version requirement is not respected and an older util-linux version is installed on the system. The least we can do is to enforce a version check at build time and turn support on/off depending on the installed version.

Note that this only affects the list of trusted pagers, more(1) remains available for output when no secure pager is required, as determined by the pager selection logic.

The behavior changes as follows:

Systems with more(1) version < 2.42:

Usable only when no trusted pager is needed or SYSTEMD_PAGERSECURE=0

Systems with more(1) version >= 2.42

Usable in all cases

Addresses: 81d23b5


Following the discussion with @bluca here.

Commit 81d23b5 added more(1) (from util-linux) to the list of
trusted pagers, as it supports a secure mode similar to less(1)
ever since util-linux version 2.42. This same version was used to
bump the baseline runtime requirement of util-linux. However, this
can cause security issues in cases where the literal version require-
ment is not respected and an older util-linux version is installed on
the system. The least we can do is to enforce a version check at build
time and turn support on/off depending on the installed version.

Note that this only affects the list of trusted pagers, more(1) remains
available for output when no secure pager is required, as determined
by the pager selection logic.

The behavior changes as follows:

Systems with more(1) version < 2.42:

    Usable only when no trusted pager is needed or SYSTEMD_PAGERSECURE=0

Systems with more(1) version >= 2.42

    Usable in all cases

Addresses: 81d23b5
Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
@github-actions github-actions Bot added build-system util-lib meson please-review PR is ready for (re-)review by a maintainer labels May 7, 2026
Copy link
Copy Markdown
Member

@bluca bluca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this makes sense to me, as otherwise we are introducing a privilege escalation issue on basically every distro apart from fedora rawhide, archlinux and debian unstable, given util-linux 2.42 is the very latest version

https://repology.org/project/util-linux/versions

@bluca bluca added the rc-blocker 🚧 PRs and Issues tagged this way are blocking the upcoming rc release! label May 7, 2026
@bluca bluca added this to the v261 milestone May 7, 2026
Copy link
Copy Markdown
Member

@keszybz keszybz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checking at build time is not useful. Any check like this must be at run time.

@cgoesche
Copy link
Copy Markdown
Contributor Author

cgoesche commented May 12, 2026

This circles us back to #41503 (comment) . And checking both at build and run time seems like good enough depth of security, no ?

Edit: If a user wants to deliberately build with more(1) secure support even if at build time the required version is not available, a meson option can enable it.

@bluca
Copy link
Copy Markdown
Member

bluca commented May 13, 2026

yeah this requires a build option, disabled by default, I don't see alternatives, other than reverting and waiting for the current LTS distros to go EOL

@bluca bluca added reviewed/needs-rework 🔨 PR has been reviewed and needs another round of reworks and removed please-review PR is ready for (re-)review by a maintainer rc-blocker 🚧 PRs and Issues tagged this way are blocking the upcoming rc release! labels May 13, 2026
@bluca bluca removed this from the v261 milestone May 16, 2026
@bluca
Copy link
Copy Markdown
Member

bluca commented May 16, 2026

yeah this requires a build option, disabled by default, I don't see alternatives, other than reverting and waiting for the current LTS distros to go EOL

This was reverted to unlock the release for now, so a way to make it work safely can be found with no time pressure

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build-system meson reviewed/needs-rework 🔨 PR has been reviewed and needs another round of reworks util-lib

Development

Successfully merging this pull request may close these issues.

3 participants