From: Prasad J Pandit Date: Mon, 17 Jul 2017 12:03:26 +0000 (+0530) Subject: slirp: check len against dhcp options array end X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=413d463f43fbc4dd3a601e80a5724aa384a265a0;p=qemu.git slirp: check len against dhcp options array end While parsing dhcp options string in 'dhcp_decode', if an options' length 'len' appeared towards the end of 'bp_vend' array, ensuing read could lead to an OOB memory access issue. Add check to avoid it. This is CVE-2017-11434. Reported-by: Reno Robert Signed-off-by: Prasad J Pandit Signed-off-by: Samuel Thibault --- diff --git a/slirp/bootp.c b/slirp/bootp.c index 5a4646c182..5dd1a415b5 100644 --- a/slirp/bootp.c +++ b/slirp/bootp.c @@ -123,6 +123,9 @@ static void dhcp_decode(const struct bootp_t *bp, int *pmsg_type, if (p >= p_end) break; len = *p++; + if (p + len > p_end) { + break; + } DPRINTF("dhcp: tag=%d len=%d\n", tag, len); switch(tag) {