Merge ~alfonsosanchezbeato/snappy-hwe-snaps/+git/wifi-ap:dnsmasq/2.75 into ~snappy-hwe-team/snappy-hwe-snaps/+git/wifi-ap:dnsmasq/2.75
- Git
- lp:~alfonsosanchezbeato/snappy-hwe-snaps/+git/wifi-ap
- dnsmasq/2.75
- Merge into dnsmasq/2.75
Proposed by
Alfonso Sanchez-Beato
Status: | Merged |
---|---|
Approved by: | Konrad Zapałowicz |
Approved revision: | 25accfdecc8e2ad5001d341e40cce2040859018a |
Merged at revision: | 59e878ad0bc3a2787d8d4b5f4fed3699212b49b1 |
Proposed branch: | ~alfonsosanchezbeato/snappy-hwe-snaps/+git/wifi-ap:dnsmasq/2.75 |
Merge into: | ~snappy-hwe-team/snappy-hwe-snaps/+git/wifi-ap:dnsmasq/2.75 |
Diff against target: |
452 lines (+108/-26) 12 files modified
src/cache.c (+1/-1) src/dnsmasq.h (+2/-1) src/dnssec.c (+1/-1) src/forward.c (+2/-1) src/network.c (+30/-2) src/option.c (+1/-1) src/radv.c (+3/-0) src/rfc1035.c (+49/-12) src/rfc2131.c (+3/-3) src/rfc3315.c (+8/-2) src/util.c (+6/-1) trust-anchors.conf (+2/-1) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Alfonso Sanchez-Beato | continuous-integration | Approve | |
System Enablement Bot | continuous-integration | Needs Fixing | |
Konrad Zapałowicz (community) | Approve | ||
Review via email: mp+368037@code.launchpad.net |
Commit message
Update to ubuntu package 2.75-1ubuntu0.
Several bug fixes and USNs solved, including 3009-1, 3430-1, and 3716-1.
Changes applied from
http://
Description of the change
Update to ubuntu package 2.75-1ubuntu0.
Several bug fixes and USNs solved, including 3009-1, 3430-1, and 3716-1.
Changes applied from
http://
To post a comment you must log in.
Revision history for this message
Konrad Zapałowicz (kzapalowicz) : | # |
review:
Approve
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote : | # |
review:
Needs Fixing
(continuous-integration)
Revision history for this message
Alfonso Sanchez-Beato (alfonsosanchezbeato) : | # |
review:
Approve
(continuous-integration)
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | diff --git a/src/cache.c b/src/cache.c | |||
2 | index 178d654..1b76b67 100644 | |||
3 | --- a/src/cache.c | |||
4 | +++ b/src/cache.c | |||
5 | @@ -481,7 +481,7 @@ struct crec *cache_insert(char *name, struct all_addr *addr, | |||
6 | 481 | existing record is for an A or AAAA and | 481 | existing record is for an A or AAAA and |
7 | 482 | the record we're trying to insert is the same, | 482 | the record we're trying to insert is the same, |
8 | 483 | just drop the insert, but don't error the whole process. */ | 483 | just drop the insert, but don't error the whole process. */ |
10 | 484 | if ((flags & (F_IPV4 | F_IPV6)) && (flags & F_FORWARD)) | 484 | if ((flags & (F_IPV4 | F_IPV6)) && (flags & F_FORWARD) && addr) |
11 | 485 | { | 485 | { |
12 | 486 | if ((flags & F_IPV4) && (new->flags & F_IPV4) && | 486 | if ((flags & F_IPV4) && (new->flags & F_IPV4) && |
13 | 487 | new->addr.addr.addr.addr4.s_addr == addr->addr.addr4.s_addr) | 487 | new->addr.addr.addr.addr4.s_addr == addr->addr.addr4.s_addr) |
14 | diff --git a/src/dnsmasq.h b/src/dnsmasq.h | |||
15 | index cf1a782..e021612 100644 | |||
16 | --- a/src/dnsmasq.h | |||
17 | +++ b/src/dnsmasq.h | |||
18 | @@ -492,6 +492,7 @@ struct serverfd { | |||
19 | 492 | int fd; | 492 | int fd; |
20 | 493 | union mysockaddr source_addr; | 493 | union mysockaddr source_addr; |
21 | 494 | char interface[IF_NAMESIZE+1]; | 494 | char interface[IF_NAMESIZE+1]; |
22 | 495 | unsigned int ifindex, used; | ||
23 | 495 | struct serverfd *next; | 496 | struct serverfd *next; |
24 | 496 | }; | 497 | }; |
25 | 497 | 498 | ||
26 | @@ -1169,7 +1170,7 @@ u32 rand32(void); | |||
27 | 1169 | u64 rand64(void); | 1170 | u64 rand64(void); |
28 | 1170 | int legal_hostname(char *c); | 1171 | int legal_hostname(char *c); |
29 | 1171 | char *canonicalise(char *s, int *nomem); | 1172 | char *canonicalise(char *s, int *nomem); |
31 | 1172 | unsigned char *do_rfc1035_name(unsigned char *p, char *sval); | 1173 | unsigned char *do_rfc1035_name(unsigned char *p, char *sval, char *limit); |
32 | 1173 | void *safe_malloc(size_t size); | 1174 | void *safe_malloc(size_t size); |
33 | 1174 | void safe_pipe(int *fd, int read_noblock); | 1175 | void safe_pipe(int *fd, int read_noblock); |
34 | 1175 | void *whine_malloc(size_t size); | 1176 | void *whine_malloc(size_t size); |
35 | diff --git a/src/dnssec.c b/src/dnssec.c | |||
36 | index 4deda24..830f304 100644 | |||
37 | --- a/src/dnssec.c | |||
38 | +++ b/src/dnssec.c | |||
39 | @@ -2264,7 +2264,7 @@ size_t dnssec_generate_query(struct dns_header *header, char *end, char *name, i | |||
40 | 2264 | 2264 | ||
41 | 2265 | p = (unsigned char *)(header+1); | 2265 | p = (unsigned char *)(header+1); |
42 | 2266 | 2266 | ||
44 | 2267 | p = do_rfc1035_name(p, name); | 2267 | p = do_rfc1035_name(p, name, NULL); |
45 | 2268 | *p++ = 0; | 2268 | *p++ = 0; |
46 | 2269 | PUTSHORT(type, p); | 2269 | PUTSHORT(type, p); |
47 | 2270 | PUTSHORT(class, p); | 2270 | PUTSHORT(class, p); |
48 | diff --git a/src/forward.c b/src/forward.c | |||
49 | index 2731b90..959356c 100644 | |||
50 | --- a/src/forward.c | |||
51 | +++ b/src/forward.c | |||
52 | @@ -810,7 +810,8 @@ void reply_query(int fd, int family, time_t now) | |||
53 | 810 | we get a good reply from another server. Kill it when we've | 810 | we get a good reply from another server. Kill it when we've |
54 | 811 | had replies from all to avoid filling the forwarding table when | 811 | had replies from all to avoid filling the forwarding table when |
55 | 812 | everything is broken */ | 812 | everything is broken */ |
57 | 813 | if (forward->forwardall == 0 || --forward->forwardall == 1 || RCODE(header) != SERVFAIL) | 813 | if (forward->forwardall == 0 || --forward->forwardall == 1 || |
58 | 814 | (RCODE(header) != REFUSED && RCODE(header) != SERVFAIL)) | ||
59 | 814 | { | 815 | { |
60 | 815 | int check_rebind = 0, no_cache_dnssec = 0, cache_secure = 0, bogusanswer = 0; | 816 | int check_rebind = 0, no_cache_dnssec = 0, cache_secure = 0, bogusanswer = 0; |
61 | 816 | 817 | ||
62 | diff --git a/src/network.c b/src/network.c | |||
63 | index a1d90c8..b8ebd55 100644 | |||
64 | --- a/src/network.c | |||
65 | +++ b/src/network.c | |||
66 | @@ -1191,6 +1191,7 @@ int local_bind(int fd, union mysockaddr *addr, char *intname, int is_tcp) | |||
67 | 1191 | static struct serverfd *allocate_sfd(union mysockaddr *addr, char *intname) | 1191 | static struct serverfd *allocate_sfd(union mysockaddr *addr, char *intname) |
68 | 1192 | { | 1192 | { |
69 | 1193 | struct serverfd *sfd; | 1193 | struct serverfd *sfd; |
70 | 1194 | unsigned int ifindex = 0; | ||
71 | 1194 | int errsave; | 1195 | int errsave; |
72 | 1195 | 1196 | ||
73 | 1196 | /* when using random ports, servers which would otherwise use | 1197 | /* when using random ports, servers which would otherwise use |
74 | @@ -1211,11 +1212,15 @@ static struct serverfd *allocate_sfd(union mysockaddr *addr, char *intname) | |||
75 | 1211 | return NULL; | 1212 | return NULL; |
76 | 1212 | #endif | 1213 | #endif |
77 | 1213 | } | 1214 | } |
78 | 1215 | |||
79 | 1216 | if (intname && strlen(intname) != 0) | ||
80 | 1217 | ifindex = if_nametoindex(intname); /* index == 0 when not binding to an interface */ | ||
81 | 1214 | 1218 | ||
82 | 1215 | /* may have a suitable one already */ | 1219 | /* may have a suitable one already */ |
83 | 1216 | for (sfd = daemon->sfds; sfd; sfd = sfd->next ) | 1220 | for (sfd = daemon->sfds; sfd; sfd = sfd->next ) |
84 | 1217 | if (sockaddr_isequal(&sfd->source_addr, addr) && | 1221 | if (sockaddr_isequal(&sfd->source_addr, addr) && |
86 | 1218 | strcmp(intname, sfd->interface) == 0) | 1222 | strcmp(intname, sfd->interface) == 0 && |
87 | 1223 | ifindex == sfd->ifindex) | ||
88 | 1219 | return sfd; | 1224 | return sfd; |
89 | 1220 | 1225 | ||
90 | 1221 | /* need to make a new one. */ | 1226 | /* need to make a new one. */ |
91 | @@ -1237,11 +1242,13 @@ static struct serverfd *allocate_sfd(union mysockaddr *addr, char *intname) | |||
92 | 1237 | errno = errsave; | 1242 | errno = errsave; |
93 | 1238 | return NULL; | 1243 | return NULL; |
94 | 1239 | } | 1244 | } |
96 | 1240 | 1245 | ||
97 | 1241 | strcpy(sfd->interface, intname); | 1246 | strcpy(sfd->interface, intname); |
98 | 1242 | sfd->source_addr = *addr; | 1247 | sfd->source_addr = *addr; |
99 | 1243 | sfd->next = daemon->sfds; | 1248 | sfd->next = daemon->sfds; |
100 | 1249 | sfd->ifindex = ifindex; | ||
101 | 1244 | daemon->sfds = sfd; | 1250 | daemon->sfds = sfd; |
102 | 1251 | |||
103 | 1245 | return sfd; | 1252 | return sfd; |
104 | 1246 | } | 1253 | } |
105 | 1247 | 1254 | ||
106 | @@ -1417,12 +1424,16 @@ void check_servers(void) | |||
107 | 1417 | { | 1424 | { |
108 | 1418 | struct irec *iface; | 1425 | struct irec *iface; |
109 | 1419 | struct server *serv; | 1426 | struct server *serv; |
110 | 1427 | struct serverfd *sfd, *tmp, **up; | ||
111 | 1420 | int port = 0; | 1428 | int port = 0; |
112 | 1421 | 1429 | ||
113 | 1422 | /* interface may be new since startup */ | 1430 | /* interface may be new since startup */ |
114 | 1423 | if (!option_bool(OPT_NOWILD)) | 1431 | if (!option_bool(OPT_NOWILD)) |
115 | 1424 | enumerate_interfaces(0); | 1432 | enumerate_interfaces(0); |
116 | 1425 | 1433 | ||
117 | 1434 | for (sfd = daemon->sfds; sfd; sfd = sfd->next) | ||
118 | 1435 | sfd->used = 0; | ||
119 | 1436 | |||
120 | 1426 | for (serv = daemon->servers; serv; serv = serv->next) | 1437 | for (serv = daemon->servers; serv; serv = serv->next) |
121 | 1427 | { | 1438 | { |
122 | 1428 | if (!(serv->flags & (SERV_LITERAL_ADDRESS | SERV_NO_ADDR | SERV_USE_RESOLV | SERV_NO_REBIND))) | 1439 | if (!(serv->flags & (SERV_LITERAL_ADDRESS | SERV_NO_ADDR | SERV_USE_RESOLV | SERV_NO_REBIND))) |
123 | @@ -1458,6 +1469,9 @@ void check_servers(void) | |||
124 | 1458 | serv->flags |= SERV_MARK; | 1469 | serv->flags |= SERV_MARK; |
125 | 1459 | continue; | 1470 | continue; |
126 | 1460 | } | 1471 | } |
127 | 1472 | |||
128 | 1473 | if (serv->sfd) | ||
129 | 1474 | serv->sfd->used = 1; | ||
130 | 1461 | } | 1475 | } |
131 | 1462 | 1476 | ||
132 | 1463 | if (!(serv->flags & SERV_NO_REBIND) && !(serv->flags & SERV_LITERAL_ADDRESS)) | 1477 | if (!(serv->flags & SERV_NO_REBIND) && !(serv->flags & SERV_LITERAL_ADDRESS)) |
133 | @@ -1490,6 +1504,20 @@ void check_servers(void) | |||
134 | 1490 | } | 1504 | } |
135 | 1491 | } | 1505 | } |
136 | 1492 | 1506 | ||
137 | 1507 | /* Remove unused sfds */ | ||
138 | 1508 | for (sfd = daemon->sfds, up = &daemon->sfds; sfd; sfd = tmp) | ||
139 | 1509 | { | ||
140 | 1510 | tmp = sfd->next; | ||
141 | 1511 | if (!sfd->used) | ||
142 | 1512 | { | ||
143 | 1513 | *up = sfd->next; | ||
144 | 1514 | close(sfd->fd); | ||
145 | 1515 | free(sfd); | ||
146 | 1516 | } | ||
147 | 1517 | else | ||
148 | 1518 | up = &sfd->next; | ||
149 | 1519 | } | ||
150 | 1520 | |||
151 | 1493 | cleanup_servers(); | 1521 | cleanup_servers(); |
152 | 1494 | } | 1522 | } |
153 | 1495 | 1523 | ||
154 | diff --git a/src/option.c b/src/option.c | |||
155 | index ecc2619..ed204fb 100644 | |||
156 | --- a/src/option.c | |||
157 | +++ b/src/option.c | |||
158 | @@ -1348,7 +1348,7 @@ static int parse_dhcp_opt(char *errstr, char *arg, int flags) | |||
159 | 1348 | } | 1348 | } |
160 | 1349 | 1349 | ||
161 | 1350 | p = newp; | 1350 | p = newp; |
163 | 1351 | end = do_rfc1035_name(p + len, dom); | 1351 | end = do_rfc1035_name(p + len, dom, NULL); |
164 | 1352 | *end++ = 0; | 1352 | *end++ = 0; |
165 | 1353 | len = end - p; | 1353 | len = end - p; |
166 | 1354 | free(dom); | 1354 | free(dom); |
167 | diff --git a/src/radv.c b/src/radv.c | |||
168 | index 39f1e92..9db0095 100644 | |||
169 | --- a/src/radv.c | |||
170 | +++ b/src/radv.c | |||
171 | @@ -197,6 +197,9 @@ void icmp6_packet(time_t now) | |||
172 | 197 | /* look for link-layer address option for logging */ | 197 | /* look for link-layer address option for logging */ |
173 | 198 | if (sz >= 16 && packet[8] == ICMP6_OPT_SOURCE_MAC && (packet[9] * 8) + 8 <= sz) | 198 | if (sz >= 16 && packet[8] == ICMP6_OPT_SOURCE_MAC && (packet[9] * 8) + 8 <= sz) |
174 | 199 | { | 199 | { |
175 | 200 | if ((packet[9] * 8 - 2) * 3 - 1 >= MAXDNAME) { | ||
176 | 201 | return; | ||
177 | 202 | } | ||
178 | 200 | print_mac(daemon->namebuff, &packet[10], (packet[9] * 8) - 2); | 203 | print_mac(daemon->namebuff, &packet[10], (packet[9] * 8) - 2); |
179 | 201 | mac = daemon->namebuff; | 204 | mac = daemon->namebuff; |
180 | 202 | } | 205 | } |
181 | diff --git a/src/rfc1035.c b/src/rfc1035.c | |||
182 | index 56647b0..9456f2a 100644 | |||
183 | --- a/src/rfc1035.c | |||
184 | +++ b/src/rfc1035.c | |||
185 | @@ -37,7 +37,7 @@ int extract_name(struct dns_header *header, size_t plen, unsigned char **pp, | |||
186 | 37 | /* end marker */ | 37 | /* end marker */ |
187 | 38 | { | 38 | { |
188 | 39 | /* check that there are the correct no of bytes after the name */ | 39 | /* check that there are the correct no of bytes after the name */ |
190 | 40 | if (!CHECK_LEN(header, p, plen, extrabytes)) | 40 | if (!CHECK_LEN(header, p1 ? p1 : p, plen, extrabytes)) |
191 | 41 | return 0; | 41 | return 0; |
192 | 42 | 42 | ||
193 | 43 | if (isExtract) | 43 | if (isExtract) |
194 | @@ -794,6 +794,8 @@ static unsigned char *do_doctor(unsigned char *p, int count, struct dns_header * | |||
195 | 794 | { | 794 | { |
196 | 795 | unsigned int i, len = *p1; | 795 | unsigned int i, len = *p1; |
197 | 796 | unsigned char *p2 = p1; | 796 | unsigned char *p2 = p1; |
198 | 797 | if ((p1 + len - p) >= rdlen) | ||
199 | 798 | return 0; /* bad packet */ | ||
200 | 797 | /* make counted string zero-term and sanitise */ | 799 | /* make counted string zero-term and sanitise */ |
201 | 798 | for (i = 0; i < len; i++) | 800 | for (i = 0; i < len; i++) |
202 | 799 | { | 801 | { |
203 | @@ -1362,6 +1364,7 @@ int check_for_ignored_address(struct dns_header *header, size_t qlen, struct bog | |||
204 | 1362 | return 0; | 1364 | return 0; |
205 | 1363 | } | 1365 | } |
206 | 1364 | 1366 | ||
207 | 1367 | |||
208 | 1365 | int add_resource_record(struct dns_header *header, char *limit, int *truncp, int nameoffset, unsigned char **pp, | 1368 | int add_resource_record(struct dns_header *header, char *limit, int *truncp, int nameoffset, unsigned char **pp, |
209 | 1366 | unsigned long ttl, int *offset, unsigned short type, unsigned short class, char *format, ...) | 1369 | unsigned long ttl, int *offset, unsigned short type, unsigned short class, char *format, ...) |
210 | 1367 | { | 1370 | { |
211 | @@ -1371,29 +1374,47 @@ int add_resource_record(struct dns_header *header, char *limit, int *truncp, int | |||
212 | 1371 | unsigned short usval; | 1374 | unsigned short usval; |
213 | 1372 | long lval; | 1375 | long lval; |
214 | 1373 | char *sval; | 1376 | char *sval; |
215 | 1377 | #define CHECK_LIMIT(size) \ | ||
216 | 1378 | if (limit && p + (size) > (unsigned char*)limit) \ | ||
217 | 1379 | { \ | ||
218 | 1380 | va_end(ap); \ | ||
219 | 1381 | goto truncated; \ | ||
220 | 1382 | } | ||
221 | 1374 | 1383 | ||
222 | 1375 | if (truncp && *truncp) | 1384 | if (truncp && *truncp) |
223 | 1376 | return 0; | 1385 | return 0; |
225 | 1377 | 1386 | ||
226 | 1378 | va_start(ap, format); /* make ap point to 1st unamed argument */ | 1387 | va_start(ap, format); /* make ap point to 1st unamed argument */ |
228 | 1379 | 1388 | ||
229 | 1380 | if (nameoffset > 0) | 1389 | if (nameoffset > 0) |
230 | 1381 | { | 1390 | { |
231 | 1391 | CHECK_LIMIT(2); | ||
232 | 1382 | PUTSHORT(nameoffset | 0xc000, p); | 1392 | PUTSHORT(nameoffset | 0xc000, p); |
233 | 1383 | } | 1393 | } |
234 | 1384 | else | 1394 | else |
235 | 1385 | { | 1395 | { |
236 | 1386 | char *name = va_arg(ap, char *); | 1396 | char *name = va_arg(ap, char *); |
239 | 1387 | if (name) | 1397 | if (name && !(p = do_rfc1035_name(p, name, limit))) |
240 | 1388 | p = do_rfc1035_name(p, name); | 1398 | { |
241 | 1399 | va_end(ap); | ||
242 | 1400 | goto truncated; | ||
243 | 1401 | } | ||
244 | 1402 | |||
245 | 1389 | if (nameoffset < 0) | 1403 | if (nameoffset < 0) |
246 | 1390 | { | 1404 | { |
247 | 1405 | CHECK_LIMIT(2); | ||
248 | 1391 | PUTSHORT(-nameoffset | 0xc000, p); | 1406 | PUTSHORT(-nameoffset | 0xc000, p); |
249 | 1392 | } | 1407 | } |
250 | 1393 | else | 1408 | else |
252 | 1394 | *p++ = 0; | 1409 | { |
253 | 1410 | CHECK_LIMIT(1); | ||
254 | 1411 | *p++ = 0; | ||
255 | 1412 | } | ||
256 | 1395 | } | 1413 | } |
257 | 1396 | 1414 | ||
258 | 1415 | /* type (2) + class (2) + ttl (4) + rdlen (2) */ | ||
259 | 1416 | CHECK_LIMIT(10); | ||
260 | 1417 | |||
261 | 1397 | PUTSHORT(type, p); | 1418 | PUTSHORT(type, p); |
262 | 1398 | PUTSHORT(class, p); | 1419 | PUTSHORT(class, p); |
263 | 1399 | PUTLONG(ttl, p); /* TTL */ | 1420 | PUTLONG(ttl, p); /* TTL */ |
264 | @@ -1406,6 +1427,7 @@ int add_resource_record(struct dns_header *header, char *limit, int *truncp, int | |||
265 | 1406 | { | 1427 | { |
266 | 1407 | #ifdef HAVE_IPV6 | 1428 | #ifdef HAVE_IPV6 |
267 | 1408 | case '6': | 1429 | case '6': |
268 | 1430 | CHECK_LIMIT(IN6ADDRSZ); | ||
269 | 1409 | sval = va_arg(ap, char *); | 1431 | sval = va_arg(ap, char *); |
270 | 1410 | memcpy(p, sval, IN6ADDRSZ); | 1432 | memcpy(p, sval, IN6ADDRSZ); |
271 | 1411 | p += IN6ADDRSZ; | 1433 | p += IN6ADDRSZ; |
272 | @@ -1413,36 +1435,47 @@ int add_resource_record(struct dns_header *header, char *limit, int *truncp, int | |||
273 | 1413 | #endif | 1435 | #endif |
274 | 1414 | 1436 | ||
275 | 1415 | case '4': | 1437 | case '4': |
276 | 1438 | CHECK_LIMIT(INADDRSZ); | ||
277 | 1416 | sval = va_arg(ap, char *); | 1439 | sval = va_arg(ap, char *); |
278 | 1417 | memcpy(p, sval, INADDRSZ); | 1440 | memcpy(p, sval, INADDRSZ); |
279 | 1418 | p += INADDRSZ; | 1441 | p += INADDRSZ; |
280 | 1419 | break; | 1442 | break; |
281 | 1420 | 1443 | ||
282 | 1421 | case 'b': | 1444 | case 'b': |
283 | 1445 | CHECK_LIMIT(1); | ||
284 | 1422 | usval = va_arg(ap, int); | 1446 | usval = va_arg(ap, int); |
285 | 1423 | *p++ = usval; | 1447 | *p++ = usval; |
286 | 1424 | break; | 1448 | break; |
287 | 1425 | 1449 | ||
288 | 1426 | case 's': | 1450 | case 's': |
289 | 1451 | CHECK_LIMIT(2); | ||
290 | 1427 | usval = va_arg(ap, int); | 1452 | usval = va_arg(ap, int); |
291 | 1428 | PUTSHORT(usval, p); | 1453 | PUTSHORT(usval, p); |
292 | 1429 | break; | 1454 | break; |
293 | 1430 | 1455 | ||
294 | 1431 | case 'l': | 1456 | case 'l': |
295 | 1457 | CHECK_LIMIT(4); | ||
296 | 1432 | lval = va_arg(ap, long); | 1458 | lval = va_arg(ap, long); |
297 | 1433 | PUTLONG(lval, p); | 1459 | PUTLONG(lval, p); |
298 | 1434 | break; | 1460 | break; |
299 | 1435 | 1461 | ||
300 | 1436 | case 'd': | 1462 | case 'd': |
306 | 1437 | /* get domain-name answer arg and store it in RDATA field */ | 1463 | /* get domain-name answer arg and store it in RDATA field */ |
307 | 1438 | if (offset) | 1464 | if (offset) |
308 | 1439 | *offset = p - (unsigned char *)header; | 1465 | *offset = p - (unsigned char *)header; |
309 | 1440 | p = do_rfc1035_name(p, va_arg(ap, char *)); | 1466 | p = do_rfc1035_name(p, va_arg(ap, char *), limit); |
310 | 1441 | *p++ = 0; | 1467 | if (!p) |
311 | 1468 | { | ||
312 | 1469 | va_end(ap); | ||
313 | 1470 | goto truncated; | ||
314 | 1471 | } | ||
315 | 1472 | CHECK_LIMIT(1); | ||
316 | 1473 | *p++ = 0; | ||
317 | 1442 | break; | 1474 | break; |
318 | 1443 | 1475 | ||
319 | 1444 | case 't': | 1476 | case 't': |
320 | 1445 | usval = va_arg(ap, int); | 1477 | usval = va_arg(ap, int); |
321 | 1478 | CHECK_LIMIT(usval); | ||
322 | 1446 | sval = va_arg(ap, char *); | 1479 | sval = va_arg(ap, char *); |
323 | 1447 | if (usval != 0) | 1480 | if (usval != 0) |
324 | 1448 | memcpy(p, sval, usval); | 1481 | memcpy(p, sval, usval); |
325 | @@ -1454,20 +1487,24 @@ int add_resource_record(struct dns_header *header, char *limit, int *truncp, int | |||
326 | 1454 | usval = sval ? strlen(sval) : 0; | 1487 | usval = sval ? strlen(sval) : 0; |
327 | 1455 | if (usval > 255) | 1488 | if (usval > 255) |
328 | 1456 | usval = 255; | 1489 | usval = 255; |
329 | 1490 | CHECK_LIMIT(usval + 1); | ||
330 | 1457 | *p++ = (unsigned char)usval; | 1491 | *p++ = (unsigned char)usval; |
331 | 1458 | memcpy(p, sval, usval); | 1492 | memcpy(p, sval, usval); |
332 | 1459 | p += usval; | 1493 | p += usval; |
333 | 1460 | break; | 1494 | break; |
334 | 1461 | } | 1495 | } |
335 | 1462 | 1496 | ||
336 | 1497 | #undef CHECK_LIMIT | ||
337 | 1463 | va_end(ap); /* clean up variable argument pointer */ | 1498 | va_end(ap); /* clean up variable argument pointer */ |
338 | 1464 | 1499 | ||
339 | 1465 | j = p - sav - 2; | 1500 | j = p - sav - 2; |
341 | 1466 | PUTSHORT(j, sav); /* Now, store real RDLength */ | 1501 | /* this has already been checked against limit before */ |
342 | 1502 | PUTSHORT(j, sav); /* Now, store real RDLength */ | ||
343 | 1467 | 1503 | ||
344 | 1468 | /* check for overflow of buffer */ | 1504 | /* check for overflow of buffer */ |
345 | 1469 | if (limit && ((unsigned char *)limit - p) < 0) | 1505 | if (limit && ((unsigned char *)limit - p) < 0) |
346 | 1470 | { | 1506 | { |
347 | 1507 | truncated: | ||
348 | 1471 | if (truncp) | 1508 | if (truncp) |
349 | 1472 | *truncp = 1; | 1509 | *truncp = 1; |
350 | 1473 | return 0; | 1510 | return 0; |
351 | diff --git a/src/rfc2131.c b/src/rfc2131.c | |||
352 | index 9f69ed5..a8ccf86 100644 | |||
353 | --- a/src/rfc2131.c | |||
354 | +++ b/src/rfc2131.c | |||
355 | @@ -155,7 +155,7 @@ size_t dhcp_reply(struct dhcp_context *context, char *iface_name, int int_index, | |||
356 | 155 | for (offset = 0; offset < (len - 5); offset += elen + 5) | 155 | for (offset = 0; offset < (len - 5); offset += elen + 5) |
357 | 156 | { | 156 | { |
358 | 157 | elen = option_uint(opt, offset + 4 , 1); | 157 | elen = option_uint(opt, offset + 4 , 1); |
360 | 158 | if (option_uint(opt, offset, 4) == BRDBAND_FORUM_IANA) | 158 | if (option_uint(opt, offset, 4) == BRDBAND_FORUM_IANA && offset + elen + 5 <= len) |
361 | 159 | { | 159 | { |
362 | 160 | unsigned char *x = option_ptr(opt, offset + 5); | 160 | unsigned char *x = option_ptr(opt, offset + 5); |
363 | 161 | unsigned char *y = option_ptr(opt, offset + elen + 5); | 161 | unsigned char *y = option_ptr(opt, offset + elen + 5); |
364 | @@ -2352,10 +2352,10 @@ static void do_options(struct dhcp_context *context, | |||
365 | 2352 | 2352 | ||
366 | 2353 | if (fqdn_flags & 0x04) | 2353 | if (fqdn_flags & 0x04) |
367 | 2354 | { | 2354 | { |
369 | 2355 | p = do_rfc1035_name(p, hostname); | 2355 | p = do_rfc1035_name(p, hostname, NULL); |
370 | 2356 | if (domain) | 2356 | if (domain) |
371 | 2357 | { | 2357 | { |
373 | 2358 | p = do_rfc1035_name(p, domain); | 2358 | p = do_rfc1035_name(p, domain, NULL); |
374 | 2359 | *p++ = 0; | 2359 | *p++ = 0; |
375 | 2360 | } | 2360 | } |
376 | 2361 | } | 2361 | } |
377 | diff --git a/src/rfc3315.c b/src/rfc3315.c | |||
378 | index 2665d0d..99226a1 100644 | |||
379 | --- a/src/rfc3315.c | |||
380 | +++ b/src/rfc3315.c | |||
381 | @@ -206,6 +206,9 @@ static int dhcp6_maybe_relay(struct state *state, void *inbuff, size_t sz, | |||
382 | 206 | /* RFC-6939 */ | 206 | /* RFC-6939 */ |
383 | 207 | if ((opt = opt6_find(opts, end, OPTION6_CLIENT_MAC, 3))) | 207 | if ((opt = opt6_find(opts, end, OPTION6_CLIENT_MAC, 3))) |
384 | 208 | { | 208 | { |
385 | 209 | if (opt6_len(opt) - 2 > DHCP_CHADDR_MAX) { | ||
386 | 210 | return 0; | ||
387 | 211 | } | ||
388 | 209 | state->mac_type = opt6_uint(opt, 0, 2); | 212 | state->mac_type = opt6_uint(opt, 0, 2); |
389 | 210 | state->mac_len = opt6_len(opt) - 2; | 213 | state->mac_len = opt6_len(opt) - 2; |
390 | 211 | memcpy(&state->mac[0], opt6_ptr(opt, 2), state->mac_len); | 214 | memcpy(&state->mac[0], opt6_ptr(opt, 2), state->mac_len); |
391 | @@ -213,6 +216,9 @@ static int dhcp6_maybe_relay(struct state *state, void *inbuff, size_t sz, | |||
392 | 213 | 216 | ||
393 | 214 | for (opt = opts; opt; opt = opt6_next(opt, end)) | 217 | for (opt = opts; opt; opt = opt6_next(opt, end)) |
394 | 215 | { | 218 | { |
395 | 219 | if (opt6_ptr(opt, 0) + opt6_len(opt) >= end) { | ||
396 | 220 | return 0; | ||
397 | 221 | } | ||
398 | 216 | int o = new_opt6(opt6_type(opt)); | 222 | int o = new_opt6(opt6_type(opt)); |
399 | 217 | if (opt6_type(opt) == OPTION6_RELAY_MSG) | 223 | if (opt6_type(opt) == OPTION6_RELAY_MSG) |
400 | 218 | { | 224 | { |
401 | @@ -1472,10 +1478,10 @@ static struct dhcp_netid *add_options(struct state *state, int do_refresh) | |||
402 | 1472 | if ((p = expand(len + 2))) | 1478 | if ((p = expand(len + 2))) |
403 | 1473 | { | 1479 | { |
404 | 1474 | *(p++) = state->fqdn_flags; | 1480 | *(p++) = state->fqdn_flags; |
406 | 1475 | p = do_rfc1035_name(p, state->hostname); | 1481 | p = do_rfc1035_name(p, state->hostname, NULL); |
407 | 1476 | if (state->send_domain) | 1482 | if (state->send_domain) |
408 | 1477 | { | 1483 | { |
410 | 1478 | p = do_rfc1035_name(p, state->send_domain); | 1484 | p = do_rfc1035_name(p, state->send_domain, NULL); |
411 | 1479 | *p = 0; | 1485 | *p = 0; |
412 | 1480 | } | 1486 | } |
413 | 1481 | } | 1487 | } |
414 | diff --git a/src/util.c b/src/util.c | |||
415 | index 469eaed..b70ad65 100644 | |||
416 | --- a/src/util.c | |||
417 | +++ b/src/util.c | |||
418 | @@ -218,15 +218,20 @@ char *canonicalise(char *in, int *nomem) | |||
419 | 218 | return ret; | 218 | return ret; |
420 | 219 | } | 219 | } |
421 | 220 | 220 | ||
423 | 221 | unsigned char *do_rfc1035_name(unsigned char *p, char *sval) | 221 | unsigned char *do_rfc1035_name(unsigned char *p, char *sval, char *limit) |
424 | 222 | { | 222 | { |
425 | 223 | int j; | 223 | int j; |
426 | 224 | 224 | ||
427 | 225 | while (sval && *sval) | 225 | while (sval && *sval) |
428 | 226 | { | 226 | { |
429 | 227 | if (limit && p + 1 > (unsigned char*)limit) | ||
430 | 228 | return p; | ||
431 | 229 | |||
432 | 227 | unsigned char *cp = p++; | 230 | unsigned char *cp = p++; |
433 | 228 | for (j = 0; *sval && (*sval != '.'); sval++, j++) | 231 | for (j = 0; *sval && (*sval != '.'); sval++, j++) |
434 | 229 | { | 232 | { |
435 | 233 | if (limit && p + 1 > (unsigned char*)limit) | ||
436 | 234 | return p; | ||
437 | 230 | #ifdef HAVE_DNSSEC | 235 | #ifdef HAVE_DNSSEC |
438 | 231 | if (option_bool(OPT_DNSSEC_VALID) && *sval == NAME_ESCAPE) | 236 | if (option_bool(OPT_DNSSEC_VALID) && *sval == NAME_ESCAPE) |
439 | 232 | *p++ = (*(++sval))-1; | 237 | *p++ = (*(++sval))-1; |
440 | diff --git a/trust-anchors.conf b/trust-anchors.conf | |||
441 | index afda518..6f807cf 100644 | |||
442 | --- a/trust-anchors.conf | |||
443 | +++ b/trust-anchors.conf | |||
444 | @@ -1,9 +1,10 @@ | |||
446 | 1 | # The root DNSSEC trust anchor, valid as at 30/01/2014 | 1 | # The root DNSSEC trust anchor, valid as at 10/02/2017 |
447 | 2 | 2 | ||
448 | 3 | # Note that this is a DS record (ie a hash of the root Zone Signing Key) | 3 | # Note that this is a DS record (ie a hash of the root Zone Signing Key) |
449 | 4 | # If was downloaded from https://data.iana.org/root-anchors/root-anchors.xml | 4 | # If was downloaded from https://data.iana.org/root-anchors/root-anchors.xml |
450 | 5 | 5 | ||
451 | 6 | trust-anchor=.,19036,8,2,49AAC11D7B6F6446702E54A1607371607A1A41855200FD2CE1CDDE32F24E8FB5 | 6 | trust-anchor=.,19036,8,2,49AAC11D7B6F6446702E54A1607371607A1A41855200FD2CE1CDDE32F24E8FB5 |
452 | 7 | trust-anchor=.,20326,8,2,E06D44B80B8F1D39A95C0B0D7C65D08458E880409BBC683457104237C7F8EC8D | ||
453 | 7 | 8 | ||
454 | 8 | 9 | ||
455 | 9 | 10 |
FAILED: Continuous integration, rev:25accfdecc8 e2ad5001d341e40 cce2040859018a /jenkins. canonical. com/system- enablement/ job/snappy- hwe-snaps- snap-build- prepare/ 346/ /jenkins. canonical. com/system- enablement/ job/snappy- hwe-snaps- snap-build/ ARCHITECTURE= amd64/382/ console /jenkins. canonical. com/system- enablement/ job/snappy- hwe-snaps- snap-build/ ARCHITECTURE= arm64/382 /jenkins. canonical. com/system- enablement/ job/snappy- hwe-snaps- snap-build/ ARCHITECTURE= armhf/382 /jenkins. canonical. com/system- enablement/ job/snappy- hwe-snaps- snap-build/ ARCHITECTURE= i386/382 /jenkins. canonical. com/system- enablement/ job/snappy- hwe-snaps- snap-docs/ 1174 /jenkins. canonical. com/system- enablement/ job/snappy- hwe-snaps- snap-cleanup/ 916 /jenkins. canonical. com/system- enablement/ job/snappy- hwe-snaps- snap-update- mp/959/ console
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
None: https:/
Click here to trigger a rebuild: /jenkins. canonical. com/system- enablement/ job/snappy- hwe-snaps- snap-build- prepare/ 346/rebuild
https:/