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: <99d75f263b7b973ddbe5031d8500048c@codeaurora.org>
Date:   Sat, 19 Nov 2016 12:30:24 -0800
From:   Subhash Jadavani <subhashj@...eaurora.org>
To:     Bjorn Andersson <bjorn.andersson@...aro.org>
Cc:     Vinayak Holikatti <vinholikatti@...il.com>,
        "James E.J. Bottomley" <jejb@...ux.vnet.ibm.com>,
        "Martin K. Petersen" <martin.petersen@...cle.com>,
        Yaniv Gardi <ygardi@...eaurora.org>,
        Vivek Gautam <vivek.gautam@...eaurora.org>,
        linux-scsi@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-arm-msm@...r.kernel.org, linux-scsi-owner@...r.kernel.org
Subject: Re: [PATCH] ufs: qcom: Properly clear hba priv on failure

On 2016-11-18 12:55, Bjorn Andersson wrote:
> In the case where we fail to acquire the phy the hba priv will be set
> already, so during cleanup ufs_qcom_setup_clocks() will dereference the
> now free, but still "valid looking" pointer "host".

host (ufs_qcom_host) was allocated with devm_kzalloc() so i am not sure 
why it would be freed up before probe() returns failure.

> Signed-off-by: Bjorn Andersson <bjorn.andersson@...aro.org>
> ---
>  drivers/scsi/ufs/ufs-qcom.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/scsi/ufs/ufs-qcom.c b/drivers/scsi/ufs/ufs-qcom.c
> index d345434b084f..7bd88ffee47a 100644
> --- a/drivers/scsi/ufs/ufs-qcom.c
> +++ b/drivers/scsi/ufs/ufs-qcom.c
> @@ -1197,7 +1197,7 @@ static int ufs_qcom_init(struct ufs_hba *hba)
>  	if (IS_ERR(host->generic_phy)) {
>  		err = PTR_ERR(host->generic_phy);
>  		dev_err(dev, "%s: PHY get failed %d\n", __func__, err);
> -		goto out;
> +		goto out_host_free;
>  	}
> 
>  	err = ufs_qcom_bus_register(host);

-- 
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ