Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 833574 (CVE-2021-4115, GHSL-2021-077) - <sys-auth/polkit-0.120-r3: local denial of service
Summary: <sys-auth/polkit-0.120-r3: local denial of service
Status: RESOLVED FIXED
Alias: CVE-2021-4115, GHSL-2021-077
Product: Gentoo Security
Classification: Unclassified
Component: Vulnerabilities (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Security
URL: https://securitylab.github.com/adviso...
Whiteboard: A3 [glsa?]
Keywords: PullRequest
Depends on: 833867
Blocks:
  Show dependency tree
 
Reported: 2022-02-17 22:23 UTC by John Helmert III
Modified: 2022-05-16 01:50 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Helmert III archtester Gentoo Infrastructure gentoo-dev Security 2022-02-17 22:23:00 UTC
"Issue 1: File descriptor exhaustion in polkit (GHSL-2021-077)

The function polkit_system_bus_name_get_creds_sync is used to get the uid and pid of the process requesting the action. It does this by sending the unique bus name of the requesting process, which is typically something like “:1.96”, to dbus-daemon, in two consecutive D-Bus method calls. The same callback function, on_retrieved_unix_uid_pid, is used to handle both replies. The replies are handled during the while-loop on line 435. But notice that the loop can stop early if an error occurs. In other words, if an error occurs then the loop might stop after only one of the two replies has been received. When this happens, the refcount of tmp_context never returns to zero. This causes an eventfd file descriptor to be leaked. The file descriptor quota is usually a relatively small number, like 1024, so it is easy for a file descriptor leak like this to exhaust the quota. When this happens, polkit crashes.

Impact

This issue may lead to local denial of service, due to polkit crashing."
Comment 1 John Helmert III archtester Gentoo Infrastructure gentoo-dev Security 2022-02-19 05:14:32 UTC
Upstream issue: https://gitlab.freedesktop.org/polkit/polkit/-/issues/141
Comment 2 Larry the Git Cow gentoo-dev 2022-02-22 06:12:50 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ef7e6d556aac8790982a70acbd5d40130faa2346

commit ef7e6d556aac8790982a70acbd5d40130faa2346
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2022-02-22 06:11:04 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-02-22 06:12:35 +0000

    sys-auth/polkit: patch CVE-2021-4115
    
    - Add as patch to 0.120-r3 (new) to be immediately stabilised
    - Additionally bump to 0.120_p20220221 (only difference from
      last snapshot is a test timeout fix + this CVE-2021-4115 patch)
      but we'll hold off on stabling that given we only added the previous
      snapshot a few days ago.
    
    Bug: https://bugs.gentoo.org/833574
    Signed-off-by: Sam James <sam@gentoo.org>

 sys-auth/polkit/Manifest                           |   1 +
 .../polkit/files/polkit-0.120-CVE-2021-4115.patch  |  78 +++++++++++++
 sys-auth/polkit/polkit-0.120-r3.ebuild             | 123 ++++++++++++++++++++
 sys-auth/polkit/polkit-0.120_p20220221.ebuild      | 126 +++++++++++++++++++++
 4 files changed, 328 insertions(+)
Comment 3 Larry the Git Cow gentoo-dev 2022-03-18 06:40:33 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ae69131d4bef75f0d9e58dbb799976f7e15a7caa

commit ae69131d4bef75f0d9e58dbb799976f7e15a7caa
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2022-03-18 06:40:19 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-03-18 06:40:19 +0000

    sys-auth/polkit: drop 0.120-r2
    
    Bug: https://bugs.gentoo.org/833574
    Signed-off-by: Sam James <sam@gentoo.org>

 sys-auth/polkit/polkit-0.120-r2.ebuild | 121 ---------------------------------
 1 file changed, 121 deletions(-)
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-03-18 06:41:26 UTC
Note that cleanup not fully done as 0.117-r3 remains in tree, but we'll stable new Duktape snapshot soon.
Comment 5 Larry the Git Cow gentoo-dev 2022-05-15 22:12:00 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=76caeda5c0ae4a7045d321f32ef95e31722434dd

commit 76caeda5c0ae4a7045d321f32ef95e31722434dd
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2022-05-15 05:17:19 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-05-15 22:09:39 +0000

    sys-auth/polkit: drop 0.117-r3, 0.120-r3
    
    Bug: https://bugs.gentoo.org/794052
    Bug: https://bugs.gentoo.org/833574
    Signed-off-by: Sam James <sam@gentoo.org>

 sys-auth/polkit/Manifest                           |   2 -
 sys-auth/polkit/files/polkit-0.115-elogind.patch   |  28 ---
 .../polkit/files/polkit-0.117-CVE-2021-3560.patch  |  29 ---
 ...lkit-0.118-make-netgroup-support-optional.patch | 248 ---------------------
 .../polkit/files/polkit-0.120-CVE-2021-4034.patch  |  72 ------
 .../polkit/files/polkit-0.120-CVE-2021-4115.patch  |  78 -------
 sys-auth/polkit/metadata.xml                       |   1 -
 sys-auth/polkit/polkit-0.117-r3.ebuild             | 136 -----------
 sys-auth/polkit/polkit-0.120-r3.ebuild             | 123 ----------
 9 files changed, 717 deletions(-)