daandemeyer / rpms / systemd

Forked from rpms/systemd 2 years ago
Clone
ff6046
From c232bc1f346a6af9777c216d01f7940898ae1650 Mon Sep 17 00:00:00 2001
ff6046
From: Lennart Poettering <lennart@poettering.net>
ff6046
Date: Fri, 19 Oct 2018 12:12:33 +0200
ff6046
Subject: [PATCH] dhcp6: make sure we have enough space for the DHCP6 option
ff6046
 header
ff6046
ff6046
Fixes a vulnerability originally discovered by Felix Wilhelm from
ff6046
Google.
ff6046
ff6046
CVE-2018-15688
ff6046
LP: #1795921
ff6046
https://bugzilla.redhat.com/show_bug.cgi?id=1639067
ff6046
ff6046
(cherry-picked from commit 4dac5eaba4e419b29c97da38a8b1f82336c2c892)
ff6046
ff6046
Resolves: #1643363
ff6046
---
ff6046
 src/libsystemd-network/dhcp6-option.c | 2 +-
ff6046
 1 file changed, 1 insertion(+), 1 deletion(-)
ff6046
ff6046
diff --git a/src/libsystemd-network/dhcp6-option.c b/src/libsystemd-network/dhcp6-option.c
ff6046
index 18196b1257..0979497299 100644
ff6046
--- a/src/libsystemd-network/dhcp6-option.c
ff6046
+++ b/src/libsystemd-network/dhcp6-option.c
ff6046
@@ -103,7 +103,7 @@ int dhcp6_option_append_ia(uint8_t **buf, size_t *buflen, DHCP6IA *ia) {
ff6046
                 return -EINVAL;
ff6046
         }
ff6046
 
ff6046
-        if (*buflen < len)
ff6046
+        if (*buflen < offsetof(DHCP6Option, data) + len)
ff6046
                 return -ENOBUFS;
ff6046
 
ff6046
         ia_hdr = *buf;