qemu/0072-slirp-check-len-against-dhcp-option.patch
Bruce Rogers 481686d650 Accepting request 512570 from home:bfrogers:branches:Virtualization
Include latest security fixes. Also fix support statements. Also adjust to recent libvdeplug-devel package name change.

OBS-URL: https://build.opensuse.org/request/show/512570
OBS-URL: https://build.opensuse.org/package/show/Virtualization/qemu?expand=0&rev=350
2017-07-25 20:21:37 +00:00

34 lines
1.1 KiB
Diff

From 9ba94af263d7c64137cc748abd9cf3c23e07decc Mon Sep 17 00:00:00 2001
From: P J P <ppandit@redhat.com>
Date: Tue, 25 Jul 2017 13:34:29 -0600
Subject: [PATCH] slirp: check len against dhcp options array end
From: Prasad J Pandit <pjp@fedoraproject.org>
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.
Reported-by: Reno Robert <renorobert@gmail.com>
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
[BR: BSC#1049381 CVE-2017-11434]
Signed-off-by: Bruce Rogers <brogers@suse.com>
---
slirp/bootp.c | 3 +++
1 file changed, 3 insertions(+)
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) {