OSDN Git Service

slirp: check len against dhcp options array end
authorPrasad J Pandit <pjp@fedoraproject.org>
Mon, 17 Jul 2017 12:03:26 +0000 (17:33 +0530)
committerSamuel Thibault <samuel.thibault@ens-lyon.org>
Wed, 2 Aug 2017 22:26:44 +0000 (00:26 +0200)
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 <renorobert@gmail.com>
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
slirp/bootp.c

index 5a4646c..5dd1a41 100644 (file)
@@ -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) {