1 |
commit: 033ac2d0285c659dd6e2aef0854b1a05c6029b67 |
2 |
Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Jul 28 21:04:06 2019 +0000 |
4 |
Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Jul 28 21:04:06 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=033ac2d0 |
7 |
|
8 |
net-misc/dhcpcd: Removed unused patches |
9 |
|
10 |
Package-Manager: Portage-2.3.69, Repoman-2.3.16 |
11 |
Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org> |
12 |
|
13 |
.../files/dhcpcd-7.1.1-disable_inet6_fix.patch | 24 --- |
14 |
net-misc/dhcpcd/files/dhcpcd-7.1.1-overflows.patch | 213 --------------------- |
15 |
.../files/dhcpcd-7.1.1-v6_read_overflow.patch | 120 ------------ |
16 |
3 files changed, 357 deletions(-) |
17 |
|
18 |
diff --git a/net-misc/dhcpcd/files/dhcpcd-7.1.1-disable_inet6_fix.patch b/net-misc/dhcpcd/files/dhcpcd-7.1.1-disable_inet6_fix.patch |
19 |
deleted file mode 100644 |
20 |
index 2fd3a17428f..00000000000 |
21 |
--- a/net-misc/dhcpcd/files/dhcpcd-7.1.1-disable_inet6_fix.patch |
22 |
+++ /dev/null |
23 |
@@ -1,24 +0,0 @@ |
24 |
-From 6db54edd1427823dcb3924be78c042915a825fb1 Mon Sep 17 00:00:00 2001 |
25 |
-From: Chris Clayton <chris2553@××××××××××.com> |
26 |
-Date: Fri, 8 Feb 2019 16:35:36 +0000 |
27 |
-Subject: fix build with --disable-inet6 |
28 |
- |
29 |
---- |
30 |
- src/dhcpcd.c | 1 + |
31 |
- 1 file changed, 1 insertion(+) |
32 |
- |
33 |
-diff --git a/src/dhcpcd.c b/src/dhcpcd.c |
34 |
-index a2cd04e..6fe60ea 100644 |
35 |
---- a/src/dhcpcd.c |
36 |
-+++ b/src/dhcpcd.c |
37 |
-@@ -54,6 +54,7 @@ const char dhcpcd_copyright[] = "Copyright (c) 2006-2019 Roy Marples"; |
38 |
- #include "dev.h" |
39 |
- #include "dhcp-common.h" |
40 |
- #include "dhcpcd.h" |
41 |
-+#include "dhcp.h" |
42 |
- #include "dhcp6.h" |
43 |
- #include "duid.h" |
44 |
- #include "eloop.h" |
45 |
--- |
46 |
-cgit v1.1 |
47 |
- |
48 |
|
49 |
diff --git a/net-misc/dhcpcd/files/dhcpcd-7.1.1-overflows.patch b/net-misc/dhcpcd/files/dhcpcd-7.1.1-overflows.patch |
50 |
deleted file mode 100644 |
51 |
index 6ec780936a8..00000000000 |
52 |
--- a/net-misc/dhcpcd/files/dhcpcd-7.1.1-overflows.patch |
53 |
+++ /dev/null |
54 |
@@ -1,213 +0,0 @@ |
55 |
-https://roy.marples.name/git/dhcpcd.git/patch/?id=23525884a346ed81c808c1ed90e3c56a8bf0cc68 |
56 |
- |
57 |
-From 8d11b33f6c60e2db257130fa383ba76b6018bcf6 Mon Sep 17 00:00:00 2001 |
58 |
-From: Roy Marples <roy@×××××××.name> |
59 |
-Date: Fri, 19 Apr 2019 09:45:02 +0100 |
60 |
-Subject: DHCPv6: Fix a potential buffer overflow reading NA/TA addresses |
61 |
- |
62 |
-Only copy upto the size of the address option rather than the |
63 |
-option length. |
64 |
- |
65 |
-Found by Maxime Villard <max@×××××××.net> |
66 |
---- |
67 |
- src/dhcp6.c | 4 ++-- |
68 |
- 1 file changed, 2 insertions(+), 2 deletions(-) |
69 |
- |
70 |
-diff --git a/src/dhcp6.c b/src/dhcp6.c |
71 |
-index 99a452b..8fc4f00 100644 |
72 |
---- a/src/dhcp6.c |
73 |
-+++ b/src/dhcp6.c |
74 |
-@@ -2029,12 +2029,12 @@ dhcp6_findna(struct interface *ifp, uint16_t ot, const uint8_t *iaid, |
75 |
- nd = o + ol; |
76 |
- l -= (size_t)(nd - d); |
77 |
- d = nd; |
78 |
-- if (ol < 24) { |
79 |
-+ if (ol < sizeof(ia)) { |
80 |
- errno = EINVAL; |
81 |
- logerrx("%s: IA Address option truncated", ifp->name); |
82 |
- continue; |
83 |
- } |
84 |
-- memcpy(&ia, o, ol); |
85 |
-+ memcpy(&ia, o, sizeof(ia)); |
86 |
- ia.pltime = ntohl(ia.pltime); |
87 |
- ia.vltime = ntohl(ia.vltime); |
88 |
- /* RFC 3315 22.6 */ |
89 |
--- |
90 |
-cgit v1.1 |
91 |
- |
92 |
- |
93 |
-From 4b67f6f1038fd4ad5ca7734eaaeba1b2ec4816b8 Mon Sep 17 00:00:00 2001 |
94 |
-From: Roy Marples <roy@×××××××.name> |
95 |
-Date: Fri, 19 Apr 2019 21:00:19 +0100 |
96 |
-Subject: DHCP: Fix a potential 1 byte read overflow with DHO_OPTSOVERLOADED |
97 |
- |
98 |
-This fix basically moves the option length check up and also |
99 |
-corrects an off by one error with it. |
100 |
- |
101 |
-Thanks to Maxime Villard <max@×××××××.net> |
102 |
---- |
103 |
- src/dhcp.c | 10 ++++++---- |
104 |
- 1 file changed, 6 insertions(+), 4 deletions(-) |
105 |
- |
106 |
-diff --git a/src/dhcp.c b/src/dhcp.c |
107 |
-index f7cdefc..e13d1b4 100644 |
108 |
---- a/src/dhcp.c |
109 |
-+++ b/src/dhcp.c |
110 |
-@@ -215,6 +215,12 @@ get_option(struct dhcpcd_ctx *ctx, |
111 |
- } |
112 |
- l = *p++; |
113 |
- |
114 |
-+ /* Check we can read the option data, if present */ |
115 |
-+ if (p + l > e) { |
116 |
-+ errno = EINVAL; |
117 |
-+ return NULL; |
118 |
-+ } |
119 |
-+ |
120 |
- if (o == DHO_OPTSOVERLOADED) { |
121 |
- /* Ensure we only get this option once by setting |
122 |
- * the last bit as well as the value. |
123 |
-@@ -249,10 +255,6 @@ get_option(struct dhcpcd_ctx *ctx, |
124 |
- bp += ol; |
125 |
- } |
126 |
- ol = l; |
127 |
-- if (p + ol >= e) { |
128 |
-- errno = EINVAL; |
129 |
-- return NULL; |
130 |
-- } |
131 |
- op = p; |
132 |
- bl += ol; |
133 |
- } |
134 |
--- |
135 |
-cgit v1.1 |
136 |
- |
137 |
- |
138 |
-From 7121040790b611ca3fbc400a1bbcd4364ef57233 Mon Sep 17 00:00:00 2001 |
139 |
-From: Roy Marples <roy@×××××××.name> |
140 |
-Date: Fri, 19 Apr 2019 21:40:14 +0100 |
141 |
-Subject: auth: Use consttime_memequal(3) to compare hashes |
142 |
- |
143 |
-This stops any attacker from trying to infer secrets from latency. |
144 |
- |
145 |
-Thanks to Maxime Villard <max@×××××××.net> |
146 |
---- |
147 |
- src/auth.c | 2 +- |
148 |
- 1 file changed, 1 insertion(+), 1 deletion(-) |
149 |
- |
150 |
-diff --git a/src/auth.c b/src/auth.c |
151 |
-index 9e24998..ce97051 100644 |
152 |
---- a/src/auth.c |
153 |
-+++ b/src/auth.c |
154 |
-@@ -354,7 +354,7 @@ gottoken: |
155 |
- } |
156 |
- |
157 |
- free(mm); |
158 |
-- if (memcmp(d, &hmac_code, dlen)) { |
159 |
-+ if (!consttime_memequal(d, &hmac_code, dlen)) { |
160 |
- errno = EPERM; |
161 |
- return NULL; |
162 |
- } |
163 |
--- |
164 |
-cgit v1.1 |
165 |
- |
166 |
- |
167 |
-From cfde89ab66cb4e5957b1c4b68ad6a9449e2784da Mon Sep 17 00:00:00 2001 |
168 |
-From: Roy Marples <roy@×××××××.name> |
169 |
-Date: Fri, 19 Apr 2019 21:42:07 +0100 |
170 |
-Subject: compat: Provide consttime_memequal if not in libc |
171 |
- |
172 |
-Public domain version by Matthias Drochner <drochner@××××××.org> |
173 |
---- |
174 |
- configure | 22 ++++++++++++++++++++++ |
175 |
- 1 file changed, 22 insertions(+) |
176 |
- |
177 |
-diff --git a/configure b/configure |
178 |
-index 570e65f..4f58f0f 100755 |
179 |
---- a/configure |
180 |
-+++ b/configure |
181 |
-@@ -13,6 +13,7 @@ IPV4LL= |
182 |
- INET6= |
183 |
- ARC4RANDOM= |
184 |
- CLOSEFROM= |
185 |
-+CONSTTIME_MEMEQUAL= |
186 |
- STRLCPY= |
187 |
- UDEV= |
188 |
- OS= |
189 |
-@@ -846,6 +847,27 @@ if [ "$STRTOI" = no ]; then |
190 |
- echo "#include \"compat/strtoi.h\"" >>$CONFIG_H |
191 |
- fi |
192 |
- |
193 |
-+if [ -z "$CONSTTIME_MEMEQUAL" ]; then |
194 |
-+ printf "Testing for consttime_memequal ... " |
195 |
-+ cat <<EOF >_consttime_memequal.c |
196 |
-+#include <string.h> |
197 |
-+int main(void) { |
198 |
-+ return consttime_memequal("deadbeef", "deadbeef", 8); |
199 |
-+} |
200 |
-+EOF |
201 |
-+ if $XCC _consttime_memequal.c -o _consttime_memequal 2>&3; then |
202 |
-+ CONSTTIME_MEMEQUAL=yes |
203 |
-+ else |
204 |
-+ CONSTTIME_MEMEQUAL=no |
205 |
-+ fi |
206 |
-+ echo "$CONSTTIME_MEMEQUAL" |
207 |
-+ rm -f _consttime_memequal.c _consttime_memequal |
208 |
-+fi |
209 |
-+if [ "$CONSTTIME_MEMEQUAL" = no ]; then |
210 |
-+ echo "#include \"compat/consttime_memequal.h\"" \ |
211 |
-+ >>$CONFIG_H |
212 |
-+fi |
213 |
-+ |
214 |
- if [ -z "$DPRINTF" ]; then |
215 |
- printf "Testing for dprintf ... " |
216 |
- cat <<EOF >_dprintf.c |
217 |
--- |
218 |
-cgit v1.1 |
219 |
- |
220 |
- |
221 |
-From aee631aadeef4283c8a749c1caf77823304acf5e Mon Sep 17 00:00:00 2001 |
222 |
-From: Roy Marples <roy@×××××××.name> |
223 |
-Date: Fri, 19 Apr 2019 21:47:37 +0100 |
224 |
-Subject: Really add consttime_memequal |
225 |
- |
226 |
---- |
227 |
- compat/consttime_memequal.h | 28 ++++++++++++++++++++++++++++ |
228 |
- 1 file changed, 28 insertions(+) |
229 |
- create mode 100644 compat/consttime_memequal.h |
230 |
- |
231 |
-diff --git a/compat/consttime_memequal.h b/compat/consttime_memequal.h |
232 |
-new file mode 100644 |
233 |
-index 0000000..9830648 |
234 |
---- /dev/null |
235 |
-+++ b/compat/consttime_memequal.h |
236 |
-@@ -0,0 +1,28 @@ |
237 |
-+/* |
238 |
-+ * Written by Matthias Drochner <drochner@××××××.org>. |
239 |
-+ * Public domain. |
240 |
-+ */ |
241 |
-+ |
242 |
-+#ifndef CONSTTIME_MEMEQUAL_H |
243 |
-+#define CONSTTIME_MEMEQUAL_H |
244 |
-+inline static int |
245 |
-+consttime_memequal(const void *b1, const void *b2, size_t len) |
246 |
-+{ |
247 |
-+ const unsigned char *c1 = b1, *c2 = b2; |
248 |
-+ unsigned int res = 0; |
249 |
-+ |
250 |
-+ while (len--) |
251 |
-+ res |= *c1++ ^ *c2++; |
252 |
-+ |
253 |
-+ /* |
254 |
-+ * Map 0 to 1 and [1, 256) to 0 using only constant-time |
255 |
-+ * arithmetic. |
256 |
-+ * |
257 |
-+ * This is not simply `!res' because although many CPUs support |
258 |
-+ * branchless conditional moves and many compilers will take |
259 |
-+ * advantage of them, certain compilers generate branches on |
260 |
-+ * certain CPUs for `!res'. |
261 |
-+ */ |
262 |
-+ return (1 & ((res - 1) >> 8)); |
263 |
-+} |
264 |
-+#endif /* CONSTTIME_MEMEQUAL_H */ |
265 |
--- |
266 |
-cgit v1.1 |
267 |
- |
268 |
|
269 |
diff --git a/net-misc/dhcpcd/files/dhcpcd-7.1.1-v6_read_overflow.patch b/net-misc/dhcpcd/files/dhcpcd-7.1.1-v6_read_overflow.patch |
270 |
deleted file mode 100644 |
271 |
index 54b559fcd87..00000000000 |
272 |
--- a/net-misc/dhcpcd/files/dhcpcd-7.1.1-v6_read_overflow.patch |
273 |
+++ /dev/null |
274 |
@@ -1,120 +0,0 @@ |
275 |
-From c1ebeaafeb324bac997984abdcee2d4e8b61a8a8 Mon Sep 17 00:00:00 2001 |
276 |
-From: Roy Marples <roy@×××××××.name> |
277 |
-Date: Fri, 3 May 2019 14:44:06 +0100 |
278 |
-Subject: DHCPv6: Fix a potential read overflow with D6_OPTION_PD_EXCLUDE |
279 |
- |
280 |
-dhcpcd only checks that the prefix length of the exclusion |
281 |
-matches the prefix length of the ia and equals the length of the |
282 |
-data in the option. |
283 |
-This could potentially overrun the in6_addr structure. |
284 |
- |
285 |
-This is fixed by enforcing RFC 6603 section 4.2 option limits |
286 |
-more clearly. |
287 |
- |
288 |
-Thanks to Maxime Villard <max@×××××××.net> for finding this. |
289 |
---- |
290 |
- src/dhcp6.c | 44 +++++++++++++++++++++----------------------- |
291 |
- 1 file changed, 21 insertions(+), 23 deletions(-) |
292 |
- |
293 |
-diff --git a/src/dhcp6.c b/src/dhcp6.c |
294 |
-index dee8d4b6..583f3b3f 100644 |
295 |
---- a/src/dhcp6.c |
296 |
-+++ b/src/dhcp6.c |
297 |
-@@ -2166,40 +2166,38 @@ dhcp6_findpd(struct interface *ifp, const uint8_t *iaid, |
298 |
- state->expire = a->prefix_vltime; |
299 |
- i++; |
300 |
- |
301 |
-- o = dhcp6_findoption(o, ol, D6_OPTION_PD_EXCLUDE, &ol); |
302 |
- a->prefix_exclude_len = 0; |
303 |
- memset(&a->prefix_exclude, 0, sizeof(a->prefix_exclude)); |
304 |
--#if 0 |
305 |
-- if (ex == NULL) { |
306 |
-- struct dhcp6_option *w; |
307 |
-- uint8_t *wp; |
308 |
-- |
309 |
-- w = calloc(1, 128); |
310 |
-- w->len = htons(2); |
311 |
-- wp = D6_OPTION_DATA(w); |
312 |
-- *wp++ = 64; |
313 |
-- *wp++ = 0x78; |
314 |
-- ex = w; |
315 |
-- } |
316 |
--#endif |
317 |
-+ o = dhcp6_findoption(o, ol, D6_OPTION_PD_EXCLUDE, &ol); |
318 |
- if (o == NULL) |
319 |
- continue; |
320 |
-- if (ol < 2) { |
321 |
-- logerrx("%s: truncated PD Exclude", ifp->name); |
322 |
-+ |
323 |
-+ /* RFC 6603 4.2 says option length MUST be between 2 and 17. |
324 |
-+ * This allows 1 octet for prefix length and 16 for the |
325 |
-+ * subnet ID. */ |
326 |
-+ if (ol < 2 || ol > 17) { |
327 |
-+ logerrx("%s: invalid PD Exclude option", ifp->name); |
328 |
- continue; |
329 |
- } |
330 |
-- a->prefix_exclude_len = *o++; |
331 |
-- ol--; |
332 |
-- if (((a->prefix_exclude_len - a->prefix_len - 1) / NBBY) + 1 |
333 |
-- != ol) |
334 |
-- { |
335 |
-+ |
336 |
-+ /* RFC 6603 4.2 says prefix length MUST be between the |
337 |
-+ * length of the IAPREFIX prefix length + 1 and 128. */ |
338 |
-+ if (*o < a->prefix_len + 1 || *o > 128) { |
339 |
-+ logerrx("%s: invalid PD Exclude length", ifp->name); |
340 |
-+ continue; |
341 |
-+ } |
342 |
-+ |
343 |
-+ /* Check option length matches prefix length. */ |
344 |
-+ if (((*o - a->prefix_len - 1) / NBBY) + 1 != ol) { |
345 |
- logerrx("%s: PD Exclude length mismatch", ifp->name); |
346 |
-- a->prefix_exclude_len = 0; |
347 |
- continue; |
348 |
- } |
349 |
-- nb = a->prefix_len % NBBY; |
350 |
-+ |
351 |
-+ a->prefix_exclude_len = *o++; |
352 |
-+ ol--; |
353 |
- memcpy(&a->prefix_exclude, &a->prefix, |
354 |
- sizeof(a->prefix_exclude)); |
355 |
-+ nb = a->prefix_len % NBBY; |
356 |
- if (nb) |
357 |
- ol--; |
358 |
- pw = a->prefix_exclude.s6_addr + |
359 |
--- |
360 |
-cgit v1.2.1 |
361 |
- |
362 |
-From 896ef4a54b0578985e5e1360b141593f1d62837b Mon Sep 17 00:00:00 2001 |
363 |
-From: Roy Marples <roy@×××××××.name> |
364 |
-Date: Sat, 4 May 2019 10:19:02 +0100 |
365 |
-Subject: DHCPv6: Fix exclude prefix length check. |
366 |
- |
367 |
---- |
368 |
- src/dhcp6.c | 4 ++-- |
369 |
- 1 file changed, 2 insertions(+), 2 deletions(-) |
370 |
- |
371 |
-diff --git a/src/dhcp6.c b/src/dhcp6.c |
372 |
-index 583f3b3f..7f26129f 100644 |
373 |
---- a/src/dhcp6.c |
374 |
-+++ b/src/dhcp6.c |
375 |
-@@ -2187,14 +2187,14 @@ dhcp6_findpd(struct interface *ifp, const uint8_t *iaid, |
376 |
- continue; |
377 |
- } |
378 |
- |
379 |
-+ ol--; |
380 |
- /* Check option length matches prefix length. */ |
381 |
- if (((*o - a->prefix_len - 1) / NBBY) + 1 != ol) { |
382 |
- logerrx("%s: PD Exclude length mismatch", ifp->name); |
383 |
- continue; |
384 |
- } |
385 |
-- |
386 |
- a->prefix_exclude_len = *o++; |
387 |
-- ol--; |
388 |
-+ |
389 |
- memcpy(&a->prefix_exclude, &a->prefix, |
390 |
- sizeof(a->prefix_exclude)); |
391 |
- nb = a->prefix_len % NBBY; |
392 |
--- |
393 |
-cgit v1.2.1 |
394 |
- |