diff --git a/1001-fix-CVE-2024-22365.patch b/1001-fix-CVE-2024-22365.patch new file mode 100644 index 0000000000000000000000000000000000000000..33c799cba444ae8de27d77e1337960695903c187 --- /dev/null +++ b/1001-fix-CVE-2024-22365.patch @@ -0,0 +1,48 @@ +From e63ed9e8b085e24062cdaffa1a304bc424128294 Mon Sep 17 00:00:00 2001 +From: Chunmei Xu +Date: Mon, 3 Jun 2024 11:56:35 +0800 +Subject: [PATCH 1/1] fix CVE-2024-22365 + +--- + 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 f34ce93..ef85644 100644 +--- a/modules/pam_namespace/pam_namespace.c ++++ b/modules/pam_namespace/pam_namespace.c +@@ -1194,7 +1194,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; + +@@ -1248,22 +1248,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) { +-- +2.41.0 + diff --git a/pam.spec b/pam.spec index 53429afdf5cbee39477152dec73da9942e3c77a9..f8a097c41a0dd0a3fa4f60faed4ad0f923569467 100644 --- a/pam.spec +++ b/pam.spec @@ -1,4 +1,4 @@ -%define anolis_release 1 +%define anolis_release 2 %global soname_version 0 Name: pam @@ -9,10 +9,10 @@ Summary: A Security Interface for Applications in Authentication activiti License: GPL-2.0-or-later OR BSD-3-Clause Group: System/Libraries URL: http://www.linux-pam.org/ -Source0: Linux-PAM-%{version}.tar.xz -Source1: Linux-PAM-%{version}.tar.xz.asc -Source2: Linux-PAM-%{version}-docs.tar.xz -Source3: Linux-PAM-%{version}-docs.tar.xz.asc +Source0: https://github.com/linux-pam/linux-pam/releases/download/v%{version}/Linux-PAM-%{version}.tar.xz +Source1: https://github.com/linux-pam/linux-pam/releases/download/v%{version}/Linux-PAM-%{version}.tar.xz.asc +Source2: https://github.com/linux-pam/linux-pam/releases/download/v%{version}/Linux-PAM-%{version}-docs.tar.xz +Source3: https://github.com/linux-pam/linux-pam/releases/download/v%{version}/Linux-PAM-%{version}-docs.tar.xz.asc Source4: gpl-2.0.txt Source5: macros.%{name} #config files @@ -29,6 +29,7 @@ Source102: postlogin.5 Patch1: 0001-Fix-pam-1.1.8-faillock-system-time-issue.patch Patch2: 0001-change-ndbm-to-gdbm.patch Patch3: 0001-add-sm3-crypt-support.patch +Patch4: 1001-fix-CVE-2024-22365.patch BuildRequires: audit-libs-devel BuildRequires: autoconf @@ -343,6 +344,9 @@ done %{abidir}/libpam*.dump %changelog +* Mon Jun 03 2024 mgb01105731 - 1.5.3-2 +- fix CVE-2024-22365 + * Wed Mar 13 2024 doupengda - 1.5.3-1 - Update to version 1.5.3