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]
Message-ID: <20191218122741.GA19387@quack2.suse.cz>
Date:   Wed, 18 Dec 2019 13:27:41 +0100
From:   Jan Kara <jack@...e.cz>
To:     Michal Suchanek <msuchanek@...e.de>
Cc:     linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
        Alexander Viro <viro@...iv.linux.org.uk>
Subject: Re: [PATCH] bdev: reset first_open when looping in __blkget_dev

On Tue 17-12-19 19:04:28, Michal Suchanek wrote:
> It is not clear that no other thread cannot open the block device when
> __blkget_dev drops it and loop to restart label. Reset first_open to
> false when looping.
> 
> Signed-off-by: Michal Suchanek <msuchanek@...e.de>

Yeah, good catch. Thanks for the patch. You can add:

Reviewed-by: Jan Kara <jack@...e.cz>

								Honza

> ---
>  fs/block_dev.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/block_dev.c b/fs/block_dev.c
> index 69bf2fb6f7cd..17e1231d5246 100644
> --- a/fs/block_dev.c
> +++ b/fs/block_dev.c
> @@ -1560,7 +1560,7 @@ static int __blkdev_get(struct block_device *bdev, fmode_t mode, int for_part)
>  	int ret;
>  	int partno;
>  	int perm = 0;
> -	bool first_open = false;
> +	bool first_open;
>  
>  	if (mode & FMODE_READ)
>  		perm |= MAY_READ;
> @@ -1580,6 +1580,7 @@ static int __blkdev_get(struct block_device *bdev, fmode_t mode, int for_part)
>   restart:
>  
>  	ret = -ENXIO;
> +	first_open = false;
>  	disk = bdev_get_gendisk(bdev, &partno);
>  	if (!disk)
>  		goto out;
> -- 
> 2.23.0
> 
-- 
Jan Kara <jack@...e.com>
SUSE Labs, CR

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ