]> 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)
committerLennart Poettering <lennart@poettering.net>
Thu, 25 Oct 2018 09:23:19 +0000 (11:23 +0200)
Fixes a vulnerability originally discovered by Felix Wilhelm from
Google.

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

src/libsystemd-network/dhcp6-option.c

index cbd4bc7a2a34989b20707dfa0559325850043cec..2806415100c9aa880fbfd411446cd0e2e18b7eff 100644 (file)
@@ -106,7 +106,7 @@ int dhcp6_option_append_ia(uint8_t **buf, size_t *buflen, const DHCP6IA *ia) {
                 return -EINVAL;
         }
 
-        if (*buflen < len)
+        if (*buflen < offsetof(DHCP6Option, data) + len)
                 return -ENOBUFS;
 
         ia_hdr = *buf;