summaryrefslogtreecommitdiff
path: root/meta-openbmc-mods/meta-common/recipes-extended/pam
diff options
context:
space:
mode:
authordheerajpdsk <p.dheeraj.srujan.kumar@intel.com>2024-08-13 18:57:11 +0300
committerGitHub <noreply@github.com>2024-08-13 18:57:11 +0300
commit2bd6e77fe603cc9ddd4b1ef5421282487bb7a7d3 (patch)
tree0b18a326840e661d88333ec9aee349709f3596c1 /meta-openbmc-mods/meta-common/recipes-extended/pam
parentac27a5095790a2d49a44d7c46440e375a8f84812 (diff)
parent848b831c34ae28e7b8132834656ad59dc6b51a87 (diff)
downloadopenbmc-1-release.tar.xz
Merge pull request #131 from Intel-BMC/update1-1.201-release
Update to internal 1-1.20
Diffstat (limited to 'meta-openbmc-mods/meta-common/recipes-extended/pam')
-rw-r--r--meta-openbmc-mods/meta-common/recipes-extended/pam/libpam/CVE-2024-22365.patch55
-rw-r--r--meta-openbmc-mods/meta-common/recipes-extended/pam/libpam_1.5.2.bb1
2 files changed, 56 insertions, 0 deletions
diff --git a/meta-openbmc-mods/meta-common/recipes-extended/pam/libpam/CVE-2024-22365.patch b/meta-openbmc-mods/meta-common/recipes-extended/pam/libpam/CVE-2024-22365.patch
new file mode 100644
index 000000000..781101372
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/recipes-extended/pam/libpam/CVE-2024-22365.patch
@@ -0,0 +1,55 @@
+From 031bb5a5d0d950253b68138b498dc93be69a64cb Mon Sep 17 00:00:00 2001
+From: Matthias Gerstner <matthias.gerstner@suse.de>
+Date: Wed, 27 Dec 2023 14:01:59 +0100
+Subject: [PATCH] pam_namespace: protect_dir(): use O_DIRECTORY to prevent
+ local DoS situations
+
+Without O_DIRECTORY the path crawling logic is subject to e.g. FIFOs
+being placed in user controlled directories, causing the PAM module to
+block indefinitely during `openat()`.
+
+Pass O_DIRECTORY to cause the `openat()` to fail if the path does not
+refer to a directory.
+
+With this the check whether the final path element is a directory
+becomes unnecessary, drop it.
+---
+ modules/pam_namespace/pam_namespace.c | 18 +-----------------
+ 1 file changed, 1 insertion(+), 17 deletions(-)
+
+diff --git a/modules/pam_namespace/pam_namespace.c b/modules/pam_namespace/pam_namespace.c
+index 2528cff86..f72d67189 100644
+--- a/modules/pam_namespace/pam_namespace.c
++++ b/modules/pam_namespace/pam_namespace.c
+@@ -1201,7 +1201,7 @@ static int protect_dir(const char *path, mode_t mode, int do_mkdir,
+ int dfd = AT_FDCWD;
+ int dfd_next;
+ int save_errno;
+- int flags = O_RDONLY;
++ int flags = O_RDONLY | O_DIRECTORY;
+ int rv = -1;
+ struct stat st;
+
+@@ -1255,22 +1255,6 @@ static int protect_dir(const char *path, mode_t mode, int do_mkdir,
+ rv = openat(dfd, dir, flags);
+ }
+
+- if (rv != -1) {
+- if (fstat(rv, &st) != 0) {
+- save_errno = errno;
+- close(rv);
+- rv = -1;
+- errno = save_errno;
+- goto error;
+- }
+- if (!S_ISDIR(st.st_mode)) {
+- close(rv);
+- errno = ENOTDIR;
+- rv = -1;
+- goto error;
+- }
+- }
+-
+ if (flags & O_NOFOLLOW) {
+ /* we are inside user-owned dir - protect */
+ if (protect_mount(rv, p, idata) == -1) {
diff --git a/meta-openbmc-mods/meta-common/recipes-extended/pam/libpam_1.5.2.bb b/meta-openbmc-mods/meta-common/recipes-extended/pam/libpam_1.5.2.bb
index 5197f1813..74a9c8579 100644
--- a/meta-openbmc-mods/meta-common/recipes-extended/pam/libpam_1.5.2.bb
+++ b/meta-openbmc-mods/meta-common/recipes-extended/pam/libpam_1.5.2.bb
@@ -25,6 +25,7 @@ SRC_URI = "${GITHUB_BASE_URI}/download/v${PV}/Linux-PAM-${PV}.tar.xz \
file://run-ptest \
file://pam-volatiles.conf \
file://CVE-2022-28321-0002.patch \
+ file://CVE-2024-22365.patch \
"
SRC_URI[sha256sum] = "e4ec7131a91da44512574268f493c6d8ca105c87091691b8e9b56ca685d4f94d"