lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.00.1205091849580.26786@kaball-desktop>
Date:	Wed, 9 May 2012 19:42:33 +0100
From:	Stefano Stabellini <stefano.stabellini@...citrix.com>
To:	Stefano Stabellini <Stefano.Stabellini@...citrix.com>
CC:	Konrad Rzeszutek Wilk <konrad@...nok.org>,
	Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>,
	"xen-devel@...ts.xensource.com" <xen-devel@...ts.xensource.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [Xen-devel] [PATCH v3] xen-blkfront: set pages are FOREIGN_FRAME
 when sharing them

On Tue, 8 May 2012, Stefano Stabellini wrote:
> I have been unable to reproduce this problem (I haven't given up yet)
> but I bet that the following patch fixes it:
> 
> 
> diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
> index e3a9945..88e9304 100644
> --- a/drivers/block/xen-blkfront.c
> +++ b/drivers/block/xen-blkfront.c
> @@ -333,7 +333,7 @@ static int blkif_queue_request(struct request *req)
>  					buffer_mfn,
>  					rq_data_dir(req));
>  
> -			info->shadow[id].frame[i] = mfn_to_pfn(buffer_mfn);
> +			info->shadow[id].frame[i] = buffer_pfn;
>  			ring_req->u.rw.seg[i] =
>  					(struct blkif_request_segment) {
>  						.gref       = ref,
> 
> 
> The idea is that the request contains a page for which
> 
> pfn->mfn->pfn == 0xffffffffffffffff
> 
> I am not sure exactly how it could be possible to get into this state in
> blkfront, I hope that some more tracing and code reading will be able to
> shed some lights on the issue.

The one line patch fixes the issue: when using LVM in the guest the same
page can be used in two different requests (in blkif_queue_request)
before being unmapped.
The second time mfn_to_pfn is going to return ~0 because buffer_mfn has
the FOREIGN_FRAME_BIT set.
But actually we don't need to call mfn_to_pfn at all because we already
know the pfn value, that is stored in buffer_pfn.

However the real problem remains at the time of blkif_completion: we
will remove the FOREIGN_FRAME_BIT before the other requests have been
completed.

If sharing the same page twice (or more) is a normal condition then I
might have to revisit this patch completely and choose another
strategy...
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ