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] [day] [month] [year] [list]
Date:	Thu, 7 Jul 2016 11:40:39 +0200
From:	Roger Pau Monne <roger.pau@...rix.com>
To:	Jan Beulich <JBeulich@...e.com>
CC:	Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>,
	<xen-devel@...ts.xenproject.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] xen-blkfront: prefer xenbus_scanf() over xenbus_gather()

On Thu, Jul 07, 2016 at 02:05:46AM -0600, Jan Beulich wrote:
> ... for single items being collected: It is more typesafe (as the
> compiler can check format string and to-be-written-to variable match)
> and requires one less parameter to be passed.
> 
> Signed-off-by: Jan Beulich <jbeulich@...e.com>

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

> ---
>  drivers/block/xen-blkfront.c |   43 +++++++++++++++++++------------------------
>  1 file changed, 19 insertions(+), 24 deletions(-)
> 
> --- 4.7-rc6-prefer-xenbus_scanf.orig/drivers/block/xen-blkfront.c
> +++ 4.7-rc6-prefer-xenbus_scanf/drivers/block/xen-blkfront.c
> @@ -2208,10 +2208,9 @@ static void blkfront_setup_discard(struc
>  		info->discard_granularity = discard_granularity;
>  		info->discard_alignment = discard_alignment;
>  	}
> -	err = xenbus_gather(XBT_NIL, info->xbdev->otherend,
> -		    "discard-secure", "%d", &discard_secure,
> -		    NULL);
> -	if (!err)
> +	err = xenbus_scanf(XBT_NIL, info->xbdev->otherend,
> +			   "discard-secure", "%u", &discard_secure);
> +	if (err > 0)

I would prefer an explicit err == 1 check (here and elsewhere), but I'm not 
going to block this patch because of that.

Roger.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ