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: <c2e1730d-fe83-7c6a-6011-4bc6c4848f57@huawei.com>
Date:   Mon, 7 Sep 2020 09:37:05 +0800
From:   Jason Yan <yanaijie@...wei.com>
To:     Dan Carpenter <dan.carpenter@...cle.com>,
        "James E.J. Bottomley" <jejb@...ux.ibm.com>,
        Dan Williams <dan.j.williams@...el.com>
CC:     "Martin K. Petersen" <martin.petersen@...cle.com>,
        John Garry <john.garry@...wei.com>,
        "Gustavo A. R. Silva" <gustavoars@...nel.org>,
        <linux-scsi@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
        <kernel-janitors@...r.kernel.org>
Subject: Re: [PATCH] scsi: libsas: Fix error path in
 sas_notify_lldd_dev_found()


在 2020/9/5 20:58, Dan Carpenter 写道:
> In sas_notify_lldd_dev_found(), if we can't find a device, then it seems
> like the wrong thing to mark the device as found and to increment the
> reference count.  None of the callers ever drop the reference in that
> situation.
> 
> Fixes: 735f7d2fedf5 ("[SCSI] libsas: fix domain_device leak")
> Signed-off-by: Dan Carpenter <dan.carpenter@...cle.com>
> ---
>   drivers/scsi/libsas/sas_discover.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/scsi/libsas/sas_discover.c b/drivers/scsi/libsas/sas_discover.c
> index cd7c7d269f6f..d0f9e90e3279 100644
> --- a/drivers/scsi/libsas/sas_discover.c
> +++ b/drivers/scsi/libsas/sas_discover.c
> @@ -182,10 +182,11 @@ int sas_notify_lldd_dev_found(struct domain_device *dev)
>   		pr_warn("driver on host %s cannot handle device %016llx, error:%d\n",
>   			dev_name(sas_ha->dev),
>   			SAS_ADDR(dev->sas_addr), res);
> +		return res;
>   	}
>   	set_bit(SAS_DEV_FOUND, &dev->state);
>   	kref_get(&dev->kref);
> -	return res;
> +	return 0;
>   }
>   
>   
> 

Hi Dan, thanks for finding this,

Reviewed-by: Jason Yan <yanaijie@...wei.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ