diff --git a/SPECS/polkit/CVE-2026-4897.patch b/SPECS/polkit/CVE-2026-4897.patch new file mode 100644 index 00000000000..71ed529e520 --- /dev/null +++ b/SPECS/polkit/CVE-2026-4897.patch @@ -0,0 +1,65 @@ +From e133f7aa4a15dfeda0c1105192b47c36ccbdc15e Mon Sep 17 00:00:00 2001 +From: Jan Rybar +Date: Fri, 27 Mar 2026 15:57:01 +0100 +Subject: [PATCH] CVE-2026-4897 - getline() string overflow + +Report and fix by Aisle.com +Pavel Kohout, Aisle Research + +Signed-off-by: Jan Rybar jrybar@redhat.com +Signed-off-by: Azure Linux Security Servicing Account +Upstream-reference: https://github.com/polkit-org/polkit/commit/7e122c8a5120c2aae2d9d44a26796dc18f5b677c.patch +--- + src/polkitagent/polkitagenthelperprivate.c | 23 +++++++++++++--------- + 1 file changed, 14 insertions(+), 9 deletions(-) + +diff --git a/src/polkitagent/polkitagenthelperprivate.c b/src/polkitagent/polkitagenthelperprivate.c +index 1f32c0a..63333f6 100644 +--- a/src/polkitagent/polkitagenthelperprivate.c ++++ b/src/polkitagent/polkitagenthelperprivate.c +@@ -25,6 +25,7 @@ + #include + #include + #include ++#include + #include + + #ifndef HAVE_CLEARENV +@@ -60,21 +61,25 @@ read_cookie (int argc, char **argv) + return strdup (argv[2]); + else + { +- char *ret = NULL; +- size_t n = 0; +- ssize_t r = getline (&ret, &n, stdin); +- if (r == -1) ++ #define POLKIT_AGENT_MAX_COOKIE 4096 ++ char buf[POLKIT_AGENT_MAX_COOKIE + 2]; /* +1 for newline, +1 for NUL */ ++ if (fgets (buf, sizeof(buf), stdin) == NULL) + { + if (!feof (stdin)) +- perror ("getline"); +- free (ret); ++ perror ("fgets"); + return NULL; + } +- else ++ if (buf[strlen (buf) - 1] != '\n') + { +- g_strchomp (ret); +- return ret; ++ /* Cookie too long - drain remaining input and reject */ ++ int c; ++ while ((c = getchar ()) != '\n' && c != EOF) ++ ; ++ errno = EOVERFLOW; ++ return NULL; + } ++ g_strchomp (buf); ++ return strdup (buf); + } + } + +-- +2.45.4 + diff --git a/SPECS/polkit/polkit.spec b/SPECS/polkit/polkit.spec index 87865a0be4a..43581478ba4 100644 --- a/SPECS/polkit/polkit.spec +++ b/SPECS/polkit/polkit.spec @@ -1,7 +1,7 @@ Summary: A toolkit for defining and handling authorizations. Name: polkit Version: 0.119 -Release: 4%{?dist} +Release: 5%{?dist} Group: Applications/System Vendor: Microsoft Corporation License: GPLv2+ @@ -9,6 +9,7 @@ URL: https://www.freedesktop.org/software/polkit/docs/latest/polki Source0: https://www.freedesktop.org/software/polkit/releases/%{name}-%{version}.tar.gz Patch0: CVE-2021-4034.patch Patch1: CVE-2025-7519.patch +Patch2: CVE-2026-4897.patch Distribution: Mariner BuildRequires: autoconf BuildRequires: expat-devel @@ -112,6 +113,9 @@ fi %{_libdir}/pkgconfig/*.pc %changelog +* Thu Apr 02 2026 Azure Linux Security Servicing Account - 0.119-5 +- Patch for CVE-2026-4897 + * Thu Jul 17 2025 Azure Linux Security Servicing Account - 0.119-4 - Patch for CVE-2025-7519