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: <504bed33-2170-4172-8b56-42eb5cac0698@linaro.org>
Date:   Mon, 28 Aug 2023 13:08:09 +0200
From:   Konrad Dybcio <konrad.dybcio@...aro.org>
To:     Zhang Shurong <zhang_shurong@...mail.com>, amitk@...nel.org
Cc:     thara.gopinath@...il.com, agross@...nel.org, andersson@...nel.org,
        rafael@...nel.org, daniel.lezcano@...aro.org, rui.zhang@...el.com,
        linux-pm@...r.kernel.org, linux-arm-msm@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] thermal/drivers/qcom/lmh: Fix missing IRQ check in
 lmh_probe()

On 26.08.2023 13:09, Zhang Shurong wrote:
> This func misses checking for platform_get_irq()'s call and may passes the
> negative error codes to request_irq(), which takes unsigned IRQ #,
> causing it to fail with -EINVAL, overriding an original error code.
> 
> Fix this by stop calling request_irq() with invalid IRQ #s.
> 
> Fixes: 53bca371cdf7 ("thermal/drivers/qcom: Add support for LMh driver")
> Signed-off-by: Zhang Shurong <zhang_shurong@...mail.com>
> ---
>  drivers/thermal/qcom/lmh.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/thermal/qcom/lmh.c b/drivers/thermal/qcom/lmh.c
> index f6edb12ec004..38aedb9a7c67 100644
> --- a/drivers/thermal/qcom/lmh.c
> +++ b/drivers/thermal/qcom/lmh.c
> @@ -198,7 +198,11 @@ static int lmh_probe(struct platform_device *pdev)
>  		return ret;
>  	}
>  
> -	lmh_data->irq = platform_get_irq(pdev, 0);
> +	ret = platform_get_irq(pdev, 0);
> +	if (ret < 0)
> +		return ret;
> +
> +	lmh_data->irq = ret;
Similarly to the other patch, please assign to lmh_data->irq directly

Konrad

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ