From: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
To: "Shen, Yijun" <Yijun.Shen@dell.com>,
Mario Limonciello <superm1@kernel.org>,
"Limonciello, Mario" <mario.limonciello@amd.com>,
"hdegoede@redhat.com" <hdegoede@redhat.com>,
"ilpo.jarvinen@linux.intel.com" <ilpo.jarvinen@linux.intel.com>,
"Patil.Reddy@amd.com" <Patil.Reddy@amd.com>
Cc: Richard Gong <richgong@amd.com>,
"platform-driver-x86@vger.kernel.org"
<platform-driver-x86@vger.kernel.org>
Subject: Re: [PATCH] platform/x86/amd/pmf: Initialize and clean up `cb_mutex`
Date: Mon, 3 Mar 2025 11:32:51 +0530 [thread overview]
Message-ID: <c51f8e90-0d69-4d34-bd56-771c68ff9cd0@amd.com> (raw)
In-Reply-To: <BY5PR19MB392275906AA040DF44DD8EB29ACC2@BY5PR19MB3922.namprd19.prod.outlook.com>
On 2/28/2025 10:06, Shen, Yijun wrote:
>
> Internal Use - Confidential
>> -----Original Message-----
>> From: Mario Limonciello <superm1@kernel.org>
>> Sent: Friday, February 28, 2025 1:03 AM
>> To: Limonciello, Mario <mario.limonciello@amd.com>; Shyam-sundar.S-
>> k@amd.com; hdegoede@redhat.com; ilpo.jarvinen@linux.intel.com;
>> Patil.Reddy@amd.com
>> Cc: Shen, Yijun <Yijun_Shen@Dell.com>; Richard Gong
>> <richgong@amd.com>; platform-driver-x86@vger.kernel.org
>> Subject: [PATCH] platform/x86/amd/pmf: Initialize and clean up `cb_mutex`
>>
>>
>> [EXTERNAL EMAIL]
>>
>> From: Mario Limonciello <mario.limonciello@amd.com>
>>
>> `cb_mutex` was introduced in commit 9e0894d07072e
>> ("platform/x86/amd/pmf:
>> Enable Custom BIOS Inputs for PMF-TA") to prevent conccurrent access for
>> BIOS inputs. It however isn't initialized and so on use it may lead to a NULL
>> pointer dereference.
>>
>> Add code to initialize on probe and clean up on destroy.
>>
>> Reported-by: Yijun Shen <Yijun.Shen@dell.com>
>> Cc: Richard Gong <richgong@amd.com>
>> Fixes: 9e0894d07072e ("platform/x86/amd/pmf: Enable Custom BIOS Inputs
>> for PMF-TA")
>> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
>
> Verified the patch on the issued system, the issue is gone.
>
> Tested-By: Yijun Shen <Yijun_Shen@Dell.com>
>
Thank you. Looks good.
Acked-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
>> ---
>> drivers/platform/x86/amd/pmf/core.c | 2 ++
>> 1 file changed, 2 insertions(+)
>>
>> diff --git a/drivers/platform/x86/amd/pmf/core.c
>> b/drivers/platform/x86/amd/pmf/core.c
>> index 764cc1fe90ae4..a2cb2d5544f5b 100644
>> --- a/drivers/platform/x86/amd/pmf/core.c
>> +++ b/drivers/platform/x86/amd/pmf/core.c
>> @@ -452,6 +452,7 @@ static int amd_pmf_probe(struct platform_device
>> *pdev)
>>
>> mutex_init(&dev->lock);
>> mutex_init(&dev->update_mutex);
>> + mutex_init(&dev->cb_mutex);
>>
>> apmf_acpi_init(dev);
>> platform_set_drvdata(pdev, dev);
>> @@ -477,6 +478,7 @@ static void amd_pmf_remove(struct platform_device
>> *pdev)
>> amd_pmf_dbgfs_unregister(dev);
>> mutex_destroy(&dev->lock);
>> mutex_destroy(&dev->update_mutex);
>> + mutex_destroy(&dev->cb_mutex);
>> kfree(dev->buf);
>> }
>>
>> --
>> 2.43.0
>
next prev parent reply other threads:[~2025-03-03 6:03 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-27 17:03 [PATCH] platform/x86/amd/pmf: Initialize and clean up `cb_mutex` Mario Limonciello
2025-02-28 4:36 ` Shen, Yijun
2025-03-03 6:02 ` Shyam Sundar S K [this message]
2025-03-03 12:46 ` Ilpo Järvinen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c51f8e90-0d69-4d34-bd56-771c68ff9cd0@amd.com \
--to=shyam-sundar.s-k@amd.com \
--cc=Patil.Reddy@amd.com \
--cc=Yijun.Shen@dell.com \
--cc=hdegoede@redhat.com \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=mario.limonciello@amd.com \
--cc=platform-driver-x86@vger.kernel.org \
--cc=richgong@amd.com \
--cc=superm1@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox