qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: P J P <ppandit@redhat.com>
To: Alexander Bulekov <alxndr@bu.edu>
Cc: "Fam Zheng" <fam@euphon.net>,
	"QEMU Developers" <qemu-devel@nongnu.org>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Ren Ding" <rding@gatech.edu>,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>,
	"Philippe Mathieu-Daudé" <philmd@redhat.com>
Subject: Re: [PATCH 0/2] use unsigned type for MegasasState fields
Date: Wed, 13 May 2020 16:43:51 +0530 (IST)	[thread overview]
Message-ID: <nycvar.YSQ.7.76.2005131641440.1451610@xnncv> (raw)
In-Reply-To: <20200512194759.nb42yurlnynr5yrw@mozz.bu.edu>

  Hello Alex,

+-- On Tue, 12 May 2020, Alexander Bulekov wrote --+
| ==20527==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x7f79f968a5e0 at pc 0x55b6bb84ce28 bp 0x7ffcbca04eb0 sp 0x7ffcbca04ea8
| READ of size 8 at 0x7f79f968a5e0 thread T0
| 
| #0 0x55fbeb2bdafc in megasas_lookup_frame /home/alxndr/Development/qemu-bugs/qemu2/qemu/hw/scsi/megasas.c:449:30
| #1 0x55fbeb27caa9 in megasas_handle_abort /home/alxndr/Development/qemu-bugs/qemu2/qemu/hw/scsi/megasas.c:1904:17
| #2 0x55fbeb26cb77 in megasas_handle_frame /home/alxndr/Development/qemu-bugs/qemu2/qemu/hw/scsi/megasas.c:1961:24
| #3 0x55fbeb267b78 in megasas_mmio_write /home/alxndr/Development/qemu-bugs/qemu2/qemu/hw/scsi/megasas.c:2122:9
| #4 0x55fbe90b117b in memory_region_write_accessor /home/alxndr/Development/qemu-bugs/qemu2/qemu/memory.c:496:5
| #5 0x55fbe90b05e4 in access_with_adjusted_size /home/alxndr/Development/qemu-bugs/qemu2/qemu/memory.c:557:18
| #6 0x55fbe90ae177 in memory_region_dispatch_write /home/alxndr/Development/qemu-bugs/qemu2/qemu/memory.c:1488:16
| #7 0x55fbe8d97325 in flatview_write_continue /home/alxndr/Development/qemu-bugs/qemu2/qemu/exec.c:3174:23
| 
| Fixed reproducer (tested on qemu 5.0 built with ASAN with these patches):
| 
| cat << EOF | qemu-system-i386 -qtest stdio -nographic -monitor none \
| -serial none -M q35 -device megasas -device scsi-cd,drive=null0 \
| -blockdev driver=null-co,read-zeroes=on,node-name=null0 -nographic
| outl 0xcf8 0x80001814
| outl 0xcfc 0xc021
| outl 0xcf8 0x80001818
| outl 0xcf8 0x80001804
| outw 0xcfc 0x7
| outl 0xcf8 0x80001810
| outl 0xcfc 0xe10c0000
| outl 0xcf8 0x8000f810
| write 0x0 0x18 0x060017e1ff00f8ffffffff60efffffffffffffffffffffff
| write 0xff00 0x1 0x06
| write 0xc021e10c0040 0x81 0x755e08ff0000845e08ff0000935e08ff0000a25e08ff0000b15e08ff0000c05e08ff0000cf5e08ff0000de5e08ff0000ed5e08ff0000fc5e08ff00000b5e08ff00001a5e08ff0000295e08ff0000385e08ff0000475e08ff0000565e08ff0000655e08ff0000745e08ff0000835e08ff0000925e08ff0000a15e08ff0000b05e08
| -M pc-q35-5.0 -no-shutdown -M q35 -device megasas -device scsi-cd,drive=null0 -blockdev driver=null-co,read-zeroes=on,node-name=null0 -nographic

Thanks much for this, will try it.

Thank you.
--
Prasad J Pandit / Red Hat Product Security Team
8685 545E B54C 486B C6EB 271E E285 8B5A F050 DE8D



  parent reply	other threads:[~2020-05-13 11:30 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-07 10:57 [PATCH 0/2] use unsigned type for MegasasState fields P J P
2020-05-07 10:57 ` [PATCH 1/2] megasas: use unsigned type for reply_queue_head P J P
2020-05-12 18:52   ` Peter Maydell
2020-05-13 11:20     ` P J P
2020-05-07 10:57 ` [PATCH 2/2] megasas: use unsigned type for positive numeric fields P J P
2020-05-12 18:53   ` Peter Maydell
2020-05-13 11:22     ` P J P
2020-05-12 12:21 ` [PATCH 0/2] use unsigned type for MegasasState fields P J P
2020-05-12 13:42 ` Philippe Mathieu-Daudé
2020-05-12 18:37   ` P J P
2020-05-12 19:08     ` Alexander Bulekov
2020-05-12 19:48       ` Alexander Bulekov
2020-05-12 20:59         ` Philippe Mathieu-Daudé
2020-05-12 21:00           ` Alexander Bulekov
2020-05-13 11:13         ` P J P [this message]
2020-05-13 13:49         ` P J P
2020-05-13 14:20           ` Alexander Bulekov
2020-05-13 14:53             ` P J P
2020-05-13 17:08               ` Ding, Ren
2020-05-13 19:34                 ` P J P
2020-05-13 14:53           ` Alexander Bulekov
     [not found]     ` <BN6PR07MB341283EBBF78F86AAA995382CABE0@BN6PR07MB3412.namprd07.prod.outlook.com>
2020-05-12 20:54       ` 回复: " Philippe Mathieu-Daudé
2020-05-13 11:07         ` P J P

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=nycvar.YSQ.7.76.2005131641440.1451610@xnncv \
    --to=ppandit@redhat.com \
    --cc=alxndr@bu.edu \
    --cc=fam@euphon.net \
    --cc=marcandre.lureau@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=philmd@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rding@gatech.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).