Bug 217386 - intel_powerclamp null pointer dereference in Linux 6.3.x
Summary: intel_powerclamp null pointer dereference in Linux 6.3.x
Status: NEW
Alias: None
Product: Power Management
Classification: Unclassified
Component: Other (show other bugs)
Hardware: All Linux
: P3 normal
Assignee: Rafael J. Wysocki
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-05-01 09:49 UTC by Risto A. Paju
Modified: 2023-05-03 23:40 UTC (History)
1 user (show)

See Also:
Kernel Version:
Subsystem:
Regression: No
Bisected commit-id:


Attachments
dmesg-6.3.1 (55.84 KB, text/plain)
2023-05-01 09:49 UTC, Risto A. Paju
Details
dmesg-6.3.1 on an i5-7300HQ (61.45 KB, text/plain)
2023-05-02 16:45 UTC, Risto A. Paju
Details
Patch to fix (2.20 KB, application/mbox)
2023-05-03 20:57 UTC, Srinivas Pandruvada
Details

Description Risto A. Paju 2023-05-01 09:49:03 UTC
Created attachment 304199 [details]
dmesg-6.3.1

I use intel_powerclamp on a Thinkpad X220i via a custom script for thermal management, and it triggers a kernel bug in Linux 6.3.0 and 6.3.1. The script has a part

awk something > /sys/class/thermal/cooling_device4/cur_state

and the awk process hangs, with the null pointer bug reported in dmesg.

The script has worked fine for years, and for now I've switched back to the 6.2 series for this laptop.
Comment 1 Risto A. Paju 2023-05-01 12:23:15 UTC
The affected CPU is an i3-2310M. I tested the same on a newer Intel laptop with an i5-7300HQ, and there's no sign of the bug there.
Comment 2 Risto A. Paju 2023-05-02 16:45:32 UTC
Created attachment 304202 [details]
dmesg-6.3.1 on an i5-7300HQ

Well, I managed to trigger the bug on an i5-7300HQ too.
Comment 3 Srinivas Pandruvada 2023-05-03 20:57:23 UTC
Created attachment 304209 [details]
Patch to fix

Thanks for reporting. Please try the attached.
I  can reproduce and this patch fixed. Please try.
Comment 4 Risto A. Paju 2023-05-03 22:35:53 UTC
(In reply to Srinivas Pandruvada from comment #3)
> Created attachment 304209 [details]
> Patch to fix
> 
> Thanks for reporting. Please try the attached.
> I  can reproduce and this patch fixed. Please try.

Tested on both machines, the patch fixes it in both cases. Thank you!
Comment 5 Srinivas Pandruvada 2023-05-03 23:40:53 UTC
Thanks. Submitted patch with Tested by tag.

Note You need to log in before you can comment on or make changes to this bug.