qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-block] [PATCH] nvme: fix identify to be NVMe 1.1 compliant


From: Christoph Hellwig
Subject: Re: [Qemu-block] [PATCH] nvme: fix identify to be NVMe 1.1 compliant
Date: Tue, 17 Nov 2015 18:56:24 +0100
User-agent: Mutt/1.5.17 (2007-11-01)

On Tue, Nov 17, 2015 at 05:41:04PM +0000, Keith Busch wrote:
> 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);

Oh yes, І'll need to fix that up.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]