[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1327bf3a-f5cf-6e1f-1a0e-e55aeabf787d@suse.com>
Date: Fri, 23 Apr 2021 10:04:00 +0200
From: Juergen Gross <jgross@...e.com>
To: Paul Durrant <paul@....org>, xen-devel@...ts.xenproject.org,
linux-block@...r.kernel.org, linux-kernel@...r.kernel.org
Cc: Paul Durrant <pdurrant@...zon.com>,
Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>,
Jens Axboe <axboe@...nel.dk>
Subject: Re: [PATCH v3] xen-blkback: fix compatibility bug with single page
rings
On 02.02.21 18:56, Paul Durrant wrote:
> From: Paul Durrant <pdurrant@...zon.com>
>
> Prior to commit 4a8c31a1c6f5 ("xen/blkback: rework connect_ring() to avoid
> inconsistent xenstore 'ring-page-order' set by malicious blkfront"), the
> behaviour of xen-blkback when connecting to a frontend was:
>
> - read 'ring-page-order'
> - if not present then expect a single page ring specified by 'ring-ref'
> - else expect a ring specified by 'ring-refX' where X is between 0 and
> 1 << ring-page-order
>
> This was correct behaviour, but was broken by the afforementioned commit to
> become:
>
> - read 'ring-page-order'
> - if not present then expect a single page ring (i.e. ring-page-order = 0)
> - expect a ring specified by 'ring-refX' where X is between 0 and
> 1 << ring-page-order
> - if that didn't work then see if there's a single page ring specified by
> 'ring-ref'
>
> This incorrect behaviour works most of the time but fails when a frontend
> that sets 'ring-page-order' is unloaded and replaced by one that does not
> because, instead of reading 'ring-ref', xen-blkback will read the stale
> 'ring-ref0' left around by the previous frontend will try to map the wrong
> grant reference.
>
> This patch restores the original behaviour.
>
> Fixes: 4a8c31a1c6f5 ("xen/blkback: rework connect_ring() to avoid inconsistent xenstore 'ring-page-order' set by malicious blkfront")
> Signed-off-by: Paul Durrant <pdurrant@...zon.com>
> Reviewed-by: Dongli Zhang <dongli.zhang@...cle.com>
> Reviewed-by: "Roger Pau Monné" <roger.pau@...rix.com>
Pushed to xen/tip.git for-linus-5.13
Juergen
Download attachment "OpenPGP_0xB0DE9DD628BF132F.asc" of type "application/pgp-keys" (3092 bytes)
Download attachment "OpenPGP_signature" of type "application/pgp-signature" (496 bytes)
Powered by blists - more mailing lists