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: <20220701094212.snsnbdjc7hia5oti@bogus>
Date:   Fri, 1 Jul 2022 10:42:12 +0100
From:   Sudeep Holla <sudeep.holla@....com>
To:     huhai <15815827059@....com>
Cc:     cristian.marussi@....com, linux-arm-kernel@...ts.infradead.org,
        linux-kernel@...r.kernel.org, luriwen@...inos.cn,
        liuyun01@...inos.cn, huhai <huhai@...inos.cn>,
        k2ci <kernel-bot@...inos.cn>
Subject: Re: [PATCH] firmware: arm_scpi: Fix error handle when scpi probe
 failed

On Fri, Jul 01, 2022 at 02:16:06PM +0800, huhai wrote:
> From: huhai <huhai@...inos.cn>
>
> When scpi probe fails, do not just return the error code, but also reset
> the global scpi_info to NULL, otherwise scpi_hwmon_probe() may get a UAF
> and cause panic:
>

Interesting, which platform are you using this on ? SCPI is deprecated for
a while, please switch to SCMI which is well maintained both in terms of
specification and support in the kernel. I also assume this is 64-bit
platform, so I don't want you to get stuck in future because of lack
of some feature in SCPI. Please see if you can migrate to SCMI.

>   scpi_protocol FTSC0001:00: incorrect or no SCP firmware found
>   ... ...
>   Unable to handle kernel NULL pointer dereference at virtual address 0000000000000000
>   Mem abort info:
>

[...]

I think we don't see to make it complex. Can't it be as simple as:

Regards,
Sudeep

-->8

diff --git i/drivers/firmware/arm_scpi.c w/drivers/firmware/arm_scpi.c
index ddf0b9ff9e15..6fa1a5b193b8 100644
--- i/drivers/firmware/arm_scpi.c
+++ w/drivers/firmware/arm_scpi.c
@@ -799,7 +799,7 @@ static struct scpi_ops scpi_ops = {

 struct scpi_ops *get_scpi_ops(void)
 {
-       return scpi_info ? scpi_info->scpi_ops : NULL;
+       return scpi_info && scpi_info->scpi_ops ? scpi_info->scpi_ops : NULL;
 }
 EXPORT_SYMBOL_GPL(get_scpi_ops);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ