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: <7cef385d-efe3-2661-bee2-9d21f159a5fb@suse.com>
Date:   Tue, 19 Jan 2021 08:43:01 +0100
From:   Jürgen Groß <jgross@...e.com>
To:     Roger Pau Monne <roger.pau@...rix.com>,
        linux-kernel@...r.kernel.org
Cc:     Arthur Borsboom <arthurborsboom@...il.com>,
        Boris Ostrovsky <boris.ostrovsky@...cle.com>,
        Stefano Stabellini <sstabellini@...nel.org>,
        Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>,
        Jens Axboe <axboe@...nel.dk>, xen-devel@...ts.xenproject.org,
        linux-block@...r.kernel.org
Subject: Re: [PATCH] xen-blkfront: don't make discard-alignment mandatory

On 18.01.21 16:15, Roger Pau Monne wrote:
> Don't require the discard-alignment xenstore node to be present in
> order to correctly setup the feature. This can happen with versions of
> QEMU that only write the discard-granularity but not the
> discard-alignment node.
> 
> Assume discard-alignment is 0 if not present. While there also fix the
> logic to not enable the discard feature if discard-granularity is not
> present.
> 
> Reported-by: Arthur Borsboom <arthurborsboom@...il.com>
> Signed-off-by: Roger Pau Monné <roger.pau@...rix.com>
> ---
> Cc: Boris Ostrovsky <boris.ostrovsky@...cle.com>
> Cc: Juergen Gross <jgross@...e.com>
> Cc: Stefano Stabellini <sstabellini@...nel.org>
> Cc: Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>
> Cc: "Roger Pau Monné" <roger.pau@...rix.com>
> Cc: Jens Axboe <axboe@...nel.dk>
> Cc: xen-devel@...ts.xenproject.org
> Cc: linux-block@...r.kernel.org
> Cc: Arthur Borsboom <arthurborsboom@...il.com>
> ---
>   drivers/block/xen-blkfront.c | 25 +++++++++++++------------
>   1 file changed, 13 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
> index 5265975b3fba..5a93f7cc2939 100644
> --- a/drivers/block/xen-blkfront.c
> +++ b/drivers/block/xen-blkfront.c
> @@ -2179,22 +2179,23 @@ static void blkfront_closing(struct blkfront_info *info)
>   
>   static void blkfront_setup_discard(struct blkfront_info *info)
>   {
> -	int err;
> -	unsigned int discard_granularity;
> -	unsigned int discard_alignment;
> +	unsigned int discard_granularity = 0;
> +	unsigned int discard_alignment = 0;
> +	unsigned int discard_secure = 0;
>   
> -	info->feature_discard = 1;
> -	err = xenbus_gather(XBT_NIL, info->xbdev->otherend,
> +	xenbus_gather(XBT_NIL, info->xbdev->otherend,
>   		"discard-granularity", "%u", &discard_granularity,
>   		"discard-alignment", "%u", &discard_alignment,
> +		"discard-secure", "%u", &discard_secure,
>   		NULL);

This would mean that "discard-secure" will be evaluated only if the
other two items are set in Xenstore. From blkif.h I can't see this is
required, and your patch is modifying today's behavior in this regard.

You might want to have three xenbus_read_unsigned() calls instead.


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

Powered by Openwall GNU/*/Linux Powered by OpenVZ