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]
Date:   Thu, 10 Nov 2022 10:44:15 +0000
From:   Sudeep Holla <sudeep.holla@....com>
To:     Huisong Li <lihuisong@...wei.com>
Cc:     linux-acpi@...r.kernel.org, linux-kernel@...r.kernel.org,
        rafael@...nel.org, rafael.j.wysocki@...el.com,
        Sudeep Holla <sudeep.holla@....com>, wanghuiqiang@...wei.com,
        zhangzekun11@...wei.com, wangxiongfeng2@...wei.com,
        tanxiaofei@...wei.com, guohanjun@...wei.com, xiexiuqi@...wei.com,
        wangkefeng.wang@...wei.com, huangdaode@...wei.com
Subject: Re: [PATCH 3/3] mailbox: pcc: fix 'pcc_chan_count' when fail to
 initialize PCC

On Thu, Nov 10, 2022 at 09:50:34AM +0800, Huisong Li wrote:
> Currently, 'pcc_chan_count' is a non-zero value if PCC subspaces are parsed
> successfully and subsequent processes is failure during initializing PCC
> process. This may cause that pcc_mbox_request_channel() can still be
> executed successfully , which will misleads the caller that this channel is
> available.
> 
> Fixes: ce028702ddbc ("mailbox: pcc: Move bulk of PCCT parsing into pcc_mbox_probe")
> Signed-off-by: Huisong Li <lihuisong@...wei.com>
> ---
>  drivers/mailbox/pcc.c | 11 ++++++++---
>  1 file changed, 8 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/mailbox/pcc.c b/drivers/mailbox/pcc.c
> index 7cee37dd3b73..47d70c5884e3 100644
> --- a/drivers/mailbox/pcc.c
> +++ b/drivers/mailbox/pcc.c
> @@ -294,6 +294,7 @@ pcc_mbox_request_channel(struct mbox_client *cl, int subspace_id)
>  		pr_err("Channel not found for idx: %d\n", subspace_id);
>  		return ERR_PTR(-EBUSY);
>  	}
> +

Spurious/not needed change ?

>  	dev = chan->mbox->dev;
>  
>  	spin_lock_irqsave(&chan->lock, flags);
> @@ -735,7 +736,8 @@ static int __init pcc_init(void)
>  
>  	if (ret) {
>  		pr_debug("ACPI PCC probe failed.\n");
> -		return -ENODEV;
> +		ret = -ENODEV;
> +		goto out;

Not needed, we don't set pcc_chan_count if the probe failed.

>  	}
>  
>  	pcc_pdev = platform_create_bundle(&pcc_mbox_driver,
> @@ -743,10 +745,13 @@ static int __init pcc_init(void)
>  
>  	if (IS_ERR(pcc_pdev)) {
>  		pr_debug("Err creating PCC platform bundle\n");
> -		return PTR_ERR(pcc_pdev);
> +		ret = PTR_ERR(pcc_pdev);

You just need to set pcc_chan_count to 0 here, so no need for goto.

-- 
Regards,
Sudeep

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ