util-linux: backport pam_lastlog2 libpam linking fix
PATCH 1/1 util-linux: backport pam_lastlog2 libpam linking fix
pam_lastlog2.so uses pam_syslog() and other libpam symbols but the autotools build did not link the module against libpam. With the linker default of --as-needed, libpam was discarded and did not end up in the module's ELF NEEDED entries. The module then fails to load via dlopen() in processes that do not themselves link libpam (e.g. systemd on recent Fedora, or weston on journald-based systems without syslog):
PAM unable to dlopen(/usr/lib/security/pam_lastlog2.so): undefined symbol: pam_syslog PAM adding faulty module: /usr/lib/security/pam_lastlog2.so
Backport the upstream fix (in 2.41.5) that moves -lpam into LIBADD so it is placed after the object files and retained as a NEEDED entry. Against 2.41.3 only the LIBADD line needs changing.
[YOCTO #16320]
---
Verified by building util-linux with pam in DISTRO_FEATURES (qemux86-64):
without the patch the resulting pam_lastlog2.so has no libpam in its ELF NEEDED entries; with the patch readelf -d reports libpam.so.0, matching the upstream fix and resolving the dlopen() failure from the bug report.
This is also a candidate for the stable 6.0.x branch (per the bug report), which also ships util-linux 2.41.3; the same single-hunk backport applies.
meta/recipes-core/util-linux/util-linux.inc | 1 + ...ix-libpam-linking-in-autotools-build.patch | 51 +++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 meta/recipes-core/util-linux/util-linux/0001-pam_lastlog2-fix-libpam-linking-in-autotools-build.patch
meta/recipes-core/util-linux/util-linux.inc +1 -0
@@ -21,6 +21,7 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/utils/util-linux/v${MAJOR_VERSION}/util-lin file://0001-ts-kill-decode-use-RTMIN-from-kill-L-instead-of-hard.patch \ file://0001-tests-script-Disable-size-option-test.patch \ file://0001-loopdev-add-LOOPDEV_FL_NOFOLLOW-to-prevent-symlink-a.patch \ + file://0001-pam_lastlog2-fix-libpam-linking-in-autotools-build.patch \ " SRC_URI[sha256sum] = "3330d873f0fceb5560b89a7dc14e4f3288bbd880e96903ed9b50ec2b5799e58b"
meta/recipes-core/util-linux/util-linux/0001-pam_lastlog2-fix-libpam-linking-in-autotools-build.patch new file +51 -0
51 lines not on this page · raw message
Signature · 1 line
2.34.1
Quoted 24 lines · Siva Balasubramanian via lists.openembedded.org
pam_lastlog2.so uses
pam_syslog()and other libpam symbols but the autotools build did not link the module against libpam. With the linker default of --as-needed, libpam was discarded and did not end up in the module's ELF NEEDED entries. The module then fails to load viadlopen()in processes that do not themselves link libpam (e.g. systemd on recent Fedora, or weston on journald-based systems without syslog):PAM unable to
dlopen(/usr/lib/security/pam_lastlog2.so): undefined symbol:pam_syslogPAM adding faulty module:/usr/lib/security/pam_lastlog2.soBackport the upstream fix (in 2.41.5) that moves -lpam into LIBADD so it is placed after the object files and retained as a NEEDED entry. Against 2.41.3 only the LIBADD line needs changing.
[YOCTO #16320]
Signed-off-by Siva Balasubramanian <[email protected]>---
Verified by building util-linux with pam inDISTRO_FEATURES(qemux86-64):
without the patch the resulting pam_lastlog2.so has no libpam in its ELF NEEDED entries; with the patch readelf -d reports libpam.so.0, matching the upstream fix and resolving thedlopen()failure from the bug report.
Quoted 3 lines
This is also a candidate for the stable 6.0.x branch (per the bug report), which also ships util-linux 2.41.3; the same single-hunk backport applies.
Hi Siva,
Thanks for the patch.
We already have a pending patch for master, upgrading to 2.42.2 [1]. So I believe this patch won't be needed for master. It probably still makes sense for stable branches.
[1]: https://lore.kernel.org/openembedded-core/[email protected]/
Thanks,
Mathieu
Signature · 3 lines
Mathieu Dubois-Briand, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
Hi Mathieu,
Sent a [wrynose][PATCH] version targeting that branch:
https://patchwork.yoctoproject.org/project/oe-core/patch/[email protected]/
Same fix, verified the same way (readelf -d / dlopen test) since wrynose is still on util-linux 2.41.3, same as master.
Thanks,
Siva
Quoted 51 lines · Mathieu Dubois-Briand
Quoted 9 lines · Siva Balasubramanian via lists.openembedded.org
pam_lastlog2.so uses
pam_syslog()and other libpam symbols but the autotools build did not link the module against libpam. With the linker default of --as-needed, libpam was discarded and did not end up in the module's ELF NEEDED entries. The module then fails to load viadlopen()in processes that do not themselves link libpam (e.g. systemd on recent Fedora, or weston on journald-based systems without syslog):PAM unable to
dlopen(/usr/lib/security/pam_lastlog2.so): undefinedsymbol:
pam_syslogQuoted 15 lines
PAM adding faulty module:
/usr/lib/security/pam_lastlog2.soBackport the upstream fix (in 2.41.5) that moves -lpam into LIBADD so it is placed after the object files and retained as a NEEDED entry. Against 2.41.3 only the LIBADD line needs changing.
[YOCTO #16320]
Signed-off-by Siva Balasubramanian <[email protected]>---
Verified by building util-linux with pam inDISTRO_FEATURES(qemux86-64):
without the patch the resulting pam_lastlog2.so has no libpam in its ELF NEEDED entries; with the patch readelf -d reports libpam.so.0, matching the upstream fix and resolving thedlopen()failure from the bug report.Quoted 3 lines
This is also a candidate for the stable 6.0.x branch (per the bug report), which also ships util-linux 2.41.3; the same single-hunk backport applies.
Hi Siva,
Thanks for the patch.
We already have a pending patch for master, upgrading to 2.42.2 [1]. So I believe this patch won't be needed for master. It probably still makes sense for stable branches.
[1]:
https://lore.kernel.org/openembedded-core/[email protected]/Thanks,
Mathieu--
Mathieu Dubois-Briand, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
Signature · 1 line
Sivakumar B
PATCH v2 1/1 util-linux: backport pam_lastlog2 libpam linking fix
In reply to Siva Balasubramanianpam_lastlog2.so uses pam_syslog() and other libpam symbols but the autotools build did not link the module against libpam. With the linker default of --as-needed, libpam was discarded and did not end up in the module's ELF NEEDED entries. The module then fails to load via dlopen() in processes that do not themselves link libpam (e.g. systemd on recent Fedora, or weston on journald-based systems without syslog):
PAM unable to dlopen(/usr/lib/security/pam_lastlog2.so): undefined symbol: pam_syslog PAM adding faulty module: /usr/lib/security/pam_lastlog2.so
Backport the upstream fix (in 2.41.5) that moves -lpam into LIBADD so it is placed after the object files and retained as a NEEDED entry. Against 2.41.3 only the LIBADD line needs changing.
[YOCTO #16320]
---
v2:
- Preserve the upstream commit message verbatim in the backported patch and only append the backport info (Upstream-Status, dropped LDFLAGS hunk note), per review feedback from Yoann Congal.
- Point Upstream-Status at the util-linux master commit 5683ed6320e00205146cbb3d0c76462733530eca (PR #4358). It is also in the v2.41 stable branch as c8d0af0421f6 (released in 2.41.5) and is already present in 2.42.x, so this backport targets the wrynose branch (still on util-linux 2.41.3).
- Retag the subject for the wrynose branch.
meta/recipes-core/util-linux/util-linux.inc | 1 + ...ix-libpam-linking-in-autotools-build.patch | 43 +++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 meta/recipes-core/util-linux/util-linux/0001-pam_lastlog2-fix-libpam-linking-in-autotools-build.patch
meta/recipes-core/util-linux/util-linux.inc +1 -0
@@ -21,6 +21,7 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/utils/util-linux/v${MAJOR_VERSION}/util-lin file://0001-ts-kill-decode-use-RTMIN-from-kill-L-instead-of-hard.patch \ file://0001-tests-script-Disable-size-option-test.patch \ file://0001-loopdev-add-LOOPDEV_FL_NOFOLLOW-to-prevent-symlink-a.patch \ + file://0001-pam_lastlog2-fix-libpam-linking-in-autotools-build.patch \ " SRC_URI[sha256sum] = "3330d873f0fceb5560b89a7dc14e4f3288bbd880e96903ed9b50ec2b5799e58b"
meta/recipes-core/util-linux/util-linux/0001-pam_lastlog2-fix-libpam-linking-in-autotools-build.patch new file +43 -0
43 lines not on this page · raw message
Signature · 1 line
2.34.1
Quoted 8 lines · Siva Balasubramanian
pam_lastlog2.so uses
pam_syslog()and other libpam symbols but the autotools build did not link the module against libpam. With the linker default of --as-needed, libpam was discarded and did not end up in the module's ELF NEEDED entries. The module then fails to load viadlopen()in processes that do not themselves link libpam (e.g. systemd on recent Fedora, or weston on journald-based systems without syslog):
Quoted 6 lines
PAM unable to
dlopen(/usr/lib/security/pam_lastlog2.so): undefined symbol:pam_syslogPAM adding faulty module:/usr/lib/security/pam_lastlog2.soBackport the upstream fix (in 2.41.5) that moves -lpam into LIBADD so it is placed after the object files and retained as a NEEDED entry. Against 2.41.3 only the LIBADD line needs changing.
Hello,
I quickly looked at util-linux v2.41.5 and it look like we can upgrade instead of backporting:
https://github.com/util-linux/util-linux/compare/v2.41.3...v2.41.5
Could you check and, if you think that the upgrade complies with the stable policy, send the upgrade?
Thanks!
Quoted 82 lines
[YOCTO #16320]
Signed-off-by Siva Balasubramanian <[email protected]>---
v2:
- Preserve the upstream commit message verbatim in the backported patch and only append the backport info (Upstream-Status, dropped LDFLAGS hunk note), per review feedback from Yoann Congal.
- Point Upstream-Status at the util-linux master commit5683ed6320e00205146cbb3d0c76462733530eca(PR #4358). It is also in the v2.41 stable branch asc8d0af0421f6(released in 2.41.5) and is already present in 2.42.x, so this backport targets the wrynose branch (still on util-linux 2.41.3).
- Retag the subject for the wrynose branch.meta/recipes-core/util-linux/util-linux.inc | 1 + ...ix-libpam-linking-in-autotools-build.patch | 43 +++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 meta/recipes-core/util-linux/util-linux/0001-pam_lastlog2-fix-libpam-linking-in-autotools-build.patchmeta/recipes-core/util-linux/util-linux.inc +1
-0@@ -21,6 +21,7 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/utils/util-linux/v${MAJOR_VERSION}/util-lin file://0001-ts-kill-decode-use-RTMIN-from-kill-L-instead-of-hard.patch \ file://0001-tests-script-Disable-size-option-test.patch \ file://0001-loopdev-add-LOOPDEV_FL_NOFOLLOW-to-prevent-symlink-a.patch \ + file://0001-pam_lastlog2-fix-libpam-linking-in-autotools-build.patch \ " SRC_URI[sha256sum] = "3330d873f0fceb5560b89a7dc14e4f3288bbd880e96903ed9b50ec2b5799e58b"meta/recipes-core/util-linux/util-linux/0001-pam_lastlog2-fix-libpam-linking-in-autotools-build.patch new file +43
-0@@ -0,0 +1,43 @@ +From 5683ed6320e00205146cbb3d0c76462733530eca Mon Sep 17 00:00:00 2001 +From: Karel Zak <[email protected]> +Date: Tue, 19 May 2026 10:54:57 +0200 +Subject: [PATCH] pam_lastlog2: fix libpam linking in autotools build + +Move -lpam from LDFLAGS to LIBADD. When -lpam is in LDFLAGS it +appears on the linker command line before object files, so the +--as-needed linker flag (default on Fedora) discards it before +seeing any undefined PAM symbols. This results in pam_lastlog2.so +missing libpam.so in its ELF NEEDED entries. + +The module then fails to load with dlopen() if the calling process +does not itself link against libpam (e.g., systemd in Fedora 44+): + + PAM unable to dlopen(pam_lastlog2.so): undefined symbol: pam_syslog + +Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2453457 +Signed-off-by: Karel Zak <[email protected]> + +Upstream-Status: Backport [https://github.com/util-linux/util-linux/commit/5683ed6320e00205146cbb3d0c76462733530eca] +[Dropped the LDFLAGS hunk: the -lpam in LDFLAGS was introduced upstream + after 2.41.3 and is not present in this tree, so only the LIBADD hunk + applies here.] +Signed-off-by: Siva Balasubramanian <[email protected]> +--- + pam_lastlog2/src/Makemodule.am | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/pam_lastlog2/src/Makemodule.am b/pam_lastlog2/src/Makemodule.am +index 40d597c58..876171e9f 100644 +--- a/pam_lastlog2/src/Makemodule.am ++++ b/pam_lastlog2/src/Makemodule.am +@@ -11,7 +11,7 @@ pam_lastlog2_la_CFLAGS = \ + $(SOLIB_CFLAGS) \ + -I$(ul_liblastlog2_incdir) + +-pam_lastlog2_la_LIBADD = liblastlog2.la ++pam_lastlog2_la_LIBADD = liblastlog2.la -lpam + + pam_lastlog2_la_LDFLAGS = $(SOLIB_LDFLAGS) -module -avoid-version -shared + if HAVE_VSCRIPT +-- +2.43.0
Signature · 2 lines
Yoann Congal Smile ECS
Hello Yoann,
Good call, I checked and the upgrade does comply with the stable policy, so I'll send it instead of the backport.
2.41.4 and 2.41.5 are point releases within the same 2.41 stable series and carry only bug fixes and security fixes, no new features and no API/ABI breaks. The v2.41.3...v2.41.5 range is mostly mount(8) TOCTOU / symlink hardening (including CVE-2026-27456), a libblkid integer overflow in parse_dos_extended() and a use-after-free in partition probing, plus the pam_lastlog2 libpam linking fix that this bug was about (c8d0af0421f6, in 2.41.5).
A nice side effect: the upgrade lets us drop two backports that wrynose currently carries and that are now part of the release - 0001-loopdev-add-LOOPDEV_FL_NOFOLLOW-... (upstream f55f9906, in 2.41.4) and the pam_lastlog2 backport from my v2.
I built util-linux with pam enabled on top of 2.41.5 and confirmed pam_lastlog2.so now lists libpam.so.0 in its NEEDED entries, so YOCTO #16320 is fixed.
I'll send the upgrade as a separate patch (this supersedes the pam_lastlog2 backport v1/v2).
Thanks!
Siva
Quoted 116 lines · Yoann Congal
Quoted 8 lines · Siva Balasubramanian
pam_lastlog2.so uses
pam_syslog()and other libpam symbols but the autotools build did not link the module against libpam. With the linker default of --as-needed, libpam was discarded and did not end up in the module's ELF NEEDED entries. The module then fails to load viadlopen()in processes that do not themselves link libpam (e.g. systemd on recent Fedora, or weston on journald-based systems without syslog):Quoted 6 lines
PAM unable to
dlopen(/usr/lib/security/pam_lastlog2.so): undefined symbol:pam_syslogPAM adding faulty module:/usr/lib/security/pam_lastlog2.soBackport the upstream fix (in 2.41.5) that moves -lpam into LIBADD so it is placed after the object files and retained as a NEEDED entry. Against 2.41.3 only the LIBADD line needs changing.
Hello,
I quickly looked at util-linux v2.41.5 and it look like we can upgrade instead of backporting:
https://github.com/util-linux/util-linux/compare/v2.41.3...v2.41.5Could you check and, if you think that the upgrade complies with the stable policy, send the upgrade?
Thanks!
Quoted 72 lines
[YOCTO #16320]
Signed-off-by Siva Balasubramanian <[email protected]>---
v2:
- Preserve the upstream commit message verbatim in the backported patch and only append the backport info (Upstream-Status, dropped LDFLAGS hunk note), per review feedback from Yoann Congal.
- Point Upstream-Status at the util-linux master commit5683ed6320e00205146cbb3d0c76462733530eca(PR #4358). It is also in the v2.41 stable branch asc8d0af0421f6(released in 2.41.5) and is already present in 2.42.x, so this backport targets the wrynose branch (still on util-linux 2.41.3).
- Retag the subject for the wrynose branch.meta/recipes-core/util-linux/util-linux.inc | 1 + ...ix-libpam-linking-in-autotools-build.patch | 43 +++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 meta/recipes-core/util-linux/util-linux/0001-pam_lastlog2-fix-libpam-linking-in-autotools-build.patchmeta/recipes-core/util-linux/util-linux.inc +1
-0@@ -21,6 +21,7 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/utils/util-linux/v${MAJOR_VERSION}/util-lin file://0001-ts-kill-decode-use-RTMIN-from-kill-L-instead-of-hard.patch \ file://0001-tests-script-Disable-size-option-test.patch \ file://0001-loopdev-add-LOOPDEV_FL_NOFOLLOW-to-prevent-symlink-a.patch \ + file://0001-pam_lastlog2-fix-libpam-linking-in-autotools-build.patch \ " SRC_URI[sha256sum] = "3330d873f0fceb5560b89a7dc14e4f3288bbd880e96903ed9b50ec2b5799e58b"meta/recipes-core/util-linux/util-linux/0001-pam_lastlog2-fix-libpam-linking-in-autotools-build.patch new file +33
-0@@ -0,0 +1,43 @@ +From 5683ed6320e00205146cbb3d0c76462733530eca Mon Sep 17 00:00:00 2001 +From: Karel Zak <[email protected]> +Date: Tue, 19 May 2026 10:54:57 +0200 +Subject: [PATCH] pam_lastlog2: fix libpam linking in autotools build + +Move -lpam from LDFLAGS to LIBADD. When -lpam is in LDFLAGS it +appears on the linker command line before object files, so the +--as-needed linker flag (default on Fedora) discards it before +seeing any undefined PAM symbols. This results in pam_lastlog2.so +missing libpam.so in its ELF NEEDED entries. + +The module then fails to load with dlopen() if the calling process +does not itself link against libpam (e.g., systemd in Fedora 44+): + + PAM unable to dlopen(pam_lastlog2.so): undefined symbol: pam_syslog + +Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2453457 +Signed-off-by: Karel Zak <[email protected]> + +Upstream-Status: Backport [https://github.com/util-linux/util-linux/commit/5683ed6320e00205146cbb3d0c76462733530eca] +[Dropped the LDFLAGS hunk: the -lpam in LDFLAGS was introduced upstream + after 2.41.3 and is not present in this tree, so only the LIBADD hunk + applies here.] +Signed-off-by: Siva Balasubramanian <[email protected]> +--- + pam_lastlog2/src/Makemodule.am | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/pam_lastlog2/src/Makemodule.am b/pam_lastlog2/src/Makemodule.am +index 40d597c58..876171e9f 100644 +--- a/pam_lastlog2/src/Makemodule.am ++++ b/pam_lastlog2/src/Makemodule.am +@@ -11,7 +11,7 @@ pam_lastlog2_la_CFLAGS = \meta/recipes-core/util-linux/util-linux/0001-pam_lastlog2-fix-libpam-linking-in-autotools-build.patch line 43
Quoted 10 lines
meta/recipes-core/util-linux/util-linux/0001-pam_lastlog2-fix-libpam-linking-in-autotools-build.patch new file +10
-0+ $(SOLIB_CFLAGS) \ + -I$(ul_liblastlog2_incdir) + +-pam_lastlog2_la_LIBADD = liblastlog2.la ++pam_lastlog2_la_LIBADD = liblastlog2.la -lpam + + pam_lastlog2_la_LDFLAGS = $(SOLIB_LDFLAGS) -module -avoid-version -shared + if HAVE_VSCRIPT +-- +2.43.0--
Yoann Congal
Smile ECS
Signature · 1 line
Sivakumar B
Quoted 18 lines · Siva Kumar Balasubramanian
Hello Yoann,
Good call, I checked and the upgrade does comply with the stable policy, so I'll send it instead of the backport.
2.41.4 and 2.41.5 are point releases within the same 2.41 stable series and carry only bug fixes and security fixes, no new features and no API/ABI breaks. The v2.41.3...v2.41.5 range is mostly mount(8) TOCTOU / symlink hardening (including CVE-2026-27456), a libblkid integer overflow in
parse_dos_extended()and a use-after-free in partition probing, plus thepam_lastlog2libpam linking fix that this bug was about (c8d0af0421f6, in 2.41.5).A nice side effect: the upgrade lets us drop two backports that wrynose currently carries and that are now part of the release - 0001-loopdev-add-LOOPDEV_FL_NOFOLLOW-... (upstream
f55f9906, in 2.41.4) and thepam_lastlog2backport from my v2.
Quoted 6 lines
I built util-linux with pam enabled on top of 2.41.5 and confirmed pam_lastlog2.so now lists libpam.so.0 in its NEEDED entries, so YOCTO #16320 is fixed.
I'll send the upgrade as a separate patch (this supersedes the
pam_lastlog2backport v1/v2).
Thanks!
Sounds good.
I will review the upgrade in the next review cycle.
Regards,
Quoted 121 lines
Thanks!
SivaQuoted 116 lines · Yoann Congal
Quoted 8 lines · Siva Balasubramanian
pam_lastlog2.so uses
pam_syslog()and other libpam symbols but the autotools build did not link the module against libpam. With the linker default of --as-needed, libpam was discarded and did not end up in the module's ELF NEEDED entries. The module then fails to load viadlopen()in processes that do not themselves link libpam (e.g. systemd on recent Fedora, or weston on journald-based systems without syslog):Quoted 6 lines
PAM unable to
dlopen(/usr/lib/security/pam_lastlog2.so): undefined symbol:pam_syslogPAM adding faulty module:/usr/lib/security/pam_lastlog2.soBackport the upstream fix (in 2.41.5) that moves -lpam into LIBADD so it is placed after the object files and retained as a NEEDED entry. Against 2.41.3 only the LIBADD line needs changing.
Hello,
I quickly looked at util-linux v2.41.5 and it look like we can upgrade instead of backporting:
https://github.com/util-linux/util-linux/compare/v2.41.3...v2.41.5Could you check and, if you think that the upgrade complies with the stable policy, send the upgrade?
Thanks!
Quoted 72 lines
[YOCTO #16320]
Signed-off-by Siva Balasubramanian <[email protected]>---
v2:
- Preserve the upstream commit message verbatim in the backported patch and only append the backport info (Upstream-Status, dropped LDFLAGS hunk note), per review feedback from Yoann Congal.
- Point Upstream-Status at the util-linux master commit5683ed6320e00205146cbb3d0c76462733530eca(PR #4358). It is also in the v2.41 stable branch asc8d0af0421f6(released in 2.41.5) and is already present in 2.42.x, so this backport targets the wrynose branch (still on util-linux 2.41.3).
- Retag the subject for the wrynose branch.meta/recipes-core/util-linux/util-linux.inc | 1 + ...ix-libpam-linking-in-autotools-build.patch | 43 +++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 meta/recipes-core/util-linux/util-linux/0001-pam_lastlog2-fix-libpam-linking-in-autotools-build.patchmeta/recipes-core/util-linux/util-linux.inc +1
-0@@ -21,6 +21,7 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/utils/util-linux/v${MAJOR_VERSION}/util-lin file://0001-ts-kill-decode-use-RTMIN-from-kill-L-instead-of-hard.patch \ file://0001-tests-script-Disable-size-option-test.patch \ file://0001-loopdev-add-LOOPDEV_FL_NOFOLLOW-to-prevent-symlink-a.patch \ + file://0001-pam_lastlog2-fix-libpam-linking-in-autotools-build.patch \ " SRC_URI[sha256sum] = "3330d873f0fceb5560b89a7dc14e4f3288bbd880e96903ed9b50ec2b5799e58b"meta/recipes-core/util-linux/util-linux/0001-pam_lastlog2-fix-libpam-linking-in-autotools-build.patch new file +33
-0@@ -0,0 +1,43 @@ +From 5683ed6320e00205146cbb3d0c76462733530eca Mon Sep 17 00:00:00 2001 +From: Karel Zak <[email protected]> +Date: Tue, 19 May 2026 10:54:57 +0200 +Subject: [PATCH] pam_lastlog2: fix libpam linking in autotools build + +Move -lpam from LDFLAGS to LIBADD. When -lpam is in LDFLAGS it +appears on the linker command line before object files, so the +--as-needed linker flag (default on Fedora) discards it before +seeing any undefined PAM symbols. This results in pam_lastlog2.so +missing libpam.so in its ELF NEEDED entries. + +The module then fails to load with dlopen() if the calling process +does not itself link against libpam (e.g., systemd in Fedora 44+): + + PAM unable to dlopen(pam_lastlog2.so): undefined symbol: pam_syslog + +Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2453457 +Signed-off-by: Karel Zak <[email protected]> + +Upstream-Status: Backport [https://github.com/util-linux/util-linux/commit/5683ed6320e00205146cbb3d0c76462733530eca] +[Dropped the LDFLAGS hunk: the -lpam in LDFLAGS was introduced upstream + after 2.41.3 and is not present in this tree, so only the LIBADD hunk + applies here.] +Signed-off-by: Siva Balasubramanian <[email protected]> +--- + pam_lastlog2/src/Makemodule.am | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/pam_lastlog2/src/Makemodule.am b/pam_lastlog2/src/Makemodule.am +index 40d597c58..876171e9f 100644 +--- a/pam_lastlog2/src/Makemodule.am ++++ b/pam_lastlog2/src/Makemodule.am +@@ -11,7 +11,7 @@ pam_lastlog2_la_CFLAGS = \meta/recipes-core/util-linux/util-linux/0001-pam_lastlog2-fix-libpam-linking-in-autotools-build.patch line 43
Quoted 10 lines
meta/recipes-core/util-linux/util-linux/0001-pam_lastlog2-fix-libpam-linking-in-autotools-build.patch new file +10
-0+ $(SOLIB_CFLAGS) \ + -I$(ul_liblastlog2_incdir) + +-pam_lastlog2_la_LIBADD = liblastlog2.la ++pam_lastlog2_la_LIBADD = liblastlog2.la -lpam + + pam_lastlog2_la_LDFLAGS = $(SOLIB_LDFLAGS) -module -avoid-version -shared + if HAVE_VSCRIPT +-- +2.43.0--
Yoann Congal
Smile ECS
Signature · 2 lines
Yoann Congal Smile ECS
PATCH 1/1 util-linux: upgrade 2.41.3 -> 2.41.5
In reply to Siva Balasubramanian2.41.4 and 2.41.5 are point releases in the same 2.41 stable series and contain only bug fixes and security fixes (no new features, no API/ABI breaks), so the upgrade complies with the stable branch policy.
Among the fixes pulled in:
- Several mount(8) TOCTOU / symlink hardening fixes (incl. CVE-2026-27456)
- libblkid integer overflow in parse_dos_extended() and a use-after-free in partition probing
- pam_lastlog2: fix libpam linking in the autotools build so pam_lastlog2.so links against libpam (fixes the runtime "undefined
symbol: pam_syslog" / dlopen failure) [YOCTO #16320]
Drop two backports that are now part of the release:
- 0001-loopdev-add-LOOPDEV_FL_NOFOLLOW-to-prevent-symlink-a.patch (upstream f55f9906, released in 2.41.4)
- the pam_lastlog2 libpam linking backport (upstream 5683ed6320e0, cherry-picked to the 2.41 stable branch as c8d0af0421f6, released in 2.41.5)
Full changes: https://github.com/util-linux/util-linux/compare/v2.41.3...v2.41.5
---
...2.41.3.bb => util-linux-libuuid_2.41.5.bb} | 0
meta/recipes-core/util-linux/util-linux.inc | 3 +-
...DEV_FL_NOFOLLOW-to-prevent-symlink-a.patch | 114 ------------------
...l-linux_2.41.3.bb => util-linux_2.41.5.bb} | 0
4 files changed, 1 insertion(+), 116 deletions(-)
rename meta/recipes-core/util-linux/{util-linux-libuuid_2.41.3.bb => util-linux-libuuid_2.41.5.bb} (100%)
delete mode 100644 meta/recipes-core/util-linux/util-linux/0001-loopdev-add-LOOPDEV_FL_NOFOLLOW-to-prevent-symlink-a.patch
rename meta/recipes-core/util-linux/{util-linux_2.41.3.bb => util-linux_2.41.5.bb} (100%)meta/recipes-core/util-linux/util-linux-libuuid_2.41.5.bb renamed from meta/recipes-core/util-linux/util-linux-libuuid_2.41.3.bb +0 -0
meta/recipes-core/util-linux/util-linux.inc +1 -2
@@ -20,9 +20,8 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/utils/util-linux/v${MAJOR_VERSION}/util-lin file://0001-lsfd-mkfds-foreign-sockets-skip-when-lacking-sock_di.patch \ file://0001-ts-kill-decode-use-RTMIN-from-kill-L-instead-of-hard.patch \ file://0001-tests-script-Disable-size-option-test.patch \ - file://0001-loopdev-add-LOOPDEV_FL_NOFOLLOW-to-prevent-symlink-a.patch \ " -SRC_URI[sha256sum] = "3330d873f0fceb5560b89a7dc14e4f3288bbd880e96903ed9b50ec2b5799e58b" +SRC_URI[sha256sum] = "f586e35d320ff537aab3ffeca37e9ecd482ccbe013590db4429a414d8aa6a728" CVE_PRODUCT = "util-linux"
meta/recipes-core/util-linux/util-linux/0001-loopdev-add-LOOPDEV_FL_NOFOLLOW-to-prevent-symlink-a.patch deleted +0 -114
114 lines not on this page · raw message
meta/recipes-core/util-linux/util-linux_2.41.5.bb renamed from meta/recipes-core/util-linux/util-linux_2.41.3.bb +0 -0
Signature · 1 line
2.34.1
Re: [OE-core][wrynose][PATCH] util-linux: upgrade 2.41.3 -> 2.41.5
Quoted 12 lines · Siva Balasubramanian
2.41.4 and 2.41.5 are point releases in the same 2.41 stable series and contain only bug fixes and security fixes (no new features, no API/ABI breaks), so the upgrade complies with the stable branch policy.
Among the fixes pulled in:
- Several mount(8) TOCTOU / symlink hardening fixes (incl. CVE-2026-27456)
- libblkid integer overflow inparse_dos_extended()and a use-after-free in partition probing
-pam_lastlog2: fix libpam linking in the autotools build so pam_lastlog2.so links against libpam (fixes the runtime "undefined
symbol:pam_syslog" / dlopen failure) [YOCTO #16320]
Quoted 6 lines
Drop two backports that are now part of the release:
- 0001-loopdev-add-LOOPDEV_FL_NOFOLLOW-to-prevent-symlink-a.patch (upstreamf55f9906, released in 2.41.4)
- thepam_lastlog2libpam linking backport (upstream5683ed6320e0, cherry-picked to the 2.41 stable branch asc8d0af0421f6, released in 2.41.5)
Hi Siva,
I just see one backport dropped in this patch. I don't see any pam_lastlog2 backport in the current wrynose branch, is this related to a patch that wasn't applied or something you're carrying locally?
Best regards,
Signature · 1 line
Paul Barker
Re: [OE-core][wrynose][PATCH] util-linux: upgrade 2.41.3 -> 2.41.5
Hi Paul,
The pam_lastlog2 libpam linking fix (YOCTO #16320) is included natively in 2.41.5.
Thanks,
Siva
Quoted 33 lines · Paul Barker
Quoted 6 lines · Siva Balasubramanian
2.41.4 and 2.41.5 are point releases in the same 2.41 stable series and contain only bug fixes and security fixes (no new features, no API/ABI breaks), so the upgrade complies with the stable branch policy.
Among the fixes pulled in:
- Several mount(8) TOCTOU / symlink hardening fixes (incl.CVE-2026-27456)
Quoted 6 lines
- libblkid integer overflow in
parse_dos_extended()and a use-after-free in partition probing
-pam_lastlog2: fix libpam linking in the autotools build so pam_lastlog2.so links against libpam (fixes the runtime "undefined
symbol:pam_syslog" / dlopen failure) [YOCTO #16320]Quoted 6 lines
Drop two backports that are now part of the release:
- 0001-loopdev-add-LOOPDEV_FL_NOFOLLOW-to-prevent-symlink-a.patch (upstreamf55f9906, released in 2.41.4)
- thepam_lastlog2libpam linking backport (upstream5683ed6320e0, cherry-picked to the 2.41 stable branch asc8d0af0421f6, released in 2.41.5)Hi Siva,
I just see one backport dropped in this patch. I don't see any
pam_lastlog2backport in the current wrynose branch, is this related to a patch that wasn't applied or something you're carrying locally?Best regards,
--
Paul Barker
Signature · 1 line
Sivakumar B
Re: [OE-core][wrynose][PATCH] util-linux: upgrade 2.41.3 -> 2.41.5
Quoted 4 lines · Siva Kumar Balasubramanian
Hi Paul,
The
pam_lastlog2libpam linking fix (YOCTO #16320) is included natively in 2.41.5.
Hi Siva,
Your commit message said "Drop two backports that are now part of the release". The "pam_lastlog2 libpam linking fix" was not backported on the wrynose branch though, so the commit message is wrong. Please send a v2 with a corrected commit message.
Best regards,
Signature · 1 line
Paul Barker
PATCH v2 1/1 util-linux: upgrade 2.41.3 -> 2.41.5
In reply to Siva Balasubramanian2.41.4 and 2.41.5 are point releases in the same 2.41 stable series and contain only bug fixes and security fixes (no new features, no API/ABI breaks), so the upgrade complies with the stable branch policy.
Among the fixes pulled in:
- Several mount(8) TOCTOU / symlink hardening fixes (incl. CVE-2026-27456)
- libblkid integer overflow in parse_dos_extended() and a use-after-free in partition probing
- pam_lastlog2: fix libpam linking in the autotools build so pam_lastlog2.so links against libpam, fixing the runtime "undefined
symbol: pam_syslog" / dlopen failure [YOCTO #16320]
Drop the loopdev symlink-attack backport that is now part of the release:
- 0001-loopdev-add-LOOPDEV_FL_NOFOLLOW-to-prevent-symlink-a.patch (upstream f55f9906, released in 2.41.4)
Full changes: https://github.com/util-linux/util-linux/compare/v2.41.3...v2.41.5
---
v2: Correct the commit message. wrynose only carried the loopdev backport,
not a pam_lastlog2 backport, so only one backport is dropped. The pam_lastlog2 libpam linking fix comes in natively with 2.41.5. (Paul Barker)
...2.41.3.bb => util-linux-libuuid_2.41.5.bb} | 0
meta/recipes-core/util-linux/util-linux.inc | 3 +-
...DEV_FL_NOFOLLOW-to-prevent-symlink-a.patch | 114 ------------------
...l-linux_2.41.3.bb => util-linux_2.41.5.bb} | 0
4 files changed, 1 insertion(+), 116 deletions(-)
rename meta/recipes-core/util-linux/{util-linux-libuuid_2.41.3.bb => util-linux-libuuid_2.41.5.bb} (100%)
delete mode 100644 meta/recipes-core/util-linux/util-linux/0001-loopdev-add-LOOPDEV_FL_NOFOLLOW-to-prevent-symlink-a.patch
rename meta/recipes-core/util-linux/{util-linux_2.41.3.bb => util-linux_2.41.5.bb} (100%)meta/recipes-core/util-linux/util-linux-libuuid_2.41.5.bb renamed from meta/recipes-core/util-linux/util-linux-libuuid_2.41.3.bb +0 -0
meta/recipes-core/util-linux/util-linux.inc +1 -2
@@ -20,9 +20,8 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/utils/util-linux/v${MAJOR_VERSION}/util-lin file://0001-lsfd-mkfds-foreign-sockets-skip-when-lacking-sock_di.patch \ file://0001-ts-kill-decode-use-RTMIN-from-kill-L-instead-of-hard.patch \ file://0001-tests-script-Disable-size-option-test.patch \ - file://0001-loopdev-add-LOOPDEV_FL_NOFOLLOW-to-prevent-symlink-a.patch \ " -SRC_URI[sha256sum] = "3330d873f0fceb5560b89a7dc14e4f3288bbd880e96903ed9b50ec2b5799e58b" +SRC_URI[sha256sum] = "f586e35d320ff537aab3ffeca37e9ecd482ccbe013590db4429a414d8aa6a728" CVE_PRODUCT = "util-linux"
meta/recipes-core/util-linux/util-linux/0001-loopdev-add-LOOPDEV_FL_NOFOLLOW-to-prevent-symlink-a.patch deleted +0 -114
114 lines not on this page · raw message
meta/recipes-core/util-linux/util-linux_2.41.5.bb renamed from meta/recipes-core/util-linux/util-linux_2.41.3.bb +0 -0
Signature · 1 line
2.34.1
Re: [OE-core][wrynose][PATCH v2] util-linux: upgrade 2.41.3 -> 2.41.5
Hi Paul,
You're right, thanks for catching that. wrynose only carried the loopdev backport; the pam_lastlog2 fix was never backported there, it just comes in natively with 2.41.5. I've sent a v2 that corrects the commit message to drop only the loopdev backport and describes the pam_lastlog2 fix as one of the fixes pulled in by the upgrade. The diff is unchanged.
Regards,
Siva
Quoted 204 lines · Siva Balasubramanian
2.41.4 and 2.41.5 are point releases in the same 2.41 stable series and contain only bug fixes and security fixes (no new features, no API/ABI breaks), so the upgrade complies with the stable branch policy.
Among the fixes pulled in:
- Several mount(8) TOCTOU / symlink hardening fixes (incl. CVE-2026-27456)
- libblkid integer overflow inparse_dos_extended()and a use-after-free in partition probing
-pam_lastlog2: fix libpam linking in the autotools build so pam_lastlog2.so links against libpam, fixing the runtime "undefined
symbol:pam_syslog" / dlopen failure [YOCTO #16320]Drop the loopdev symlink-attack backport that is now part of the release:
- 0001-loopdev-add-LOOPDEV_FL_NOFOLLOW-to-prevent-symlink-a.patch (upstreamf55f9906, released in 2.41.4)Full changes:
https://github.com/util-linux/util-linux/compare/v2.41.3...v2.41.5Signed-off-by Siva Balasubramanian <[email protected]>---
v2: Correct the commit message. wrynose only carried the loopdev backport,
not apam_lastlog2backport, so only one backport is dropped. Thepam_lastlog2libpam linking fix comes in natively with 2.41.5. (Paul Barker)...2.41.3.bb => util-linux-libuuid_2.41.5.bb} | 0 meta/recipes-core/util-linux/util-linux.inc | 3 +- ...DEV_FL_NOFOLLOW-to-prevent-symlink-a.patch | 114 ------------------ ...l-linux_2.41.3.bb => util-linux_2.41.5.bb} | 0 4 files changed, 1 insertion(+), 116 deletions(-) rename meta/recipes-core/util-linux/{util-linux-libuuid_2.41.3.bb => util-linux-libuuid_2.41.5.bb} (100%) delete mode 100644 meta/recipes-core/util-linux/util-linux/0001-loopdev-add-LOOPDEV_FL_NOFOLLOW-to-prevent-symlink-a.patch rename meta/recipes-core/util-linux/{util-linux_2.41.3.bb =>util-linux_2.41.5.bb} (100%)
meta/recipes-core/util-linux/util-linux-libuuid_2.41.5.bb renamed from meta/recipes-core/util-linux/util-linux-libuuid_2.41.3.bb +0
-0meta/recipes-core/util-linux/util-linux.inc +0
-0@@ -20,9 +20,8 @@ SRC_URI ="${KERNELORG_MIRROR}/linux/utils/util-linux/v${MAJOR_VERSION}/util-lin
file://0001-lsfd-mkfds-foreign-sockets-skip-when-lacking-sock_di.patch \
file://0001-ts-kill-decode-use-RTMIN-from-kill-L-instead-of-hard.patch \ file://0001-tests-script-Disable-size-option-test.patch \meta/recipes-core/util-linux/util-linux.inc +0
-2- file://0001-loopdev-add-LOOPDEV_FL_NOFOLLOW-to-prevent-symlink-a.patch \ " -SRC_URI[sha256sum] ="
3330d873f0fceb5560b89a7dc14e4f3288bbd880e96903ed9b50ec2b5799e58b" +SRC_URI[sha256sum] = "f586e35d320ff537aab3ffeca37e9ecd482ccbe013590db4429a414d8aa6a728"
CVE_PRODUCT= "util-linux"
diff --gita/meta/recipes-core/util-linux/util-linux/0001-loopdev-add-LOOPDEV_FL_NOFOLLOW-to-prevent-symlink-a.patchb/meta/recipes-core/util-linux/util-linux/0001-loopdev-add-LOOPDEV_FL_NOFOLLOW-to-prevent-symlink-a.patchdeleted file mode 100644
index 0951c9f5fb..0000000000
---a/meta/recipes-core/util-linux/util-linux/0001-loopdev-add-LOOPDEV_FL_NOFOLLOW-to-prevent-symlink-a.patch+++/dev/nullmeta/recipes-core/util-linux/util-linux.inc +0
-4@@ -1,114 +0,0 @@ -From f55f9906b4f6eeb2b4a4120317df9de935253c10 Mon Sep 17 00:00:00 2001 -From: Karel Zak <[email protected]> -Date: Thu, 19 Feb 2026 13:59:46 +0100 -Subject: [PATCH] loopdev: add LOOPDEV_FL_NOFOLLOW to prevent symlinkattacks
meta/recipes-core/util-linux/util-linux.inc +0
-42- -Add a new LOOPDEV_FL_NOFOLLOW flag for loop device context that -prevents symlink following in both path canonicalization and file open. - -When set: -- loopcxt_set_backing_file() uses strdup() instead of - ul_canonicalize_path() (which calls realpath() and follows symlinks) -- loopcxt_setup_device() adds O_NOFOLLOW to open() flags - -The flag is set for non-root (restricted) mount operations in -libmount's loop device hook. This prevents a TOCTOU race condition -where an attacker could replace the backing file (specified in -/etc/fstab) with a symlink to an arbitrary root-owned file between -path resolution and open(). - -Vulnerable Code Flow: - - mount /mnt/point (non-root, SUID) - mount.c: sanitize_paths() on user args (mountpoint only) - mnt_context_mount() - mnt_context_prepare_mount() - mnt_context_apply_fstab() <-- source path from fstab - hooks run at MNT_STAGE_PREP_SOURCE - hook_loopdev.c: setup_loopdev() - backing_file = fstab source path ("/home/user/disk.img") - loopcxt_set_backing_file() <-- calls realpath() as ROOT - ul_canonicalize_path() <-- follows symlinks! - loopcxt_setup_device() - open(lc->filename, O_RDWR|O_CLOEXEC) <-- no O_NOFOLLOW - -Two vulnerabilities in the path: - -1) loopcxt_set_backing_file() calls ul_canonicalize_path() which uses - realpath() -- this follows symlinks as euid=0. If the attacker swaps - the file to a symlink before this call, lc->filename becomes the - resolved target path (e.g., /root/secret.img). - -2) loopcxt_setup_device() opens lc->filename without O_NOFOLLOW. Even - if canonicalization happened correctly, the file can be swapped to a - symlink between canonicalize and open. - -Addresses:https://github.com/util-linux/util-linux/security/advisories/GHSA-qq4x-vfq4-9h9g
meta/recipes-core/util-linux/util-linux.inc +0
-20-Signed-off-by: Karel Zak <[email protected]> -(cherry picked from commit 5e390467b26a3cf3fecc04e1a0d482dff3162fc4) - -CVE: CVE-2026-27456 -Upstream-Status: Backport -Signed-off-by: Ross Burton <[email protected]> ---- - include/loopdev.h | 3 ++- - lib/loopdev.c | 7 ++++++- - libmount/src/hook_loopdev.c | 3 ++- - 3 files changed, 10 insertions(+), 3 deletions(-) - -diff --git a/include/loopdev.h b/include/loopdev.h -index e5ec1c98a..6bdb1393a 100644 ---- a/include/loopdev.h -+++ b/include/loopdev.h -@@ -140,7 +140,8 @@ enum { - LOOPDEV_FL_NOIOCTL = (1 << 6), - LOOPDEV_FL_DEVSUBDIR = (1 << 7), - LOOPDEV_FL_CONTROL = (1 << 8), /* system with
/dev/loop-control*/-- LOOPDEV_FL_SIZELIMIT = (1 << 9) -+ LOOPDEV_FL_SIZELIMIT = (1 << 9), -+ LOOPDEV_FL_NOFOLLOW = (1 << 10) /* O_NOFOLLOW, don'tfollow symlinks */
- };meta/recipes-core/util-linux/util-linux.inc +0
-7- - /* -diff --git a/lib/loopdev.c b/lib/loopdev.c -index 2359bf781..76685be70 100644 ---- a/lib/loopdev.c -+++ b/lib/loopdev.c -@@ -1267,7 +1267,10 @@ int loopcxt_set_backing_file(struct loopdev_cxt*lc, const char *filename)
meta/recipes-core/util-linux/util-linux.inc +0
-20- if (!lc) - return -EINVAL; - -- lc->filename = canonicalize_path(filename); -+ if (lc->flags & LOOPDEV_FL_NOFOLLOW) -+ lc->filename = strdup(filename); -+ else -+ lc->filename = canonicalize_path(filename); - if (!lc->filename) - return -errno; - -@@ -1408,6 +1411,8 @@ int loopcxt_setup_device(struct loopdev_cxt *lc) - - if (lc->config.info.lo_flags & LO_FLAGS_DIRECT_IO) - flags |= O_DIRECT; -+ if (lc->flags & LOOPDEV_FL_NOFOLLOW) -+ flags |= O_NOFOLLOW; - - if ((file_fd = open(lc->filename, mode | flags)) < 0) { - if (mode != O_RDONLY && (errno == EROFS || errno ==EACCES))
meta/recipes-core/util-linux/util-linux.inc +0
-11-diff --git a/libmount/src/hook_loopdev.c b/libmount/src/hook_loopdev.c -index 444d69d6f..34351116c 100644 ---- a/libmount/src/hook_loopdev.c -+++ b/libmount/src/hook_loopdev.c -@@ -272,7 +272,8 @@ static int setup_loopdev(struct libmnt_context *cxt, - } - - DBG(LOOP, ul_debugobj(cxt, "not found; create a new loop device")); -- rc = loopcxt_init(&lc, 0); -+ rc = loopcxt_init(&lc, -+ mnt_context_is_restricted(cxt) ?
LOOPDEV_FL_NOFOLLOW: 0);meta/recipes-core/util-linux/util-linux.inc +0
-6- if (rc) - goto done_no_deinit; - if (mnt_opt_has_value(loopopt)) { --- -2.43.0 -meta/recipes-core/util-linux/util-linux_2.41.5.bb renamed from meta/recipes-core/util-linux/util-linux_2.41.3.bb +0
-1--2.34.1
Signature · 1 line
Sivakumar B