]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
dhcp6: make sure we have enough space for the DHCP6 option header
authorLennart Poettering <lennart@poettering.net>
Fri, 19 Oct 2018 10:12:33 +0000 (12:12 +0200)
committerLukáš Nykrýn <lnykryn@redhat.com>
Tue, 4 Dec 2018 12:16:10 +0000 (13:16 +0100)
Fixes a vulnerability originally discovered by Felix Wilhelm from
Google.

CVE-2018-15688
LP: #1795921
https://bugzilla.redhat.com/show_bug.cgi?id=1639067

(cherry-picked from commit 4dac5eaba4e419b29c97da38a8b1f82336c2c892)

Resolves: #1643363

src/libsystemd-network/dhcp6-option.c

index 18196b12573cd44d86de0cef3030864b0c2a189c..09794972991f53bf435ae171a6c0748cd09b7aa1 100644 (file)
@@ -103,7 +103,7 @@ int dhcp6_option_append_ia(uint8_t **buf, size_t *buflen, DHCP6IA *ia) {
                 return -EINVAL;
         }
 
-        if (*buflen < len)
+        if (*buflen < offsetof(DHCP6Option, data) + len)
                 return -ENOBUFS;
 
         ia_hdr = *buf;