Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP2:GA
qemu-testsuite.3274
0109-scsi-megasas-check-read_queue_head-.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0109-scsi-megasas-check-read_queue_head-.patch of Package qemu-testsuite.3274
From 39845dba438bbc42a409f301013844cbc7827856 Mon Sep 17 00:00:00 2001 From: Prasad J Pandit <pjp@fedoraproject.org> Date: Wed, 25 May 2016 17:55:10 +0530 Subject: [PATCH] scsi: megasas: check 'read_queue_head' index value While doing MegaRAID SAS controller command frame lookup, routine 'megasas_lookup_frame' uses 'read_queue_head' value as an index into 'frames[MEGASAS_MAX_FRAMES=2048]' array. Limit its value within array bounds to avoid any OOB access. Reported-by: Li Qiang <liqiang6-s@360.cn> Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org> Message-Id: <1464179110-18593-1-git-send-email-ppandit@redhat.com> Reviewed-by: Alexander Graf <agraf@suse.de> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> (cherry picked from commit b60bdd1f1ee1616b7a9aeeffb4088e1ce2710fb2) [BR: CVE-2016-5107 BSC#982019] Signed-off-by: Bruce Rogers <brogers@suse.com> --- hw/scsi/megasas.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/scsi/megasas.c b/hw/scsi/megasas.c index c746a7e..bcb1a0c 100644 --- a/hw/scsi/megasas.c +++ b/hw/scsi/megasas.c @@ -649,7 +649,9 @@ static int megasas_init_firmware(MegasasState *s, MegasasCmd *cmd) pa_hi = le32_to_cpu(initq->pi_addr_hi); s->producer_pa = ((uint64_t) pa_hi << 32) | pa_lo; s->reply_queue_head = ldl_le_pci_dma(pcid, s->producer_pa); + s->reply_queue_head %= MEGASAS_MAX_FRAMES; s->reply_queue_tail = ldl_le_pci_dma(pcid, s->consumer_pa); + s->reply_queue_tail %= MEGASAS_MAX_FRAMES; flags = le32_to_cpu(initq->flags); if (flags & MFI_QUEUE_FLAG_CONTEXT64) { s->flags |= MEGASAS_MASK_USE_QUEUE64;
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor