[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20181218094754.dcja5rr7qlprscmp@mac>
Date: Tue, 18 Dec 2018 10:47:54 +0100
From: Roger Pau Monné <roger.pau@...rix.com>
To: Dongli Zhang <dongli.zhang@...cle.com>
CC: <axboe@...nel.dk>, <konrad.wilk@...cle.com>,
<linux-kernel@...r.kernel.org>, <linux-block@...r.kernel.org>,
<paul.durrant@...rix.com>, <xen-devel@...ts.xenproject.org>
Subject: Re: [Xen-devel] [PATCH v2 1/1] xen/blkback: rework connect_ring() to
avoid inconsistent xenstore 'ring-page-order' set by malicious blkfront
On Tue, Dec 18, 2018 at 10:33:00AM +0100, Roger Pau Monné wrote:
> On Tue, Dec 18, 2018 at 08:55:38AM +0800, Dongli Zhang wrote:
> > + for (i = 0; i < nr_grefs; i++) {
> > + char ring_ref_name[RINGREF_NAME_LEN];
> > +
> > + snprintf(ring_ref_name, RINGREF_NAME_LEN, "ring-ref%u", i);
> > + err = xenbus_scanf(XBT_NIL, dir, ring_ref_name,
> > + "%u", &ring_ref[i]);
> > +
> > + if (err != 1 && (i || (!i && nr_grefs > 1))) {
>
> AFAICT the above condition can be simplified as "err != 1 &&
> nr_grefs".
Sorry, this should be "err != 1 && nr_grefs > 1", since it's not order
but rather the number of grefs.
Roger.
Powered by blists - more mailing lists