[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <288ac4c1-b66d-477a-ba2e-9b8d8dde4dc6@amd.com>
Date: Wed, 6 Sep 2023 07:05:21 -0500
From: Mario Limonciello <mario.limonciello@....com>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Heikki Krogerus <heikki.krogerus@...ux.intel.com>
Cc: Dave Hansen <dave.hansen@...el.com>,
LKML <linux-kernel@...r.kernel.org>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Saranya Gopal <saranya.gopal@...el.com>,
Rajaram Regupathy <rajaram.regupathy@...el.com>,
Uwe Kleine-König <u.kleine-koenig@...gutronix.de>,
Wayne Chang <waynec@...dia.com>,
Hans de Goede <hdegoede@...hat.com>,
Neil Armstrong <neil.armstrong@...aro.org>,
linux-usb@...r.kernel.org
Subject: Re: [PATCH] usb: typec: ucsi: Fix NULL pointer dereference
On 9/6/2023 03:57, Greg Kroah-Hartman wrote:
> On Wed, Sep 06, 2023 at 11:48:42AM +0300, Heikki Krogerus wrote:
>> Making sure the UCSI debugfs entry actually exists before
>> attempting to remove it.
>>
>> Fixes: df0383ffad64 ("usb: typec: ucsi: Add debugfs for ucsi commands")
>> Reported-by: Dave Hansen <dave.hansen@...el.com>
>> Closes: https://lore.kernel.org/linux-usb/700df3c4-2f6c-85f9-6c61-065bc5b2db3a@intel.com/
>> Suggested-by: Dave Hansen <dave.hansen@...el.com>
>> Suggested-by: Mario Limonciello <mario.limonciello@....com>
>> Cc: Saranya Gopal <saranya.gopal@...el.com>
>> Signed-off-by: Heikki Krogerus <heikki.krogerus@...ux.intel.com>
I could also reproduce it with 7733171926cc336ddf0c8f847eefaff569dbff86
on two different laptops.
>> ---
>> drivers/usb/typec/ucsi/debugfs.c | 3 +++
>> 1 file changed, 3 insertions(+)
>>
>> diff --git a/drivers/usb/typec/ucsi/debugfs.c b/drivers/usb/typec/ucsi/debugfs.c
>> index 0c7bf88d4a7f..f67733cecfdf 100644
>> --- a/drivers/usb/typec/ucsi/debugfs.c
>> +++ b/drivers/usb/typec/ucsi/debugfs.c
>> @@ -84,6 +84,9 @@ void ucsi_debugfs_register(struct ucsi *ucsi)
>>
>> void ucsi_debugfs_unregister(struct ucsi *ucsi)
>> {
>> + if (IS_ERR_OR_NULL(ucsi) || !ucsi->debugfs)
>> + return;
>> +
>> debugfs_remove_recursive(ucsi->debugfs->dentry);
>
> Why are you saving the dentry at all? Why not just have debugfs look it
> up when you want to remove it based on the filename?
>
> Anyway, not a big deal here, just a comment. I'll queue this up after
> -rc1 is out.
It might be worth sending before rc1 if it ends up being widespread.
>
> thanks,
>
> greg k-h
Powered by blists - more mailing lists