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: <5e37b804-f91e-4f90-b0de-2d837257765b@huawei.com>
Date: Thu, 11 Dec 2025 11:44:11 +0800
From: "zhangpengjie (A)" <zhangpengjie2@...wei.com>
To: Sudeep Holla <sudeep.holla@....com>
CC: <rafael@...nel.org>, <lenb@...nel.org>, <lihuisong@...wei.com>,
	<linux-acpi@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
	<zhanjie9@...ilicon.com>, <zhenglifeng1@...wei.com>, <yubowen8@...wei.com>,
	<linhongye@...artners.com>, <linuxarm@...wei.com>,
	<jonathan.cameron@...wei.com>, <wangzhi12@...wei.com>
Subject: Re: [PATCH] ACPI: PCC: Fix race condition by removing static
 qualifier


On 12/10/2025 10:54 PM, Sudeep Holla wrote:
> On Wed, Dec 10, 2025 at 09:26:34PM +0800, Pengjie Zhang wrote:
>> The variable 'ret' in acpi_pcc_address_space_setup() is currently
>> declared with the 'static' storage specifier. This can lead to race
>> conditions in a multithreaded environment.
>>
>> Remove the 'static' qualifier to ensure 'ret' is allocated directly
>> on the stack as a local variable.
>>
Hi, I'm lucky that I didn't run into any problems because of this, I 
just found

this issue during code review.

> Ah, my mistake. I’m not sure how that slipped in other than a simple typo or
> copy/paste error. Thanks for catching it. Let me know if you spotted it
> because something broke or just from reading the code.
>
> Reviewed-by: Sudeep Holla <sudeep.holla@....com>
>
>> Fixes: a10b1c99e2dc ("ACPI: PCC: Setup PCC Opregion handler only if platform interrupt is available")
>> Signed-off-by: Pengjie Zhang <zhangpengjie2@...wei.com>
>> ---
>>   drivers/acpi/acpi_pcc.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/acpi/acpi_pcc.c b/drivers/acpi/acpi_pcc.c
>> index 97064e943768..e3f302b9dee5 100644
>> --- a/drivers/acpi/acpi_pcc.c
>> +++ b/drivers/acpi/acpi_pcc.c
>> @@ -52,7 +52,7 @@ acpi_pcc_address_space_setup(acpi_handle region_handle, u32 function,
>>   	struct pcc_data *data;
>>   	struct acpi_pcc_info *ctx = handler_context;
>>   	struct pcc_mbox_chan *pcc_chan;
>> -	static acpi_status ret;
>> +	acpi_status ret;
>>   
>>   	data = kzalloc(sizeof(*data), GFP_KERNEL);
>>   	if (!data)
>> -- 
>> 2.33.0
>>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ