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: <20200305124255.GW24458@Air-de-Roger.citrite.net>
Date:   Thu, 5 Mar 2020 13:42:55 +0100
From:   Roger Pau Monné <roger.pau@...rix.com>
To:     Juergen Gross <jgross@...e.com>
CC:     <xen-devel@...ts.xenproject.org>, <linux-block@...r.kernel.org>,
        <linux-kernel@...r.kernel.org>,
        Boris Ostrovsky <boris.ostrovsky@...cle.com>,
        Stefano Stabellini <sstabellini@...nel.org>,
        Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>,
        Jens Axboe <axboe@...nel.dk>
Subject: Re: [PATCH v2] xen/blkfront: fix ring info addressing

On Thu, Mar 05, 2020 at 12:40:44PM +0100, Juergen Gross wrote:
> Commit 0265d6e8ddb890 ("xen/blkfront: limit allocated memory size to
> actual use case") made struct blkfront_ring_info size dynamic. This is
> fine when running with only one queue, but with multiple queues the
> addressing of the single queues has to be adapted as the structs are
> allocated in an array.
> 
> Fixes: 0265d6e8ddb890 ("xen/blkfront: limit allocated memory size to actual use case")
> Reported-by: Sander Eikelenboom <linux@...elenboom.it>
> Signed-off-by: Juergen Gross <jgross@...e.com>
> ---
> V2:
> - get rid of rinfo_ptr() helper
> - use proper parenthesis in for_each_rinfo()
> - rename rinfo parameter of for_each_rinfo()
> ---
>  drivers/block/xen-blkfront.c | 79 +++++++++++++++++++++++---------------------
>  1 file changed, 42 insertions(+), 37 deletions(-)
> 
> diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
> index e2ad6bba2281..8e844da826db 100644
> --- a/drivers/block/xen-blkfront.c
> +++ b/drivers/block/xen-blkfront.c
> @@ -213,6 +213,7 @@ struct blkfront_info
>  	struct blk_mq_tag_set tag_set;
>  	struct blkfront_ring_info *rinfo;
>  	unsigned int nr_rings;
> +	unsigned int rinfo_size;
>  	/* Save uncomplete reqs and bios for migration. */
>  	struct list_head requests;
>  	struct bio_list bio_list;
> @@ -259,6 +260,18 @@ static int blkfront_setup_indirect(struct blkfront_ring_info *rinfo);
>  static void blkfront_gather_backend_features(struct blkfront_info *info);
>  static int negotiate_mq(struct blkfront_info *info);
>  
> +#define for_each_rinfo(info, ptr, idx)				\
> +	for ((ptr) = (info)->rinfo, (idx) = 0;			\
> +	     (idx) < (info)->nr_rings;				\
> +	     (idx)++, (ptr) = (void *)(ptr) + (info)->rinfo_size)
> +
> +static struct blkfront_ring_info *get_rinfo(struct blkfront_info *info,

I still think inline should be added here, but I don't have such a
strong opinion to block the patch on it.

Also, info should be constified AFAICT.

With at least info constified:

Acked-by: Roger Pau Monné <roger.pau@...rix.com>

Can you queue this through the Xen tree?

Thanks, Roger.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ