]> git.proxmox.com Git - pve-qemu-kvm.git/blame - debian/patches/extra/CVE-2016-7157-scsi-mptconfig-fix-an-assert-expression.patch
update to 2.7
[pve-qemu-kvm.git] / debian / patches / extra / CVE-2016-7157-scsi-mptconfig-fix-an-assert-expression.patch
CommitLineData
68a30562
WB
1From a0e2a28c08472ad3468c2f75d20fe1ca02ef8c0b Mon Sep 17 00:00:00 2001
2From: Prasad J Pandit <pjp@fedoraproject.org>
3Date: Wed, 31 Aug 2016 17:36:07 +0530
4Subject: [PATCH 6/6] scsi: mptconfig: fix an assert expression
5
6When LSI SAS1068 Host Bus emulator builds configuration page
7headers, mptsas_config_pack() should assert that the size
8fits in a byte. However, the size is expressed in 32-bit
9units, so up to 1020 bytes fit. The assertion was only
10allowing replies up to 252 bytes, so fix it.
11
12Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
13Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
14Message-Id: <1472645167-30765-2-git-send-email-ppandit@redhat.com>
15Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
16---
17 hw/scsi/mptconfig.c | 2 +-
18 1 file changed, 1 insertion(+), 1 deletion(-)
19
20diff --git a/hw/scsi/mptconfig.c b/hw/scsi/mptconfig.c
21index 7071854..3e4f400 100644
22--- a/hw/scsi/mptconfig.c
23+++ b/hw/scsi/mptconfig.c
24@@ -158,7 +158,7 @@ static size_t mptsas_config_pack(uint8_t **data, const char *fmt, ...)
25 va_end(ap);
26
27 if (data) {
28- assert(ret < 256 && (ret % 4) == 0);
29+ assert(ret / 4 < 256 && (ret % 4) == 0);
30 stb_p(*data + 1, ret / 4);
31 }
32 return ret;
33--
342.1.4
35