Skip to content

Commit

Permalink
polkit: fix CVE-2021-3560
Browse files Browse the repository at this point in the history
Backport a patch [1] to fix CVE-2021-3560.

[1] https://gitlab.freedesktop.org/polkit/polkit/-/commit/a04d13affe0fa53ff618e07aa8f57f4c0e3b9b81

Signed-off-by: Mingli Yu <[email protected]>
Signed-off-by: Khem Raj <[email protected]>

Squashed together 6000f5a3b and 7f4f1ee71
Signed-off-by: Ralph Siemsen <[email protected]>
Signed-off-by: Armin Kuster <[email protected]>
  • Loading branch information
Mingli Yu authored and akuster committed Mar 27, 2022
1 parent 0940e1e commit 17e931e
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
33 changes: 33 additions & 0 deletions meta-oe/recipes-extended/polkit/polkit/CVE-2021-3560.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
From a04d13affe0fa53ff618e07aa8f57f4c0e3b9b81 Mon Sep 17 00:00:00 2001
From: Jan Rybar <[email protected]>
Date: Wed, 2 Jun 2021 15:43:38 +0200
Subject: [PATCH] GHSL-2021-074: authentication bypass vulnerability in polkit

initial values returned if error caught

CVE: CVE-2021-3560

Upstream-Status: Backport [https://gitlab.freedesktop.org/polkit/polkit/-/commit/a04d13affe0fa53ff618e07aa8f57f4c0e3b9b81]

Signed-off-by: Mingli Yu <[email protected]>
---
src/polkit/polkitsystembusname.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/src/polkit/polkitsystembusname.c b/src/polkit/polkitsystembusname.c
index 8daa12c..8ed1363 100644
--- a/src/polkit/polkitsystembusname.c
+++ b/src/polkit/polkitsystembusname.c
@@ -435,6 +435,9 @@ polkit_system_bus_name_get_creds_sync (PolkitSystemBusName *system_bus
while (!((data.retrieved_uid && data.retrieved_pid) || data.caught_error))
g_main_context_iteration (tmp_context, TRUE);

+ if (data.caught_error)
+ goto out;
+
if (out_uid)
*out_uid = data.uid;
if (out_pid)
--
2.29.2

1 change: 1 addition & 0 deletions meta-oe/recipes-extended/polkit/polkit_0.116.bb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ PAM_SRC_URI = "file://polkit-1_pam.patch"
SRC_URI = "http://www.freedesktop.org/software/polkit/releases/polkit-${PV}.tar.gz \
${@bb.utils.contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)} \
file://0003-make-netgroup-support-optional.patch \
file://CVE-2021-3560.patch \
file://CVE-2021-4034.patch \
file://0001-GHSL-2021-074-authentication-bypass-vulnerability-in.patch \
file://CVE-2021-4115.patch \
Expand Down

0 comments on commit 17e931e

Please sign in to comment.