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: <05b3cd4a-d2c1-5ad7-7a39-64bac470032a@huawei.com>
Date:   Thu, 15 Aug 2019 09:27:13 +0800
From:   "sunke (E)" <sunke32@...wei.com>
To:     <josef@...icpanda.com>, <axboe@...nel.dk>,
        <linux-block@...r.kernel.org>, <nbd@...er.debian.org>,
        <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] nbd: add a missed nbd_config_put() in nbd_xmit_timeout()

ping

在 2019/8/12 20:31, Sun Ke 写道:
> When try to get the lock failed, before return, execute the
> nbd_config_put() to decrease the nbd->config_refs.
> 
> If the nbd->config_refs is added but not decreased. Then will not
> execute nbd_clear_sock() in nbd_config_put(). bd->task_setup will
> not be cleared away. Finally, print"Device being setup by another
> task" in nbd_add_sock() and nbd device can not be reused.
> 
> Fixes: 8f3ea35929a0 ("nbd: handle unexpected replies better")
> Signed-off-by: Sun Ke <sunke32@...wei.com>
> ---
>   drivers/block/nbd.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
> index e21d2de..a69a90a 100644
> --- a/drivers/block/nbd.c
> +++ b/drivers/block/nbd.c
> @@ -357,8 +357,10 @@ static enum blk_eh_timer_return nbd_xmit_timeout(struct request *req,
>   	}
>   	config = nbd->config;
>   
> -	if (!mutex_trylock(&cmd->lock))
> +	if (!mutex_trylock(&cmd->lock)) {
> +		nbd_config_put(nbd);
>   		return BLK_EH_RESET_TIMER;
> +	}
>   
>   	if (config->num_connections > 1) {
>   		dev_err_ratelimited(nbd_to_dev(nbd),
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ