From: P J P <ppandit@redhat.com>
To: Qemu Developers <qemu-devel@nongnu.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>, YY Z <bigbird475958471@gmail.com>
Subject: Re: [Qemu-devel] [PATCH] scsi: avoid an off-by-one error in megasas_mmio_write
Date: Fri, 28 Apr 2017 14:05:01 +0530 (IST) [thread overview]
Message-ID: <alpine.LFD.2.20.1704281403310.29240@wniryva> (raw)
In-Reply-To: <20170424120634.12268-1-ppandit@redhat.com>
+-- On Mon, 24 Apr 2017, P J P wrote --+
| While reading magic sequence(MFI_SEQ) in megasas_mmio_write,
| an off-by-one error could occur as 's->adp_reset' index is not
| reset after reading the last sequence.
|
| --- a/hw/scsi/megasas.c
| +++ b/hw/scsi/megasas.c
| @@ -2138,15 +2138,15 @@ static void megasas_mmio_write(void *opaque, hwaddr addr,
| case MFI_SEQ:
| trace_megasas_mmio_writel("MFI_SEQ", val);
| /* Magic sequence to start ADP reset */
| - if (adp_reset_seq[s->adp_reset] == val) {
| - s->adp_reset++;
| + if (adp_reset_seq[s->adp_reset++] == val) {
| + if (s->adp_reset == 6) {
| + s->adp_reset = 0;
| + s->diag = MFI_DIAG_WRITE_ENABLE;
| + }
| } else {
| s->adp_reset = 0;
| s->diag = 0;
| }
| - if (s->adp_reset == 6) {
| - s->diag = MFI_DIAG_WRITE_ENABLE;
| - }
| break;
Ping...!
--
Prasad J Pandit / Red Hat Product Security Team
47AF CE69 3A90 54AA 9045 1053 DD13 3D32 FE5B 041F
next prev parent reply other threads:[~2017-04-28 8:35 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-24 12:06 [Qemu-devel] [PATCH] scsi: avoid an off-by-one error in megasas_mmio_write P J P
2017-04-28 8:35 ` P J P [this message]
2017-04-28 9:54 ` Paolo Bonzini
2017-04-28 11:03 ` 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=alpine.LFD.2.20.1704281403310.29240@wniryva \
--to=ppandit@redhat.com \
--cc=bigbird475958471@gmail.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/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).