All of lore.kernel.org
 help / color / mirror / Atom feed
From: Keith Busch <keith.busch@intel.com>
To: Christoph Hellwig <hch@lst.de>
Cc: "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	"qemu-block@nongnu.org" <qemu-block@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH] nvme: fix identify to be NVMe 1.1 compliant
Date: Tue, 17 Nov 2015 17:41:04 +0000	[thread overview]
Message-ID: <20151117174104.GA22112@localhost.localdomain> (raw)
In-Reply-To: <B58D82457FDA0744A320A2FC5AC253B93D37D0AC@fmsmsx104.amr.corp.intel.com>

On Tue, Nov 17, 2015 at 09:33:11AM -0800, Busch, Keith wrote:
> I accidently deleted my comment. Here's what it said:
> 
> +    list = g_malloc(data_len);
> +    for (i = 0; i < n->num_namespaces; i++) {
> +        if (i <= min_nsid) {
> +            continue;
> +        }
> +        list[i] = i;
> 
> This should be:
> 
> +        list[i] = cpu_to_le32(i);

Just saw this: we can't use the raw 'i' for the list index. It could
return a badly formatted list if min_nsid is non-zero, or, even worse,
corrupt memory if num_namsepaces > 1024. Need to do this instead:

+        list[i - min_nsid] = cpu_to_le32(i);

  reply	other threads:[~2015-11-17 17:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-17 13:08 [Qemu-devel] (no subject) Christoph Hellwig
2015-11-17 13:08 ` [Qemu-devel] [PATCH] nvme: fix identify to be NVMe 1.1 compliant Christoph Hellwig
2015-11-17 17:25   ` Keith Busch
2015-11-17 17:33     ` Busch, Keith
2015-11-17 17:41       ` Keith Busch [this message]
2015-11-17 17:56         ` Christoph Hellwig
2015-11-17 17:29 ` [Qemu-devel] (no subject) Paolo Bonzini

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=20151117174104.GA22112@localhost.localdomain \
    --to=keith.busch@intel.com \
    --cc=hch@lst.de \
    --cc=qemu-block@nongnu.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.