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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Wed, 11 Dec 2019 14:46:11 +0000
From:   "Durrant, Paul" <pdurrant@...zon.com>
To:     "Durrant, Paul" <pdurrant@...zon.com>,
        Roger Pau Monné <roger.pau@...rix.com>
CC:     Jens Axboe <axboe@...nel.dk>, Juergen Gross <jgross@...e.com>,
        "Stefano Stabellini" <sstabellini@...nel.org>,
        Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "xen-devel@...ts.xenproject.org" <xen-devel@...ts.xenproject.org>,
        Boris Ostrovsky <boris.ostrovsky@...cle.com>
Subject: RE: [PATCH v2 4/4] xen-blkback: support dynamic unbind/bind

> -----Original Message-----
> > > diff --git a/drivers/block/xen-blkback/xenbus.c b/drivers/block/xen-
> > blkback/xenbus.c
> > > index e8c5c54e1d26..13d09630b237 100644
> > > --- a/drivers/block/xen-blkback/xenbus.c
> > > +++ b/drivers/block/xen-blkback/xenbus.c
> > > @@ -181,6 +181,8 @@ static int xen_blkif_map(struct xen_blkif_ring
> > *ring, grant_ref_t *gref,
> > >  {
> > >  	int err;
> > >  	struct xen_blkif *blkif = ring->blkif;
> > > +	struct blkif_common_sring *sring_common;
> > > +	RING_IDX rsp_prod, req_prod;
> > >
> > >  	/* Already connected through? */
> > >  	if (ring->irq)
> > > @@ -191,46 +193,66 @@ static int xen_blkif_map(struct xen_blkif_ring
> > *ring, grant_ref_t *gref,
> > >  	if (err < 0)
> > >  		return err;
> > >
> > > +	sring_common = (struct blkif_common_sring *)ring->blk_ring;
> > > +	rsp_prod = READ_ONCE(sring_common->rsp_prod);
> > > +	req_prod = READ_ONCE(sring_common->req_prod);
> > > +
> > >  	switch (blkif->blk_protocol) {
> > >  	case BLKIF_PROTOCOL_NATIVE:
> > >  	{
> > > -		struct blkif_sring *sring;
> > > -		sring = (struct blkif_sring *)ring->blk_ring;
> > > -		BACK_RING_INIT(&ring->blk_rings.native, sring,
> > > -			       XEN_PAGE_SIZE * nr_grefs);
> > > +		struct blkif_sring *sring_native =
> > > +			(struct blkif_sring *)ring->blk_ring;
> >
> > I think you can constify both sring_native and sring_common (and the
> > other instances below).
> 
> Yes, I can do that. I don't think the macros would mind.
> 

Spoke to soon. They do mind, of course, because the sring pointer in the front/back ring is not (and should not) be const. I can const sring_common but no others.

  Paul

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ