package/linux-pam: add security patch for CVE-2024-10963
PATCH 1/3 package/linux-pam: add security patch for CVE-2024-10963
See:
https://github.com/linux-pam/linux-pam/issues/834
--- ...work-resolving-of-tokens-as-hostname.patch | 222 ++++++++++++++++++ package/linux-pam/linux-pam.mk | 1 + 2 files changed, 223 insertions(+) create mode 100644 package/linux-pam/0002-pam_access-rework-resolving-of-tokens-as-hostname.patch
package/linux-pam/0002-pam_access-rework-resolving-of-tokens-as-hostname.patch new file +222 -0
@@ -0,0 +1,222 @@ +From 940747f88c16e029b69a74e80a2e94f65cb3e628 Mon Sep 17 00:00:00 2001 +From: Thorsten Kukuk <[email protected]> +Date: Thu, 14 Nov 2024 10:27:28 +0100 +Subject: [PATCH] pam_access: rework resolving of tokens as hostname + +* modules/pam_access/pam_access.c: separate resolving of IP addresses + from hostnames. Don't resolve TTYs or display variables as hostname + (#834). + Add "nodns" option to disallow resolving of tokens as hostname. +* modules/pam_access/pam_access.8.xml: document nodns option +* modules/pam_access/access.conf.5.xml: document that hostnames should + be written as FQHN. +--- + modules/pam_access/access.conf.5.xml | 4 ++ + modules/pam_access/pam_access.8.xml | 46 ++++++++++++------ + modules/pam_access/pam_access.c | 72 +++++++++++++++++++++++++++- + 3 files changed, 105 insertions(+), 17 deletions(-) + +diff --git a/modules/pam_access/access.conf.5.xml b/modules/pam_access/access.conf.5.xml +index 0b93db00e..10b8ba925 100644 +--- a/modules/pam_access/access.conf.5.xml ++++ b/modules/pam_access/access.conf.5.xml +@@ -233,6 +233,10 @@ + An IPv6 link local host address must contain the interface + identifier. IPv6 link local network/netmask is not supported. + </para> ++ <para> ++ Hostnames should be written as Fully-Qualified Host Name (FQHN) to avoid ++ confusion with device names or PAM service names. ++ </para> + </refsect1> + + <refsect1 xml:id="access.conf-see_also"> +diff --git a/modules/pam_access/pam_access.8.xml b/modules/pam_access/pam_access.8.xml +index c991d7a09..71a4f7ee9 100644 +--- a/modules/pam_access/pam_access.8.xml ++++ b/modules/pam_access/pam_access.8.xml +@@ -22,11 +22,14 @@ + <arg choice="opt" rep="norepeat"> + debug + </arg> ++ <arg choice="opt" rep="norepeat"> ++ noaudit ++ </arg> + <arg choice="opt" rep="norepeat"> + nodefgroup + </arg> + <arg choice="opt" rep="norepeat"> +- noaudit ++ nodns + </arg> + <arg choice="opt" rep="norepeat"> + quiet_log +@@ -132,6 +135,33 @@ + </listitem> + </varlistentry> + ++ <varlistentry> ++ <term> ++ nodefgroup ++ </term> ++ <listitem> ++ <para> ++ User tokens which are not enclosed in parentheses will not be ++ matched against the group database. The backwards compatible default is ++ to try the group database match even for tokens not enclosed ++ in parentheses. ++ </para> ++ </listitem> ++ </varlistentry> ++ ++ <varlistentry> ++ <term> ++ nodns ++ </term> ++ <listitem> ++ <para> ++ Do not try to resolve tokens as hostnames, only IPv4 and IPv6 ++ addresses will be resolved. Which means to allow login from a ++ remote host, the IP addresses need to be specified in <filename>access.conf</filename>. ++ </para> ++ </listitem> ++ </varlistentry> ++ + <varlistentry> + <term> + quiet_log +@@ -185,20 +215,6 @@ + </listitem> + </varlistentry> + +- <varlistentry> +- <term> +- nodefgroup +- </term> +- <listitem> +- <para> +- User tokens which are not enclosed in parentheses will not be +- matched against the group database. The backwards compatible default is +- to try the group database match even for tokens not enclosed +- in parentheses. +- </para> +- </listitem> +- </varlistentry> +- + </variablelist> + </refsect1> + +diff --git a/modules/pam_access/pam_access.c b/modules/pam_access/pam_access.c +index 48e7c7e97..109115e9c 100644 +--- a/modules/pam_access/pam_access.c ++++ b/modules/pam_access/pam_access.c +@@ -100,6 +100,7 @@ struct login_info { + int only_new_group_syntax; /* Only allow group entries of the form "(xyz)" */ + int noaudit; /* Do not audit denials */ + int quiet_log; /* Do not log denials */ ++ int nodns; /* Do not try to resolve tokens as hostnames */ + const char *fs; /* field separator */ + const char *sep; /* list-element separator */ + int from_remote_host; /* If PAM_RHOST was used for from */ +@@ -154,6 +155,8 @@ parse_args(pam_handle_t *pamh, struct login_info *loginfo, + loginfo->noaudit = YES; + } else if (strcmp (argv[i], "quiet_log") == 0) { + loginfo->quiet_log = YES; ++ } else if (strcmp (argv[i], "nodns") == 0) { ++ loginfo->nodns = YES; + } else { + pam_syslog(pamh, LOG_ERR, "unrecognized option [%s]", argv[i]); + } +@@ -820,7 +823,7 @@ remote_match (pam_handle_t *pamh, char *tok, struct login_info *item) + if ((str_len = strlen(string)) > tok_len + && strcasecmp(tok, string + str_len - tok_len) == 0) + return YES; +- } else if (tok[tok_len - 1] == '.') { /* internet network numbers (end with ".") */ ++ } else if (tok[tok_len - 1] == '.') { /* internet network numbers/subnet (end with ".") */ + struct addrinfo hint; + + memset (&hint, '\0', sizeof (hint)); +@@ -895,6 +898,39 @@ string_match (pam_handle_t *pamh, const char *tok, const char *string, + } + + ++static int ++is_device (pam_handle_t *pamh, const char *tok) ++{ ++ struct stat st; ++ const char *dev = "/dev/"; ++ char *devname; ++ ++ devname = malloc (strlen(dev) + strlen (tok) + 1); ++ if (devname == NULL) { ++ pam_syslog(pamh, LOG_ERR, "Cannot allocate memory for device name: %m"); ++ /* ++ * We should return an error and abort, but pam_access has no good ++ * error handling. ++ */ ++ return NO; ++ } ++ ++ char *cp = stpcpy (devname, dev); ++ strcpy (cp, tok); ++ ++ if (lstat(devname, &st) != 0) ++ { ++ free (devname); ++ return NO; ++ } ++ free (devname); ++ ++ if (S_ISCHR(st.st_mode)) ++ return YES; ++ ++ return NO; ++} ++ + /* network_netmask_match - match a string against one token + * where string is a hostname or ip (v4,v6) address and tok + * represents either a hostname, a single ip (v4,v6) address +@@ -956,10 +992,42 @@ network_netmask_match (pam_handle_t *pamh, + return NO; + } + } ++ else if (isipaddr(tok, NULL, NULL) == YES) ++ { ++ if (getaddrinfo (tok, NULL, NULL, &ai) != 0) ++ { ++ if (item->debug) ++ pam_syslog(pamh, LOG_DEBUG, "cannot resolve IP address \"%s\"", tok); ++ ++ return NO; ++ } ++ netmask_ptr = NULL; ++ } ++ else if (item->nodns) ++ { ++ /* Only hostnames are left, which we would need to resolve via DNS */ ++ return NO; ++ } + else + { ++ /* Bail out on X11 Display entries and ttys. */ ++ if (tok[0] == ':') ++ { ++ if (item->debug) ++ pam_syslog (pamh, LOG_DEBUG, ++ "network_netmask_match: tok=%s is X11 display", tok); ++ return NO; ++ } ++ if (is_device (pamh, tok)) ++ { ++ if (item->debug) ++ pam_syslog (pamh, LOG_DEBUG, ++ "network_netmask_match: tok=%s is a TTY", tok); ++ return NO; ++ } ++ + /* +- * It is either an IP address or a hostname. ++ * It is most likely a hostname. + * Let getaddrinfo sort everything out + */ + if (getaddrinfo (tok, NULL, NULL, &ai) != 0)
package/linux-pam/linux-pam.mk +1 -0
@@ -24,6 +24,7 @@ LINUX_PAM_LICENSE_FILES = Copyright LINUX_PAM_LIBS = $(TARGET_NLS_LIBS) LINUX_PAM_MAKE_OPTS += LIBS="$(LINUX_PAM_LIBS)" LINUX_PAM_CPE_ID_VENDOR = linux-pam +LINUX_PAM_IGNORE_CVES += CVE-2024-10963 ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y) LINUX_PAM_LIBS += -latomic
Signature · 6 lines
2.52.0 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH 2/3 package/linux-pam: security bump to version 1.7.2
The build system was changed from autotools to meson.
Changelog:
https://github.com/linux-pam/linux-pam/releases/tag/v1.7.0
https://github.com/linux-pam/linux-pam/releases/tag/v1.7.1
https://github.com/linux-pam/linux-pam/releases/tag/v1.7.2
--- ...-consistently-include-config.h-first.patch | 180 -------------- ...work-resolving-of-tokens-as-hostname.patch | 222 ------------------ package/linux-pam/linux-pam.hash | 6 +- package/linux-pam/linux-pam.mk | 32 ++- 4 files changed, 17 insertions(+), 423 deletions(-) delete mode 100644 package/linux-pam/0001-build-consistently-include-config.h-first.patch delete mode 100644 package/linux-pam/0002-pam_access-rework-resolving-of-tokens-as-hostname.patch
package/linux-pam/0001-build-consistently-include-config.h-first.patch deleted +0 -180
@@ -1,180 +0,0 @@ -From cdba2c8cdba9b3500595624fb375c0dda266631b Mon Sep 17 00:00:00 2001 -From: "Dmitry V. Levin" <[email protected]> -Date: Fri, 30 Aug 2024 08:00:00 +0000 -Subject: [PATCH] build: consistently include config.h first - -Make sure that config.h is included before any system header. - -Upstream: https://github.com/linux-pam/linux-pam/commit/5d7eefb1883c557c7a027f68e966e2fae294a9b6 -Signed-off-by: Thomas Petazzoni <[email protected]> ---- - libpam/pam_prelude.c | 8 ++++---- - modules/pam_namespace/argv_parse.c | 2 ++ - modules/pam_setquota/pam_setquota.c | 3 ++- - modules/pam_timestamp/sha1.c | 2 +- - modules/pam_unix/audit.c | 3 +-- - modules/pam_unix/bigcrypt_main.c | 2 ++ - modules/pam_unix/md5.c | 4 ++-- - modules/pam_unix/md5_crypt.c | 2 +- - modules/pam_unix/yppasswd.h | 2 ++ - 9 files changed, 17 insertions(+), 11 deletions(-) - -diff --git a/libpam/pam_prelude.c b/libpam/pam_prelude.c -index 6c73bf5d..c62e2f2c 100644 ---- a/libpam/pam_prelude.c -+++ b/libpam/pam_prelude.c -@@ -5,17 +5,17 @@ - * (C) Sebastien Tricaud 2005 <[email protected]> - */ - --#include <stdio.h> --#include <syslog.h> -- - #ifdef PRELUDE - -+#include "pam_private.h" -+ -+#include <stdio.h> -+#include <syslog.h> - #include <libprelude/prelude.h> - #include <libprelude/prelude-log.h> - #include <libprelude/idmef-message-print.h> - - #include "pam_prelude.h" --#include "pam_private.h" - - - #define ANALYZER_CLASS "pam" -diff --git a/modules/pam_namespace/argv_parse.c b/modules/pam_namespace/argv_parse.c -index ac7c9ae0..cbae7831 100644 ---- a/modules/pam_namespace/argv_parse.c -+++ b/modules/pam_namespace/argv_parse.c -@@ -28,6 +28,8 @@ - * Version 1.1, modified 2/27/1999 - */ - -+#include "config.h" -+ - #include <limits.h> - #include <stdlib.h> - #include <ctype.h> -diff --git a/modules/pam_setquota/pam_setquota.c b/modules/pam_setquota/pam_setquota.c -index c15fc669..73445e29 100644 ---- a/modules/pam_setquota/pam_setquota.c -+++ b/modules/pam_setquota/pam_setquota.c -@@ -8,6 +8,8 @@ - Copyright © 2016 Keller Fuchs <[email protected]> - */ - -+#include "pam_inline.h" -+ - #include <sys/types.h> - #include <sys/quota.h> - #include <linux/quota.h> -@@ -22,7 +24,6 @@ - #include <security/_pam_macros.h> - #include <security/pam_ext.h> - #include <security/pam_modutil.h> --#include "pam_inline.h" - - #ifndef PATH_LOGIN_DEFS - # define PATH_LOGIN_DEFS "/etc/login.defs" -diff --git a/modules/pam_timestamp/sha1.c b/modules/pam_timestamp/sha1.c -index dff454cf..f21b2870 100644 ---- a/modules/pam_timestamp/sha1.c -+++ b/modules/pam_timestamp/sha1.c -@@ -37,6 +37,7 @@ - */ - /* See http://www.itl.nist.gov/fipspubs/fip180-1.htm for descriptions. */ - -+#include "pam_inline.h" - #include <sys/types.h> - #include <sys/stat.h> - #include <netinet/in.h> -@@ -47,7 +48,6 @@ - #include <endian.h> - #include <unistd.h> - #include "sha1.h" --#include "pam_inline.h" - - static const unsigned char - padding[SHA1_BLOCK_SIZE] = { -diff --git a/modules/pam_unix/audit.c b/modules/pam_unix/audit.c -index 1547a652..9513aaa9 100644 ---- a/modules/pam_unix/audit.c -+++ b/modules/pam_unix/audit.c -@@ -1,5 +1,3 @@ --#include "audit.h" -- - #include "config.h" - - #ifdef HAVE_LIBAUDIT -@@ -11,6 +9,7 @@ - - #include <security/_pam_types.h> - -+#include "audit.h" - #include "passverify.h" - - int audit_log(int type, const char *uname, int retval) -diff --git a/modules/pam_unix/bigcrypt_main.c b/modules/pam_unix/bigcrypt_main.c -index fab212d9..22d325da 100644 ---- a/modules/pam_unix/bigcrypt_main.c -+++ b/modules/pam_unix/bigcrypt_main.c -@@ -1,3 +1,5 @@ -+#include "config.h" -+ - #include <stdio.h> - #include <string.h> - -diff --git a/modules/pam_unix/md5.c b/modules/pam_unix/md5.c -index 95b8de4c..78e9af27 100644 ---- a/modules/pam_unix/md5.c -+++ b/modules/pam_unix/md5.c -@@ -18,11 +18,11 @@ - * - */ - -+#include "pam_inline.h" -+ - #include <string.h> - #include "md5.h" - --#include "pam_inline.h" -- - #ifndef HIGHFIRST - #define byteReverse(buf, len) /* Nothing */ - #else -diff --git a/modules/pam_unix/md5_crypt.c b/modules/pam_unix/md5_crypt.c -index 9a6bd4f9..9451f376 100644 ---- a/modules/pam_unix/md5_crypt.c -+++ b/modules/pam_unix/md5_crypt.c -@@ -12,11 +12,11 @@ - * - */ - -+#include "pam_inline.h" - #include <string.h> - #include <stdio.h> - #include <stdlib.h> - #include "md5.h" --#include "pam_inline.h" - - static const unsigned char itoa64[] = /* 0 ... 63 => ascii - 64 */ - "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; -diff --git a/modules/pam_unix/yppasswd.h b/modules/pam_unix/yppasswd.h -index dc686cd7..3a40c3ea 100644 ---- a/modules/pam_unix/yppasswd.h -+++ b/modules/pam_unix/yppasswd.h -@@ -6,6 +6,8 @@ - #ifndef _YPPASSWD_H_RPCGEN - #define _YPPASSWD_H_RPCGEN - -+#include "config.h" -+ - #include <rpc/rpc.h> - - --- -2.47.1 -
package/linux-pam/0002-pam_access-rework-resolving-of-tokens-as-hostname.patch deleted +0 -222
222 lines not on this page · raw message
package/linux-pam/linux-pam.hash +3 -3
@@ -1,6 +1,6 @@ # Locally computed hashes after checking signature at -# https://github.com/linux-pam/linux-pam/releases/download/v1.6.1/Linux-PAM-1.6.1.tar.xz.asc -# signed with the key 8C6BFD92EE0F42EDF91A6A736D1A7F052E5924BB -sha256 f8923c740159052d719dbfc2a2f81942d68dd34fcaf61c706a02c9b80feeef8e Linux-PAM-1.6.1.tar.xz +# https://github.com/linux-pam/linux-pam/releases/download/v1.7.2/Linux-PAM-1.7.2.tar.xz.asc +# signed with the key 7BECFE3AF7B280BB52FF77F104BA4521C996DDE1 +sha256 3d86b6383fb5fd9eb9578d2cd47d92801191f4bf3f9bc61419bfefc8aa1e531a Linux-PAM-1.7.2.tar.xz # Locally computed sha256 133d98e7a2ab3ffd330b4debb0bfc10fea21e4b2b5a5b09de2e924293be5ff08 Copyright
package/linux-pam/linux-pam.mk +14 -18
@@ -4,18 +4,15 @@ # ################################################################################ -LINUX_PAM_VERSION = 1.6.1 +LINUX_PAM_VERSION = 1.7.2 LINUX_PAM_SOURCE = Linux-PAM-$(LINUX_PAM_VERSION).tar.xz LINUX_PAM_SITE = https://github.com/linux-pam/linux-pam/releases/download/v$(LINUX_PAM_VERSION) LINUX_PAM_INSTALL_STAGING = YES LINUX_PAM_CONF_OPTS = \ - --disable-prelude \ - --disable-isadir \ - --disable-nis \ - --disable-db \ - --disable-regenerate-docu \ - --enable-securedir=/lib/security \ - --libdir=/lib + -Disadir=disabled \ + -Dnis=disabled \ + -Dpam_userdb=disabled \ + -Ddocs=disabled LINUX_PAM_DEPENDENCIES = host-flex host-pkgconf \ $(if $(BR2_PACKAGE_LIBXCRYPT),libxcrypt) \ $(TARGET_NLS_DEPENDENCIES)
@@ -24,45 +21,44 @@ LINUX_PAM_LICENSE_FILES = Copyright LINUX_PAM_LIBS = $(TARGET_NLS_LIBS) LINUX_PAM_MAKE_OPTS += LIBS="$(LINUX_PAM_LIBS)" LINUX_PAM_CPE_ID_VENDOR = linux-pam -LINUX_PAM_IGNORE_CVES += CVE-2024-10963 ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y) LINUX_PAM_LIBS += -latomic endif ifeq ($(BR2_PACKAGE_LIBSELINUX),y) -LINUX_PAM_CONF_OPTS += --enable-selinux +LINUX_PAM_CONF_OPTS += -Dselinux=enabled LINUX_PAM_DEPENDENCIES += libselinux define LINUX_PAM_SELINUX_PAMFILE_TWEAK $(SED) 's/^# \(.*pam_selinux.so.*\)$$/\1/' \ $(TARGET_DIR)/etc/pam.d/login endef else -LINUX_PAM_CONF_OPTS += --disable-selinux +LINUX_PAM_CONF_OPTS += -Dselinux=disabled endif ifeq ($(BR2_PACKAGE_AUDIT),y) -LINUX_PAM_CONF_OPTS += --enable-audit +LINUX_PAM_CONF_OPTS += -Daudit=enabled LINUX_PAM_DEPENDENCIES += audit else -LINUX_PAM_CONF_OPTS += --disable-audit +LINUX_PAM_CONF_OPTS += -Daudit=disabled endif ifeq ($(BR2_PACKAGE_OPENSSL),y) -LINUX_PAM_CONF_OPTS += --enable-openssl +LINUX_PAM_CONF_OPTS += -Dopenssl=enabled LINUX_PAM_DEPENDENCIES += openssl else -LINUX_PAM_CONF_OPTS += --disable-openssl +LINUX_PAM_CONF_OPTS += -Dopenssl=disabled endif ifeq ($(BR2_PACKAGE_LINUX_PAM_LASTLOG),y) -LINUX_PAM_CONF_OPTS += --enable-lastlog +LINUX_PAM_CONF_OPTS += -Dpam_lastlog=enabled define LINUX_PAM_LASTLOG_PAMFILE_TWEAK $(SED) 's/^# \(.*pam_lastlog.so.*\)$$/\1/' \ $(TARGET_DIR)/etc/pam.d/login endef else -LINUX_PAM_CONF_OPTS += --disable-lastlog +LINUX_PAM_CONF_OPTS += -Dpam_lastlog=disabled endif # Install default pam config (deny everything except login)
@@ -77,4 +73,4 @@ endef LINUX_PAM_POST_INSTALL_TARGET_HOOKS += LINUX_PAM_INSTALL_CONFIG -$(eval $(autotools-package)) +$(eval $(meson-package))
Signature · 6 lines
2.52.0 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Re: [Buildroot] [PATCH v1 2/3] package/linux-pam: security bump to version 1.7.2
Hi Raphael,
Quoted 8 lines · Raphael Pavlidis
The build system was changed from autotools to meson.
Changelog:
https://github.com/linux-pam/linux-pam/releases/tag/v1.7.0
https://github.com/linux-pam/linux-pam/releases/tag/v1.7.1
https://github.com/linux-pam/linux-pam/releases/tag/v1.7.2Signed-off-by Raphael Pavlidis <[email protected]>---
Applied to master after adding a note to the vulnerability fixed in this bump (https://github.com/linux-pam/linux-pam/security/advisories/GHSA-f9p8-gjr4-j9gx / CVE-2025-6020).
Best,
Marcus
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Re: [Buildroot] [PATCH v1 2/3] package/linux-pam: security bump to version 1.7.2
Quoted 5 lines · Marcus Hoffmann via buildroot
Hi Raphael,
Quoted 2 lines · Raphael Pavlidis
The build system was changed from autotools to meson.
Quoted 7 lines
Quoted 6 lines
Changelog:
https://github.com/linux-pam/linux-pam/releases/tag/v1.7.0
https://github.com/linux-pam/linux-pam/releases/tag/v1.7.1
https://github.com/linux-pam/linux-pam/releases/tag/v1.7.2Signed-off-by Raphael Pavlidis <[email protected]>---
Applied to master after adding a note to the vulnerability fixed in this bump (https://github.com/linux-pam/linux-pam/security/advisories/GHSA- f9p8-gjr4-j9gx / CVE-2025-6020).
As for the builroot stable branches, debian lists these three commits to be the fix[1]:
Fixed by: https://github.com/linux-pam/linux-pam/commit/475bd60c552b98c7eddb3270b0b4196847c0072e (v1.7.1) Fixed by: https://github.com/linux-pam/linux-pam/commit/592d84e1265d04c3104acee815a503856db503a1 (v1.7.1) Fixed by: https://github.com/linux-pam/linux-pam/commit/976c20079358d133514568fc7fd95c02df8b5773 (v1.7.1)
Not sure how easy they are to backport to 1.6.x though debian seems to have them for 1.4 and 1.5?
[1] https://security-tracker.debian.org/tracker/CVE-2025-6020
Marcus
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Re: [Buildroot] [PATCH v1 2/3] package/linux-pam: security bump to version 1.7.2
Hi Marcus, Raphael,
In reply of:
Quoted 14 lines · Marcus Hoffmann via buildroot
Quoted 11 lines
Hi Raphael,
Quoted 9 lines · Raphael Pavlidis
The build system was changed from autotools to meson.
Changelog:
https://github.com/linux-pam/linux-pam/releases/tag/v1.7.0
https://github.com/linux-pam/linux-pam/releases/tag/v1.7.1
https://github.com/linux-pam/linux-pam/releases/tag/v1.7.2Signed-off-by Raphael Pavlidis <[email protected]>---
Applied to master after adding a note to the vulnerability fixed in this > bump (https://github.com/linux-pam/linux-pam/security/advisories/GHSA- > f9p8-gjr4-j9gx / CVE-2025-6020).
As for the builroot stable branches, debian lists these three commits to be the fix[1]:
Quoted 7 lines
Fixed by: https://github.com/linux-pam/linux-pam/commit/475bd60c552b98c7eddb3270b0b4196847c0072e (v1.7.1) Fixed by: https://github.com/linux-pam/linux-pam/commit/592d84e1265d04c3104acee815a503856db503a1 (v1.7.1) Fixed by: https://github.com/linux-pam/linux-pam/commit/976c20079358d133514568fc7fd95c02df8b5773 (v1.7.1)
Not sure how easy they are to backport to 1.6.x though debian seems to have them for 1.4 and 1.5?
[1] https://security-tracker.debian.org/tracker/CVE-2025-6020
Thanks for the pointers.
I just sent the following backport based on the work of the OpenEmbedded community.
https://lore.kernel.org/r/<[email protected]>
The backport is quite big, not sure if it's worth the risk. Would appreciate if someone could give it a second look.
Best regards,
PERALE Thomas
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Thomas Perale via buildroot
AppliedRe: [Buildroot] [PATCH v1 2/3] package/linux-pam: security bump to version 1.7.2
In reply to Raphael PavlidisIn reply of:
Quoted 7 lines
The build system was changed from autotools to meson.
Changelog:
https://github.com/linux-pam/linux-pam/releases/tag/v1.7.0
https://github.com/linux-pam/linux-pam/releases/tag/v1.7.1
https://github.com/linux-pam/linux-pam/releases/tag/v1.7.2Signed-off-by Raphael Pavlidis <[email protected]>
Applied to 2026.02.x. Thanks
Quoted 532 lines
--- ...-consistently-include-config.h-first.patch | 180 -------------- ...work-resolving-of-tokens-as-hostname.patch | 222 ------------------ package/linux-pam/linux-pam.hash | 6 +- package/linux-pam/linux-pam.mk | 32 ++- 4 files changed, 17 insertions(+), 423 deletions(-) delete mode 100644 package/linux-pam/0001-build-consistently-include-config.h-first.patch delete mode 100644 package/linux-pam/0002-pam_access-rework-resolving-of-tokens-as-hostname.patchpackage/linux-pam/0001-build-consistently-include-config.h-first.patch deleted +0
-180@@ -1,180 +0,0 @@ -From cdba2c8cdba9b3500595624fb375c0dda266631b Mon Sep 17 00:00:00 2001 -From: "Dmitry V. Levin" <[email protected]> -Date: Fri, 30 Aug 2024 08:00:00 +0000 -Subject: [PATCH] build: consistently include config.h first - -Make sure that config.h is included before any system header. - -Upstream: https://github.com/linux-pam/linux-pam/commit/5d7eefb1883c557c7a027f68e966e2fae294a9b6 -Signed-off-by: Thomas Petazzoni <[email protected]> ---- - libpam/pam_prelude.c | 8 ++++---- - modules/pam_namespace/argv_parse.c | 2 ++ - modules/pam_setquota/pam_setquota.c | 3 ++- - modules/pam_timestamp/sha1.c | 2 +- - modules/pam_unix/audit.c | 3 +-- - modules/pam_unix/bigcrypt_main.c | 2 ++ - modules/pam_unix/md5.c | 4 ++-- - modules/pam_unix/md5_crypt.c | 2 +- - modules/pam_unix/yppasswd.h | 2 ++ - 9 files changed, 17 insertions(+), 11 deletions(-) - -diff --git a/libpam/pam_prelude.c b/libpam/pam_prelude.c -index 6c73bf5d..c62e2f2c 100644 ---- a/libpam/pam_prelude.c -+++ b/libpam/pam_prelude.c -@@ -5,17 +5,17 @@ - * (C) Sebastien Tricaud 2005 <[email protected]> - */ - --#include <stdio.h> --#include <syslog.h> -- - #ifdef PRELUDE - -+#include "pam_private.h" -+ -+#include <stdio.h> -+#include <syslog.h> - #include <libprelude/prelude.h> - #include <libprelude/prelude-log.h> - #include <libprelude/idmef-message-print.h> - - #include "pam_prelude.h" --#include "pam_private.h" - - - #define ANALYZER_CLASS "pam" -diff --git a/modules/pam_namespace/argv_parse.c b/modules/pam_namespace/argv_parse.c -index ac7c9ae0..cbae7831 100644 ---- a/modules/pam_namespace/argv_parse.c -+++ b/modules/pam_namespace/argv_parse.c -@@ -28,6 +28,8 @@ - * Version 1.1, modified 2/27/1999 - */ - -+#include "config.h" -+ - #include <limits.h> - #include <stdlib.h> - #include <ctype.h> -diff --git a/modules/pam_setquota/pam_setquota.c b/modules/pam_setquota/pam_setquota.c -index c15fc669..73445e29 100644 ---- a/modules/pam_setquota/pam_setquota.c -+++ b/modules/pam_setquota/pam_setquota.c -@@ -8,6 +8,8 @@ - Copyright © 2016 Keller Fuchs <[email protected]> - */ - -+#include "pam_inline.h" -+ - #include <sys/types.h> - #include <sys/quota.h> - #include <linux/quota.h> -@@ -22,7 +24,6 @@ - #include <security/_pam_macros.h> - #include <security/pam_ext.h> - #include <security/pam_modutil.h> --#include "pam_inline.h" - - #ifndef PATH_LOGIN_DEFS - # define PATH_LOGIN_DEFS "/etc/login.defs" -diff --git a/modules/pam_timestamp/sha1.c b/modules/pam_timestamp/sha1.c -index dff454cf..f21b2870 100644 ---- a/modules/pam_timestamp/sha1.c -+++ b/modules/pam_timestamp/sha1.c -@@ -37,6 +37,7 @@ - */ - /* See http://www.itl.nist.gov/fipspubs/fip180-1.htm for descriptions. */ - -+#include "pam_inline.h" - #include <sys/types.h> - #include <sys/stat.h> - #include <netinet/in.h> -@@ -47,7 +48,6 @@ - #include <endian.h> - #include <unistd.h> - #include "sha1.h" --#include "pam_inline.h" - - static const unsigned char - padding[SHA1_BLOCK_SIZE] = { -diff --git a/modules/pam_unix/audit.c b/modules/pam_unix/audit.c -index 1547a652..9513aaa9 100644 ---- a/modules/pam_unix/audit.c -+++ b/modules/pam_unix/audit.c -@@ -1,5 +1,3 @@ --#include "audit.h" -- - #include "config.h" - - #ifdef HAVE_LIBAUDIT -@@ -11,6 +9,7 @@ - - #include <security/_pam_types.h> - -+#include "audit.h" - #include "passverify.h" - - int audit_log(int type, const char *uname, int retval) -diff --git a/modules/pam_unix/bigcrypt_main.c b/modules/pam_unix/bigcrypt_main.c -index fab212d9..22d325da 100644 ---- a/modules/pam_unix/bigcrypt_main.c -+++ b/modules/pam_unix/bigcrypt_main.c -@@ -1,3 +1,5 @@ -+#include "config.h" -+ - #include <stdio.h> - #include <string.h> - -diff --git a/modules/pam_unix/md5.c b/modules/pam_unix/md5.c -index 95b8de4c..78e9af27 100644 ---- a/modules/pam_unix/md5.c -+++ b/modules/pam_unix/md5.c -@@ -18,11 +18,11 @@ - * - */ - -+#include "pam_inline.h" -+ - #include <string.h> - #include "md5.h" - --#include "pam_inline.h" -- - #ifndef HIGHFIRST - #define byteReverse(buf, len) /* Nothing */ - #else -diff --git a/modules/pam_unix/md5_crypt.c b/modules/pam_unix/md5_crypt.c -index 9a6bd4f9..9451f376 100644 ---- a/modules/pam_unix/md5_crypt.c -+++ b/modules/pam_unix/md5_crypt.c -@@ -12,11 +12,11 @@ - * - */ - -+#include "pam_inline.h" - #include <string.h> - #include <stdio.h> - #include <stdlib.h> - #include "md5.h" --#include "pam_inline.h" - - static const unsigned char itoa64[] = /* 0 ... 63 => ascii - 64 */ - "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; -diff --git a/modules/pam_unix/yppasswd.h b/modules/pam_unix/yppasswd.h -index dc686cd7..3a40c3ea 100644 ---- a/modules/pam_unix/yppasswd.h -+++ b/modules/pam_unix/yppasswd.h -@@ -6,6 +6,8 @@ - #ifndef _YPPASSWD_H_RPCGEN - #define _YPPASSWD_H_RPCGEN - -+#include "config.h" -+ - #include <rpc/rpc.h> - - --- -2.47.1 -package/linux-pam/0002-pam_access-rework-resolving-of-tokens-as-hostname.patch deleted +0
-222@@ -1,222 +0,0 @@ -From 940747f88c16e029b69a74e80a2e94f65cb3e628 Mon Sep 17 00:00:00 2001 -From: Thorsten Kukuk <[email protected]> -Date: Thu, 14 Nov 2024 10:27:28 +0100 -Subject: [PATCH] pam_access: rework resolving of tokens as hostname - -* modules/pam_access/pam_access.c: separate resolving of IP addresses - from hostnames. Don't resolve TTYs or display variables as hostname - (#834). - Add "nodns" option to disallow resolving of tokens as hostname. -* modules/pam_access/pam_access.8.xml: document nodns option -* modules/pam_access/access.conf.5.xml: document that hostnames should - be written as FQHN. ---- - modules/pam_access/access.conf.5.xml | 4 ++ - modules/pam_access/pam_access.8.xml | 46 ++++++++++++------ - modules/pam_access/pam_access.c | 72 +++++++++++++++++++++++++++- - 3 files changed, 105 insertions(+), 17 deletions(-) - -diff --git a/modules/pam_access/access.conf.5.xml b/modules/pam_access/access.conf.5.xml -index 0b93db00e..10b8ba925 100644 ---- a/modules/pam_access/access.conf.5.xml -+++ b/modules/pam_access/access.conf.5.xml -@@ -233,6 +233,10 @@ - An IPv6 link local host address must contain the interface - identifier. IPv6 link local network/netmask is not supported. - </para> -+ <para> -+ Hostnames should be written as Fully-Qualified Host Name (FQHN) to avoid -+ confusion with device names or PAM service names. -+ </para> - </refsect1> - - <refsect1 xml:id="access.conf-see_also"> -diff --git a/modules/pam_access/pam_access.8.xml b/modules/pam_access/pam_access.8.xml -index c991d7a09..71a4f7ee9 100644 ---- a/modules/pam_access/pam_access.8.xml -+++ b/modules/pam_access/pam_access.8.xml -@@ -22,11 +22,14 @@ - <arg choice="opt" rep="norepeat"> - debug - </arg> -+ <arg choice="opt" rep="norepeat"> -+ noaudit -+ </arg> - <arg choice="opt" rep="norepeat"> - nodefgroup - </arg> - <arg choice="opt" rep="norepeat"> -- noaudit -+ nodns - </arg> - <arg choice="opt" rep="norepeat"> - quiet_log -@@ -132,6 +135,33 @@ - </listitem> - </varlistentry> - -+ <varlistentry> -+ <term> -+ nodefgroup -+ </term> -+ <listitem> -+ <para> -+ User tokens which are not enclosed in parentheses will not be -+ matched against the group database. The backwards compatible default is -+ to try the group database match even for tokens not enclosed -+ in parentheses. -+ </para> -+ </listitem> -+ </varlistentry> -+ -+ <varlistentry> -+ <term> -+ nodns -+ </term> -+ <listitem> -+ <para> -+ Do not try to resolve tokens as hostnames, only IPv4 and IPv6 -+ addresses will be resolved. Which means to allow login from a -+ remote host, the IP addresses need to be specified in <filename>access.conf</filename>. -+ </para> -+ </listitem> -+ </varlistentry> -+ - <varlistentry> - <term> - quiet_log -@@ -185,20 +215,6 @@ - </listitem> - </varlistentry> - -- <varlistentry> -- <term> -- nodefgroup -- </term> -- <listitem> -- <para> -- User tokens which are not enclosed in parentheses will not be -- matched against the group database. The backwards compatible default is -- to try the group database match even for tokens not enclosed -- in parentheses. -- </para> -- </listitem> -- </varlistentry> -- - </variablelist> - </refsect1> - -diff --git a/modules/pam_access/pam_access.c b/modules/pam_access/pam_access.c -index 48e7c7e97..109115e9c 100644 ---- a/modules/pam_access/pam_access.c -+++ b/modules/pam_access/pam_access.c -@@ -100,6 +100,7 @@ struct login_info { - int only_new_group_syntax; /* Only allow group entries of the form "(xyz)" */ - int noaudit; /* Do not audit denials */ - int quiet_log; /* Do not log denials */ -+ int nodns; /* Do not try to resolve tokens as hostnames */ - const char *fs; /* field separator */ - const char *sep; /* list-element separator */ - int from_remote_host; /* If PAM_RHOST was used for from */ -@@ -154,6 +155,8 @@ parse_args(pam_handle_t *pamh, struct login_info *loginfo, - loginfo->noaudit = YES; - } else if (strcmp (argv[i], "quiet_log") == 0) { - loginfo->quiet_log = YES; -+ } else if (strcmp (argv[i], "nodns") == 0) { -+ loginfo->nodns = YES; - } else { - pam_syslog(pamh, LOG_ERR, "unrecognized option [%s]", argv[i]); - } -@@ -820,7 +823,7 @@ remote_match (pam_handle_t *pamh, char *tok, struct login_info *item) - if ((str_len = strlen(string)) > tok_len - && strcasecmp(tok, string + str_len - tok_len) == 0) - return YES; -- } else if (tok[tok_len - 1] == '.') { /* internet network numbers (end with ".") */ -+ } else if (tok[tok_len - 1] == '.') { /* internet network numbers/subnet (end with ".") */ - struct addrinfo hint; - - memset (&hint, '\0', sizeof (hint)); -@@ -895,6 +898,39 @@ string_match (pam_handle_t *pamh, const char *tok, const char *string, - } - - -+static int -+is_device (pam_handle_t *pamh, const char *tok) -+{ -+ struct stat st; -+ const char *dev = "/dev/"; -+ char *devname; -+ -+ devname = malloc (strlen(dev) + strlen (tok) + 1); -+ if (devname == NULL) { -+ pam_syslog(pamh, LOG_ERR, "Cannot allocate memory for device name: %m"); -+ /* -+ * We should return an error and abort, but pam_access has no good -+ * error handling. -+ */ -+ return NO; -+ } -+ -+ char *cp = stpcpy (devname, dev); -+ strcpy (cp, tok); -+ -+ if (lstat(devname, &st) != 0) -+ { -+ free (devname); -+ return NO; -+ } -+ free (devname); -+ -+ if (S_ISCHR(st.st_mode)) -+ return YES; -+ -+ return NO; -+} -+ - /* network_netmask_match - match a string against one token - * where string is a hostname or ip (v4,v6) address and tok - * represents either a hostname, a single ip (v4,v6) address -@@ -956,10 +992,42 @@ network_netmask_match (pam_handle_t *pamh, - return NO; - } - } -+ else if (isipaddr(tok, NULL, NULL) == YES) -+ { -+ if (getaddrinfo (tok, NULL, NULL, &ai) != 0) -+ { -+ if (item->debug) -+ pam_syslog(pamh, LOG_DEBUG, "cannot resolve IP address \"%s\"", tok); -+ -+ return NO; -+ } -+ netmask_ptr = NULL; -+ } -+ else if (item->nodns) -+ { -+ /* Only hostnames are left, which we would need to resolve via DNS */ -+ return NO; -+ } - else - { -+ /* Bail out on X11 Display entries and ttys. */ -+ if (tok[0] == ':') -+ { -+ if (item->debug) -+ pam_syslog (pamh, LOG_DEBUG, -+ "network_netmask_match: tok=%s is X11 display", tok); -+ return NO; -+ } -+ if (is_device (pamh, tok)) -+ { -+ if (item->debug) -+ pam_syslog (pamh, LOG_DEBUG, -+ "network_netmask_match: tok=%s is a TTY", tok); -+ return NO; -+ } -+ - /* -- * It is either an IP address or a hostname. -+ * It is most likely a hostname. - * Let getaddrinfo sort everything out - */ - if (getaddrinfo (tok, NULL, NULL, &ai) != 0)package/linux-pam/linux-pam.hash +3
-3@@ -1,6 +1,6 @@ # Locally computed hashes after checking signature at -# https://github.com/linux-pam/linux-pam/releases/download/v1.6.1/Linux-PAM-1.6.1.tar.xz.asc -# signed with the key 8C6BFD92EE0F42EDF91A6A736D1A7F052E5924BB -sha256 f8923c740159052d719dbfc2a2f81942d68dd34fcaf61c706a02c9b80feeef8e Linux-PAM-1.6.1.tar.xz +# https://github.com/linux-pam/linux-pam/releases/download/v1.7.2/Linux-PAM-1.7.2.tar.xz.asc +# signed with the key 7BECFE3AF7B280BB52FF77F104BA4521C996DDE1 +sha256 3d86b6383fb5fd9eb9578d2cd47d92801191f4bf3f9bc61419bfefc8aa1e531a Linux-PAM-1.7.2.tar.xz # Locally computed sha256 133d98e7a2ab3ffd330b4debb0bfc10fea21e4b2b5a5b09de2e924293be5ff08 Copyrightpackage/linux-pam/linux-pam.mk +14
-18@@ -4,18 +4,15 @@ # ################################################################################ -LINUX_PAM_VERSION = 1.6.1 +LINUX_PAM_VERSION = 1.7.2 LINUX_PAM_SOURCE = Linux-PAM-$(LINUX_PAM_VERSION).tar.xz LINUX_PAM_SITE = https://github.com/linux-pam/linux-pam/releases/download/v$(LINUX_PAM_VERSION) LINUX_PAM_INSTALL_STAGING = YES LINUX_PAM_CONF_OPTS = \ - --disable-prelude \ - --disable-isadir \ - --disable-nis \ - --disable-db \ - --disable-regenerate-docu \ - --enable-securedir=/lib/security \ - --libdir=/lib + -Disadir=disabled \ + -Dnis=disabled \ + -Dpam_userdb=disabled \ + -Ddocs=disabled LINUX_PAM_DEPENDENCIES = host-flex host-pkgconf \ $(if $(BR2_PACKAGE_LIBXCRYPT),libxcrypt) \ $(TARGET_NLS_DEPENDENCIES)@@ -24,45 +21,44 @@ LINUX_PAM_LICENSE_FILES = Copyright LINUX_PAM_LIBS = $(TARGET_NLS_LIBS) LINUX_PAM_MAKE_OPTS += LIBS="$(LINUX_PAM_LIBS)" LINUX_PAM_CPE_ID_VENDOR = linux-pam -LINUX_PAM_IGNORE_CVES += CVE-2024-10963 ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y) LINUX_PAM_LIBS += -latomic endif ifeq ($(BR2_PACKAGE_LIBSELINUX),y) -LINUX_PAM_CONF_OPTS += --enable-selinux +LINUX_PAM_CONF_OPTS += -Dselinux=enabled LINUX_PAM_DEPENDENCIES += libselinux define LINUX_PAM_SELINUX_PAMFILE_TWEAK $(SED) 's/^# \(.*pam_selinux.so.*\)$$/\1/' \ $(TARGET_DIR)/etc/pam.d/login endef else -LINUX_PAM_CONF_OPTS += --disable-selinux +LINUX_PAM_CONF_OPTS += -Dselinux=disabled endif ifeq ($(BR2_PACKAGE_AUDIT),y) -LINUX_PAM_CONF_OPTS += --enable-audit +LINUX_PAM_CONF_OPTS += -Daudit=enabled LINUX_PAM_DEPENDENCIES += audit else -LINUX_PAM_CONF_OPTS += --disable-audit +LINUX_PAM_CONF_OPTS += -Daudit=disabled endif ifeq ($(BR2_PACKAGE_OPENSSL),y) -LINUX_PAM_CONF_OPTS += --enable-openssl +LINUX_PAM_CONF_OPTS += -Dopenssl=enabled LINUX_PAM_DEPENDENCIES += openssl else -LINUX_PAM_CONF_OPTS += --disable-openssl +LINUX_PAM_CONF_OPTS += -Dopenssl=disabled endif ifeq ($(BR2_PACKAGE_LINUX_PAM_LASTLOG),y) -LINUX_PAM_CONF_OPTS += --enable-lastlog +LINUX_PAM_CONF_OPTS += -Dpam_lastlog=enabled define LINUX_PAM_LASTLOG_PAMFILE_TWEAK $(SED) 's/^# \(.*pam_lastlog.so.*\)$$/\1/' \ $(TARGET_DIR)/etc/pam.d/login endef else -LINUX_PAM_CONF_OPTS += --disable-lastlog +LINUX_PAM_CONF_OPTS += -Dpam_lastlog=disabled endif # Install default pam config (deny everything except login)@@ -77,4 +73,4 @@ endef LINUX_PAM_POST_INSTALL_TARGET_HOOKS += LINUX_PAM_INSTALL_CONFIG -$(eval $(autotools-package)) +$(eval $(meson-package))Signature · 6 lines
2.52.0 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH 3/3 package/linux-pam: install files into /usr/lib/pam.d
In reply to Raphael PavlidisThe /etc directory is reserved for host-specific, system-wide configuration maintained by the local administrator. Buildroot packages should avoid placing files in /etc and instead install them under /usr whenever possible.
--- package/linux-pam/linux-pam.mk | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
package/linux-pam/linux-pam.mk +6 -6
@@ -31,7 +31,7 @@ LINUX_PAM_CONF_OPTS += -Dselinux=enabled LINUX_PAM_DEPENDENCIES += libselinux define LINUX_PAM_SELINUX_PAMFILE_TWEAK $(SED) 's/^# \(.*pam_selinux.so.*\)$$/\1/' \ - $(TARGET_DIR)/etc/pam.d/login + $(TARGET_DIR)/usr/lib/pam.d/login endef else LINUX_PAM_CONF_OPTS += -Dselinux=disabled
@@ -55,7 +55,7 @@ ifeq ($(BR2_PACKAGE_LINUX_PAM_LASTLOG),y) LINUX_PAM_CONF_OPTS += -Dpam_lastlog=enabled define LINUX_PAM_LASTLOG_PAMFILE_TWEAK $(SED) 's/^# \(.*pam_lastlog.so.*\)$$/\1/' \ - $(TARGET_DIR)/etc/pam.d/login + $(TARGET_DIR)/usr/lib/pam.d/login endef else LINUX_PAM_CONF_OPTS += -Dpam_lastlog=disabled
@@ -63,10 +63,10 @@ endif # Install default pam config (deny everything except login) define LINUX_PAM_INSTALL_CONFIG - $(INSTALL) -m 0644 -D package/linux-pam/login.pam \ - $(TARGET_DIR)/etc/pam.d/login - $(INSTALL) -m 0644 -D package/linux-pam/other.pam \ - $(TARGET_DIR)/etc/pam.d/other + $(INSTALL) -m 0644 -D $(LINUX_PAM_PKGDIR)/login.pam \ + $(TARGET_DIR)/usr/lib/pam.d/login + $(INSTALL) -m 0644 -D $(LINUX_PAM_PKGDIR)/other.pam \ + $(TARGET_DIR)/usr/lib/pam.d/other $(LINUX_PAM_LASTLOG_PAMFILE_TWEAK) $(LINUX_PAM_SELINUX_PAMFILE_TWEAK) endef
Signature · 6 lines
2.52.0 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Marcus Hoffmann via buildroot
AppliedRe: [Buildroot] [PATCH v1 3/3] package/linux-pam: install files into /usr/lib/pam.d
Hi Raphael,
Quoted 7 lines · Raphael Pavlidis
The /etc directory is reserved for host-specific, system-wide configuration maintained by the local administrator. Buildroot packages should avoid placing files in /etc and instead install them under /usr whenever possible.
Signed-off-by Raphael Pavlidis <[email protected]>---
Applied to master, thanks.
It would be really good to have a runtime test[1] for pam, as otherwise these kind of changes always seem kind of risky to apply. Do you think you could maybe contribute one?
Best,
Marcus
[1] https://nightly.buildroot.org/manual.html#_using_the_runtime_tests_framework
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Hi Raphael,
Quoted 3 lines · Raphael Pavlidis
See:
https://github.com/linux-pam/linux-pam/issues/834Signed-off-by Raphael Pavlidis <[email protected]>
I applied this patch only on master, thanks. For info, I slightly reworked it. I fixed few check-package errors, and added extra information, to help the LTS maintainers. See:
https://gitlab.com/buildroot.org/buildroot/-/commit/b95ffe208b087699d923f048ae8e29bffb587b1f
The rest of the series is a somewhat large, non-trivial bump. So I prefer to keep it for the next release development cycle.
Best regards,
Julien.
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Hi Julien,
Thanks for applying.
Best regards,
Raphael.
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Thomas Perale via buildroot
AppliedIn reply of:
Quoted 3 lines
See:
https://github.com/linux-pam/linux-pam/issues/834Signed-off-by Raphael Pavlidis <[email protected]>
Applied to 2025.02.x & 2025.11.x. Thanks
Quoted 253 lines
--- ...work-resolving-of-tokens-as-hostname.patch | 222 ++++++++++++++++++ package/linux-pam/linux-pam.mk | 1 + 2 files changed, 223 insertions(+) create mode 100644 package/linux-pam/0002-pam_access-rework-resolving-of-tokens-as-hostname.patchpackage/linux-pam/0002-pam_access-rework-resolving-of-tokens-as-hostname.patch new file +222
-0@@ -0,0 +1,222 @@ +From 940747f88c16e029b69a74e80a2e94f65cb3e628 Mon Sep 17 00:00:00 2001 +From: Thorsten Kukuk <[email protected]> +Date: Thu, 14 Nov 2024 10:27:28 +0100 +Subject: [PATCH] pam_access: rework resolving of tokens as hostname + +* modules/pam_access/pam_access.c: separate resolving of IP addresses + from hostnames. Don't resolve TTYs or display variables as hostname + (#834). + Add "nodns" option to disallow resolving of tokens as hostname. +* modules/pam_access/pam_access.8.xml: document nodns option +* modules/pam_access/access.conf.5.xml: document that hostnames should + be written as FQHN. +--- + modules/pam_access/access.conf.5.xml | 4 ++ + modules/pam_access/pam_access.8.xml | 46 ++++++++++++------ + modules/pam_access/pam_access.c | 72 +++++++++++++++++++++++++++- + 3 files changed, 105 insertions(+), 17 deletions(-) + +diff --git a/modules/pam_access/access.conf.5.xml b/modules/pam_access/access.conf.5.xml +index 0b93db00e..10b8ba925 100644 +--- a/modules/pam_access/access.conf.5.xml ++++ b/modules/pam_access/access.conf.5.xml +@@ -233,6 +233,10 @@ + An IPv6 link local host address must contain the interface + identifier. IPv6 link local network/netmask is not supported. + </para> ++ <para> ++ Hostnames should be written as Fully-Qualified Host Name (FQHN) to avoid ++ confusion with device names or PAM service names. ++ </para> + </refsect1> + + <refsect1 xml:id="access.conf-see_also"> +diff --git a/modules/pam_access/pam_access.8.xml b/modules/pam_access/pam_access.8.xml +index c991d7a09..71a4f7ee9 100644 +--- a/modules/pam_access/pam_access.8.xml ++++ b/modules/pam_access/pam_access.8.xml +@@ -22,11 +22,14 @@ + <arg choice="opt" rep="norepeat"> + debug + </arg> ++ <arg choice="opt" rep="norepeat"> ++ noaudit ++ </arg> + <arg choice="opt" rep="norepeat"> + nodefgroup + </arg> + <arg choice="opt" rep="norepeat"> +- noaudit ++ nodns + </arg> + <arg choice="opt" rep="norepeat"> + quiet_log +@@ -132,6 +135,33 @@ + </listitem> + </varlistentry> + ++ <varlistentry> ++ <term> ++ nodefgroup ++ </term> ++ <listitem> ++ <para> ++ User tokens which are not enclosed in parentheses will not be ++ matched against the group database. The backwards compatible default is ++ to try the group database match even for tokens not enclosed ++ in parentheses. ++ </para> ++ </listitem> ++ </varlistentry> ++ ++ <varlistentry> ++ <term> ++ nodns ++ </term> ++ <listitem> ++ <para> ++ Do not try to resolve tokens as hostnames, only IPv4 and IPv6 ++ addresses will be resolved. Which means to allow login from a ++ remote host, the IP addresses need to be specified in <filename>access.conf</filename>. ++ </para> ++ </listitem> ++ </varlistentry> ++ + <varlistentry> + <term> + quiet_log +@@ -185,20 +215,6 @@ + </listitem> + </varlistentry> + +- <varlistentry> +- <term> +- nodefgroup +- </term> +- <listitem> +- <para> +- User tokens which are not enclosed in parentheses will not be +- matched against the group database. The backwards compatible default is +- to try the group database match even for tokens not enclosed +- in parentheses. +- </para> +- </listitem> +- </varlistentry> +- + </variablelist> + </refsect1> + +diff --git a/modules/pam_access/pam_access.c b/modules/pam_access/pam_access.c +index 48e7c7e97..109115e9c 100644 +--- a/modules/pam_access/pam_access.c ++++ b/modules/pam_access/pam_access.c +@@ -100,6 +100,7 @@ struct login_info { + int only_new_group_syntax; /* Only allow group entries of the form "(xyz)" */ + int noaudit; /* Do not audit denials */ + int quiet_log; /* Do not log denials */ ++ int nodns; /* Do not try to resolve tokens as hostnames */ + const char *fs; /* field separator */ + const char *sep; /* list-element separator */ + int from_remote_host; /* If PAM_RHOST was used for from */ +@@ -154,6 +155,8 @@ parse_args(pam_handle_t *pamh, struct login_info *loginfo, + loginfo->noaudit = YES; + } else if (strcmp (argv[i], "quiet_log") == 0) { + loginfo->quiet_log = YES; ++ } else if (strcmp (argv[i], "nodns") == 0) { ++ loginfo->nodns = YES; + } else { + pam_syslog(pamh, LOG_ERR, "unrecognized option [%s]", argv[i]); + } +@@ -820,7 +823,7 @@ remote_match (pam_handle_t *pamh, char *tok, struct login_info *item) + if ((str_len = strlen(string)) > tok_len + && strcasecmp(tok, string + str_len - tok_len) == 0) + return YES; +- } else if (tok[tok_len - 1] == '.') { /* internet network numbers (end with ".") */ ++ } else if (tok[tok_len - 1] == '.') { /* internet network numbers/subnet (end with ".") */ + struct addrinfo hint; + + memset (&hint, '\0', sizeof (hint)); +@@ -895,6 +898,39 @@ string_match (pam_handle_t *pamh, const char *tok, const char *string, + } + + ++static int ++is_device (pam_handle_t *pamh, const char *tok) ++{ ++ struct stat st; ++ const char *dev = "/dev/"; ++ char *devname; ++ ++ devname = malloc (strlen(dev) + strlen (tok) + 1); ++ if (devname == NULL) { ++ pam_syslog(pamh, LOG_ERR, "Cannot allocate memory for device name: %m"); ++ /* ++ * We should return an error and abort, but pam_access has no good ++ * error handling. ++ */ ++ return NO; ++ } ++ ++ char *cp = stpcpy (devname, dev); ++ strcpy (cp, tok); ++ ++ if (lstat(devname, &st) != 0) ++ { ++ free (devname); ++ return NO; ++ } ++ free (devname); ++ ++ if (S_ISCHR(st.st_mode)) ++ return YES; ++ ++ return NO; ++} ++ + /* network_netmask_match - match a string against one token + * where string is a hostname or ip (v4,v6) address and tok + * represents either a hostname, a single ip (v4,v6) address +@@ -956,10 +992,42 @@ network_netmask_match (pam_handle_t *pamh, + return NO; + } + } ++ else if (isipaddr(tok, NULL, NULL) == YES) ++ { ++ if (getaddrinfo (tok, NULL, NULL, &ai) != 0) ++ { ++ if (item->debug) ++ pam_syslog(pamh, LOG_DEBUG, "cannot resolve IP address \"%s\"", tok); ++ ++ return NO; ++ } ++ netmask_ptr = NULL; ++ } ++ else if (item->nodns) ++ { ++ /* Only hostnames are left, which we would need to resolve via DNS */ ++ return NO; ++ } + else + { ++ /* Bail out on X11 Display entries and ttys. */ ++ if (tok[0] == ':') ++ { ++ if (item->debug) ++ pam_syslog (pamh, LOG_DEBUG, ++ "network_netmask_match: tok=%s is X11 display", tok); ++ return NO; ++ } ++ if (is_device (pamh, tok)) ++ { ++ if (item->debug) ++ pam_syslog (pamh, LOG_DEBUG, ++ "network_netmask_match: tok=%s is a TTY", tok); ++ return NO; ++ } ++ + /* +- * It is either an IP address or a hostname. ++ * It is most likely a hostname. + * Let getaddrinfo sort everything out + */ + if (getaddrinfo (tok, NULL, NULL, &ai) != 0)package/linux-pam/linux-pam.mk +1
-0@@ -24,6 +24,7 @@ LINUX_PAM_LICENSE_FILES = Copyright LINUX_PAM_LIBS = $(TARGET_NLS_LIBS) LINUX_PAM_MAKE_OPTS += LIBS="$(LINUX_PAM_LIBS)" LINUX_PAM_CPE_ID_VENDOR = linux-pam +LINUX_PAM_IGNORE_CVES += CVE-2024-10963 ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y) LINUX_PAM_LIBS += -latomicSignature · 6 lines
2.52.0 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot