summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-extended/polkit/polkit/CVE-2018-19788_p2.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-oe/recipes-extended/polkit/polkit/CVE-2018-19788_p2.patch')
-rw-r--r--meta-oe/recipes-extended/polkit/polkit/CVE-2018-19788_p2.patch153
1 files changed, 153 insertions, 0 deletions
diff --git a/meta-oe/recipes-extended/polkit/polkit/CVE-2018-19788_p2.patch b/meta-oe/recipes-extended/polkit/polkit/CVE-2018-19788_p2.patch
new file mode 100644
index 000000000..097dfd921
--- /dev/null
+++ b/meta-oe/recipes-extended/polkit/polkit/CVE-2018-19788_p2.patch
@@ -0,0 +1,153 @@
1From 17f18d9f81d99b014c680e7e50198d7f190b804e Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
3Date: Mon, 3 Dec 2018 11:20:34 +0100
4Subject: [PATCH 2/3] tests: add tests for high uids
5
6CVE: CVE-2018-19788
7Upstream-Status: Backport
8[https://gitlab.freedesktop.org/polkit/polkit/commit/b534a10727455409acd54018a9c91000e7626126]
9
10Signed-off-by: Dan Tran <dantran@microsoft.com>
11---
12 test/data/etc/group | 1 +
13 test/data/etc/passwd | 2 +
14 .../etc/polkit-1/rules.d/10-testing.rules | 21 ++++++
15 .../test-polkitbackendjsauthority.c | 72 +++++++++++++++++++
16 4 files changed, 96 insertions(+)
17
18diff --git a/test/data/etc/group b/test/data/etc/group
19index 12ef328..b9acab9 100644
20--- a/test/data/etc/group
21+++ b/test/data/etc/group
22@@ -5,3 +5,4 @@ john:x:500:
23 jane:x:501:
24 sally:x:502:
25 henry:x:503:
26+highuid2:x:4000000000:
27diff --git a/test/data/etc/passwd b/test/data/etc/passwd
28index 8544feb..5cf14a5 100644
29--- a/test/data/etc/passwd
30+++ b/test/data/etc/passwd
31@@ -3,3 +3,5 @@ john:x:500:500:John Done:/home/john:/bin/bash
32 jane:x:501:501:Jane Smith:/home/jane:/bin/bash
33 sally:x:502:502:Sally Derp:/home/sally:/bin/bash
34 henry:x:503:503:Henry Herp:/home/henry:/bin/bash
35+highuid1:x:2147483648:2147483648:The first high uid:/home/highuid1:/sbin/nologin
36+highuid2:x:4000000000:4000000000:An example high uid:/home/example:/sbin/nologin
37diff --git a/test/data/etc/polkit-1/rules.d/10-testing.rules b/test/data/etc/polkit-1/rules.d/10-testing.rules
38index 446e622..98bf062 100644
39--- a/test/data/etc/polkit-1/rules.d/10-testing.rules
40+++ b/test/data/etc/polkit-1/rules.d/10-testing.rules
41@@ -53,6 +53,27 @@ polkit.addRule(function(action, subject) {
42 }
43 });
44
45+polkit.addRule(function(action, subject) {
46+ if (action.id == "net.company.john_action") {
47+ if (subject.user == "john") {
48+ return polkit.Result.YES;
49+ } else {
50+ return polkit.Result.NO;
51+ }
52+ }
53+});
54+
55+polkit.addRule(function(action, subject) {
56+ if (action.id == "net.company.highuid2_action") {
57+ if (subject.user == "highuid2") {
58+ return polkit.Result.YES;
59+ } else {
60+ return polkit.Result.NO;
61+ }
62+ }
63+});
64+
65+
66 // ---------------------------------------------------------------------
67 // variables
68
69diff --git a/test/polkitbackend/test-polkitbackendjsauthority.c b/test/polkitbackend/test-polkitbackendjsauthority.c
70index b484a26..71aad23 100644
71--- a/test/polkitbackend/test-polkitbackendjsauthority.c
72+++ b/test/polkitbackend/test-polkitbackendjsauthority.c
73@@ -330,6 +330,78 @@ static const RulesTestCase rules_test_cases[] = {
74 NULL,
75 POLKIT_IMPLICIT_AUTHORIZATION_AUTHORIZED,
76 },
77+
78+ {
79+ /* highuid1 is not a member of group 'users', see test/data/etc/group */
80+ "group_membership_with_non_member(highuid22)",
81+ "net.company.group.only_group_users",
82+ "unix-user:highuid2",
83+ NULL,
84+ POLKIT_IMPLICIT_AUTHORIZATION_NOT_AUTHORIZED,
85+ },
86+
87+ {
88+ /* highuid2 is not a member of group 'users', see test/data/etc/group */
89+ "group_membership_with_non_member(highuid21)",
90+ "net.company.group.only_group_users",
91+ "unix-user:highuid2",
92+ NULL,
93+ POLKIT_IMPLICIT_AUTHORIZATION_NOT_AUTHORIZED,
94+ },
95+
96+ {
97+ /* highuid1 is not a member of group 'users', see test/data/etc/group */
98+ "group_membership_with_non_member(highuid24)",
99+ "net.company.group.only_group_users",
100+ "unix-user:2147483648",
101+ NULL,
102+ POLKIT_IMPLICIT_AUTHORIZATION_NOT_AUTHORIZED,
103+ },
104+
105+ {
106+ /* highuid2 is not a member of group 'users', see test/data/etc/group */
107+ "group_membership_with_non_member(highuid23)",
108+ "net.company.group.only_group_users",
109+ "unix-user:4000000000",
110+ NULL,
111+ POLKIT_IMPLICIT_AUTHORIZATION_NOT_AUTHORIZED,
112+ },
113+
114+ {
115+ /* john is authorized to do this, see 10-testing.rules */
116+ "john_action",
117+ "net.company.john_action",
118+ "unix-user:john",
119+ NULL,
120+ POLKIT_IMPLICIT_AUTHORIZATION_AUTHORIZED,
121+ },
122+
123+ {
124+ /* only john is authorized to do this, see 10-testing.rules */
125+ "jane_action",
126+ "net.company.john_action",
127+ "unix-user:jane",
128+ NULL,
129+ POLKIT_IMPLICIT_AUTHORIZATION_NOT_AUTHORIZED,
130+ },
131+
132+ {
133+ /* highuid2 is authorized to do this, see 10-testing.rules */
134+ "highuid2_action",
135+ "net.company.highuid2_action",
136+ "unix-user:highuid2",
137+ NULL,
138+ POLKIT_IMPLICIT_AUTHORIZATION_AUTHORIZED,
139+ },
140+
141+ {
142+ /* only highuid2 is authorized to do this, see 10-testing.rules */
143+ "highuid1_action",
144+ "net.company.highuid2_action",
145+ "unix-user:highuid1",
146+ NULL,
147+ POLKIT_IMPLICIT_AUTHORIZATION_NOT_AUTHORIZED,
148+ },
149 };
150
151 /* ---------------------------------------------------------------------------------------------------- */
152--
1532.22.0.vfs.1.1.57.gbaf16c8