Bug 217106

Summary: Null pointer dereference on dock unplug
Product: ACPI Reporter: Szymon Janc (szymon.janc)
Component: Config-HotplugAssignee: acpi_config-hotplug
Status: RESOLVED CODE_FIX    
Severity: high CC: carnil, heikki.krogerus, matt, nicola.soranzo, regressions, vcordo
Priority: P1    
Hardware: Intel   
OS: Linux   
Kernel Version: 6.1.14 Subsystem:
Regression: No Bisected commit-id:
Attachments: kernel log
dmesg
kernel crash

Description Szymon Janc 2023-03-01 08:16:51 UTC
On Lenovo Thinkpad X1 when unplugging from Lenovo ThinkPad Thunderbolt 4 dock I get NULL pointer dereference in kernel and system freezes. This is 100% reproducible.

I'm using Fedora 37 and I don't recall this happen while on 6.0 kernel.

Attaching photo with kernel log.
Comment 1 Szymon Janc 2023-03-01 08:17:26 UTC
Created attachment 303821 [details]
kernel log
Comment 2 The Linux kernel's regression tracker (Thorsten Leemhuis) 2023-03-02 04:45:54 UTC
(In reply to Szymon Janc from comment #1)
> Created attachment 303821 [details]
> kernel log

According to the screenshot this is the second oops and thus a follow-up error; just to be sure, could you please share dmesg before unplugging the dock, as it likely has the first oops
Comment 3 Szymon Janc 2023-03-06 18:08:32 UTC
Hi,

Attaching dmesg taken prior to unplug and screen shot of panic that follows.
Comment 4 Szymon Janc 2023-03-06 18:09:10 UTC
Created attachment 303881 [details]
dmesg
Comment 5 Szymon Janc 2023-03-06 18:10:02 UTC
Created attachment 303882 [details]
kernel crash
Comment 6 The Linux kernel's regression tracker (Thorsten Leemhuis) 2023-03-07 08:51:32 UTC
I need to apologise: I misread the screenshot, it wasn't second oops, it was the first one. Sorry. Nevertheless, thx for the data, this is helpful in any case.
Comment 7 Heikki Krogerus 2023-03-07 09:12:09 UTC
This should fix the problem:
https://patchwork.kernel.org/project/linux-usb/patch/20230306103359.6591-2-hdegoede@redhat.com/

I'll ask this bug to be liked to the it.
Comment 8 Szymon Janc 2023-03-07 09:21:24 UTC
Hi,

Great, thanks!  I'll keep and eye on stable releases and confirm here if this fix the issue for me
Comment 9 Matthew Horan 2023-03-22 22:03:04 UTC
I applied this patch to 6.1.21 and can confirm it resolves crashes I experienced with my Lenovo X1 Carbon Gen 9 when unplugging both a Thunderbolt 4 dock (Plugable) and a Dell USB-C display.
Comment 10 Szymon Janc 2023-04-05 13:36:06 UTC
Hi,

I can confirm that kernel 6.2.9 (which has mentioned patch included) fix the issue for me.
Thanks!