qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Alexander Graf <agraf@suse.de>
To: P J P <ppandit@redhat.com>, Qemu Developers <qemu-devel@nongnu.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>, Li Qiang <liqiang6-s@360.cn>,
	Hannes Reinecke <hare@suse.de>,
	Prasad J Pandit <pjp@fedoraproject.org>
Subject: Re: [Qemu-devel] [PATCH 1/3] scsi: megasas: use appropriate property buffer size
Date: Wed, 25 May 2016 13:06:36 +0200	[thread overview]
Message-ID: <5745873C.90400@suse.de> (raw)
In-Reply-To: <1464172291-2856-2-git-send-email-ppandit@redhat.com>

On 05/25/2016 12:31 PM, P J P wrote:
> From: Prasad J Pandit <pjp@fedoraproject.org>
>
> When setting MegaRAID SAS controller properties via MegaRAID
> Firmware Interface(MFI) commands, a user supplied size parameter
> is used to set property value. Use appropriate size value to avoid
> OOB access issues.
>
> Reported-by: Li Qiang <liqiang6-s@360.cn>
> Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
> ---
>   hw/scsi/megasas.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/hw/scsi/megasas.c b/hw/scsi/megasas.c
> index a63a581..dcbd3e1 100644
> --- a/hw/scsi/megasas.c
> +++ b/hw/scsi/megasas.c
> @@ -1446,7 +1446,7 @@ static int megasas_dcmd_set_properties(MegasasState *s, MegasasCmd *cmd)
>                                               dcmd_size);
>           return MFI_STAT_INVALID_PARAMETER;
>       }
> -    dma_buf_write((uint8_t *)&info, cmd->iov_size, &cmd->qsg);
> +    dma_buf_write((uint8_t *)&info, dcmd_size, &cmd->qsg);

This looks odd - can dcmd_size be bigger than iov_size? Wouldn't we 
overwrite guest memory then? And where does dcmd_size come from? I don't 
see it in master.


Alex

>       trace_megasas_dcmd_unsupported(cmd->index, cmd->iov_size);
>       return MFI_STAT_OK;
>   }

  reply	other threads:[~2016-05-25 11:06 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-25 10:31 [Qemu-devel] [PATCH 0/3] Qemu: scsi: megasas: various OOB r/w access checks P J P
2016-05-25 10:31 ` [Qemu-devel] [PATCH 1/3] scsi: megasas: use appropriate property buffer size P J P
2016-05-25 11:06   ` Alexander Graf [this message]
2016-05-25 11:51     ` P J P
2016-05-25 11:53       ` Alexander Graf
2016-05-25 12:15         ` P J P
2016-05-25 12:30           ` Alexander Graf
2016-05-25 10:31 ` [Qemu-devel] [PATCH 2/3] scsi: megasas: initialise local configuration data buffer P J P
2016-05-25 11:15   ` Alexander Graf
2016-05-25 10:31 ` [Qemu-devel] [PATCH 3/3] scsi: megasas: check 'read_queue_head' index value P J P
2016-05-25 11:20   ` Alexander Graf
2016-05-25 13:21     ` Hannes Reinecke
2016-05-25 12:00 ` [Qemu-devel] [PATCH 0/3] Qemu: scsi: megasas: various OOB r/w access checks Paolo Bonzini
2016-05-25 12:08   ` Alexander Graf

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=5745873C.90400@suse.de \
    --to=agraf@suse.de \
    --cc=hare@suse.de \
    --cc=liqiang6-s@360.cn \
    --cc=pbonzini@redhat.com \
    --cc=pjp@fedoraproject.org \
    --cc=ppandit@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).