NULL pointer dereference in power_supply_get_property

Bug #1994126 reported by lirel
30
This bug affects 5 people
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Fix Released
Undecided
Unassigned
Kinetic
Won't Fix
Undecided
Unassigned

Bug Description

Ubuntu 22.10 final release boot via usb thumb drive on thinkpad T480 (containing nvidia gpu)
reproducible kernel panic during boot

backtrace via OCR from picture of kernel panic:

    Started Periodic ext4 Online Hetadata Check for All Filesystems. Started
    Discard unused blocks once a week.

    Started Refresh fuupd metadate regularly. Started Daily rotation of log files.

    Started Daily man-db regeneration.

    Started Message of the Day.

    Started Daily Cleanup of Temporary Directories.

    Started Ubuntu Advantage Timer for running repeated jobs.

    Reached target Path Units. Listening on Avehi MONS/DNS-SD Stack Activation
    Socket.

    1 Listening on CUPS Scheduler.

    1 Listening on 0-Bus System Message Bus Socket. Starting Socket activation
    for snappy deeson...

    Listening on UUID deemon activation socket. 1 Listening on Socket activation
    for snappy daemon.

    Reached target Socket Units. 1 Reached target Basic System.

    20.300662) BUG: Kernel NULL pointer dereference, address: 000000000000

    20.3012911 #PF: supervisor instruction fetch in kernel mode 20.3018531 WPF:
    error code (0x0010) - not-present page

    20.302458) PGD O P40 0

    20.909018) Oops: 0010 [#1] PREEMPT SHP PTI 20.303579)

    CPU: 4 PID: 1 Comm: systemd Tainted: P

    0 5.19.0-21-generic #21-Ubuntu Hardware name: LENOVO 20L5000BGE/20L5000BGE,
    BIOS N24ET7ON (1.45) 07/22/2022

    20.304190)

    20.304774) RIP: 0010:0N0

    20.305376) Code: Unable to access opcode bytes at RIP Oxffffffffffffffd6.
    20.305982) RSP: 0018:ffffb17180087c98 EFLAGS: 00010202

    20.3066231 RAX: 0000000000000000 RBX: ffffffff95538288 RCX: ffff8c43c1d89800
    20.307282) RDX: ffffb17180087cdo RSI: 0000000000000004 RDI: ffff8c43c1d89800

    20.307949) RBP: ffffb17180087ca8 R08: ffff8c43c1d89838 R09: 000000000

    20.308627) R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000

    20.309318) R13: ffff8c43de65c000 R14: ffff8c43c1d89838 R15: ffffffff9553a288

    20.310023) FS: 00007f37adf23940 (0000) GS:ffff8c5322700000(0000) kn1GS:000
    20.310762) CS: 0010 DS: 0000 ES: 0000 CRO: 0000000080050033

    20.311491) CR2: ffff fffds CRS: 000000011eida002 CR4: 00000000003706e0

    20.312241) Call Trace:

    20.312992) <TASK) 20.313739)

    power supply_get_property+0x1d/0x60

    20.314432) power supply show property+0xce/0x2c0

    20.315239) 20.315985)

    dev_attr_show+0x1a/0x50 sysfs kf seq.show+0xa0/0x100

    20.316724) kernfs_seq_shou+0x23/0x40

    20.317460) seq.read_iter+0x132/0x480 20.3181921 ? cp.new.stat+0x143/0x180
    kernfs fop read iter+0x34/0x40

    20.318922)

    20.319680) new_sync_read+0x120/0x1c0

    20.320430) vfs read+0x15a/0x1b0

    20.321176) 20.321922 x64_sys_read+0x19/0x30

    ksys read+0x73/0x100

    20.322668) do syscall 64+0x58/0x90

    20.323433) ? do syscall 64+0x67/0x90 ? do syscall 64+0x67/0x90

    20.324213) 20.324957 ? do syscall 64+0x67/0x90

    20.3256961 7 do syscall 64+0x67/0x90

    20.326436) entry.SYSCALL_64_after_huframe+0x63/0xcd 20.327174) RIP:
    0033:0x7f37ea16cf1

    20.3279521 Code: 31 co e9 b2 fe ff ff 50 48 8d 3d b2 08 ob 00 e8 65 29 02 00
    of 1f 44 00 00 f 20.3287661 RSP: 002b:00007ffca4167668 EFLAGS: 00000246 ORIG
    RAX: 0000000000000000

    ed 10

    20.329592) RAX: ff fffffda RBX: 0000555ac403f0do RCX: 00007f37aea16cf1
    20.330421) RDX: 0000000000001001 RSI: 0000555ac403f0do RDI: 0000000000000048

    20.331253) RBP: 00000000 048 ROB: 00007f37aeb00ce0 R09: 00007f37aeb00ce0

    20.3320831 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000001001
    R14: 00000000003ffffe R15: 0000000000000002

    20.332950) R13: ff 20.333800] </TASK

    20.3346511 Modules linked in: binfat misc zfs (PO) zunicode (PO) zzstd(0)
    ziua (0) zavi(PO) icp (PO) zcommon (PO) zmpair (P0) 2) INN und soc.acol
    snd_hda_codec generic snd_soc_core x86.pkg_temp_thermal intel.powerclamp
    mac80211 snd.compress ac57, bus andang event rai sebut mel.hdcp uvcvideo
    nei_xp btusb rmi_core rapi snd_seq serio.rou snd.raumidi think imi
    thinkpad,acpl intel.cstate intell

    un thunderbolt and timer input leds

    20.3347151 Joydev videodev processor thermal device.pci legacy bluetooth
    processor thermal device processor thermal and 400 thermal ecc mel me
    typec.ucsi typec acpi thermal rei intel.pch thermal mei nachid intel xhci
    usb role switch acpipat parport.p mirror de region.hash de log hid generic
    usbhid hid uas usb storage 1915 nouveau mimuni drabuddy 12c algo bit dreper
    then,ŽİNDİN

    process

    e1000e 12c 1801 thunderbolt nume.core 20.330656) 12c.mbus xhci.pci xhci.pci
    renesas uni video 20.344252) CR2: 0000000000000000

    20.3453971-- end trace 0000000000000000]--- 20.5130431 RIP: 0010:0M0

    20.520447) Code: Unable to access opcode bytes at RIP 0xff 20.521561) RSP:
    0018:ffffb17180087c90 EFLAGS: 00010202

    20.522717) 20.523863) RDX: 20.5250273 ROP: ffffb17100087ca8 R08:
    ffff0c43c1d89838 R09: 0000000

    RAKE 0000000000000000 RBX: ffffffff95538208 RCX: #fff8 1d89800
    ffffb17180087cdo RSI: 0000000000000004 RDI: #fff 1de9800

    20.528176) #10: 0000000000000000 R11: 0000000000000000 R12: 0000000 0004

    20.527375) 813: ffff@c45de65c000 R14: ffff8c43c1d89838 R15: fffff 553a208
    00007f37adf23940 (0000) 65:ffff6c5322700000 (0000) kniGS10 20.529755) CS:
    0010 DS: 0000 ES: 0000 CRO: 0000000080050033

    20.529568) FS:

    60550945) CR2: FEFEFTTEETTEFOS CRS: 000000011e1da002 CR4: 00000000003706e0
---
ProblemType: Bug
ApportVersion: 2.20.11-0ubuntu82.1
Architecture: amd64
AudioDevicesInUse:
 USER PID ACCESS COMMAND
 /dev/snd/controlC1: swagner 3181 F.... pulseaudio
 /dev/snd/pcmC1D0p: swagner 3181 F...m pulseaudio
 /dev/snd/controlC0: swagner 3181 F.... pulseaudio
CasperMD5CheckResult: unknown
CurrentDesktop: ubuntu:GNOME
DistroRelease: Ubuntu 22.04
InstallationDate: Installed on 2019-04-02 (1302 days ago)
InstallationMedia: Ubuntu 19.04 "Disco Dingo" - Alpha amd64 (20190326.2)
MachineType: LENOVO 20L5000BGE
Package: linux (not installed)
ProcFB: 0 i915drmfb
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-5.15.0-52-generic root=UUID=19884773-334a-4fab-b366-6504965c2348 ro quiet splash modeset.blacklist=nouveau vt.handoff=7
ProcVersionSignature: Ubuntu 5.15.0-52.58-generic 5.15.60
RelatedPackageVersions:
 linux-restricted-modules-5.15.0-52-generic N/A
 linux-backports-modules-5.15.0-52-generic N/A
 linux-firmware 20220329.git681281e4-0ubuntu3.6
Tags: jammy
Uname: Linux 5.15.0-52-generic x86_64
UpgradeStatus: Upgraded to jammy on 2022-04-25 (182 days ago)
UserGroups: adm cdrom dip docker lpadmin plugdev sambashare sudo wireshark
_MarkForUpload: True
dmi.bios.date: 07/22/2022
dmi.bios.release: 1.45
dmi.bios.vendor: LENOVO
dmi.bios.version: N24ET70W (1.45 )
dmi.board.asset.tag: Not Available
dmi.board.name: 20L5000BGE
dmi.board.vendor: LENOVO
dmi.board.version: Not Defined
dmi.chassis.asset.tag: No Asset Information
dmi.chassis.type: 10
dmi.chassis.vendor: LENOVO
dmi.chassis.version: None
dmi.ec.firmware.release: 1.22
dmi.modalias: dmi:bvnLENOVO:bvrN24ET70W(1.45):bd07/22/2022:br1.45:efr1.22:svnLENOVO:pn20L5000BGE:pvrThinkPadT480:rvnLENOVO:rn20L5000BGE:rvrNotDefined:cvnLENOVO:ct10:cvrNone:skuLENOVO_MT_20L5_BU_Think_FM_ThinkPadT480:
dmi.product.family: ThinkPad T480
dmi.product.name: 20L5000BGE
dmi.product.sku: LENOVO_MT_20L5_BU_Think_FM_ThinkPad T480
dmi.product.version: ThinkPad T480
dmi.sys.vendor: LENOVO

Revision history for this message
lirel (m8r-lcodw5) wrote :
Revision history for this message
lirel (m8r-lcodw5) wrote :
description: updated
Revision history for this message
Ubuntu Kernel Bot (ubuntu-kernel-bot) wrote : Missing required logs.

This bug is missing log files that will aid in diagnosing the problem. While running an Ubuntu kernel (not a mainline or third-party kernel) please enter the following command in a terminal window:

apport-collect 1994126

and then change the status of the bug to 'Confirmed'.

If, due to the nature of the issue you have encountered, you are unable to run this command, please add a comment stating that fact and change the bug status to 'Confirmed'.

This change has been made by an automated script, maintained by the Ubuntu Kernel Team.

Changed in linux (Ubuntu):
status: New → Incomplete
Revision history for this message
lirel (m8r-lcodw5) wrote : AlsaInfo.txt

apport information

tags: added: apport-collected jammy
description: updated
Revision history for this message
lirel (m8r-lcodw5) wrote : CRDA.txt

apport information

Revision history for this message
lirel (m8r-lcodw5) wrote : CurrentDmesg.txt

apport information

Revision history for this message
lirel (m8r-lcodw5) wrote : IwConfig.txt

apport information

Revision history for this message
lirel (m8r-lcodw5) wrote : Lspci.txt

apport information

Revision history for this message
lirel (m8r-lcodw5) wrote : Lspci-vt.txt

apport information

Revision history for this message
lirel (m8r-lcodw5) wrote : Lsusb.txt

apport information

Revision history for this message
lirel (m8r-lcodw5) wrote : Lsusb-t.txt

apport information

Revision history for this message
lirel (m8r-lcodw5) wrote : Lsusb-v.txt

apport information

Revision history for this message
lirel (m8r-lcodw5) wrote : PaInfo.txt

apport information

Revision history for this message
lirel (m8r-lcodw5) wrote :

I could not run the specified command running the affected kernel because its an kernel panic.
I could still run the command from an ubuntu 22.04 if logs about the hardware are interesting?

Revision history for this message
lirel (m8r-lcodw5) wrote : ProcCpuinfo.txt

apport information

Revision history for this message
lirel (m8r-lcodw5) wrote : ProcCpuinfoMinimal.txt

apport information

Revision history for this message
lirel (m8r-lcodw5) wrote : ProcEnviron.txt

apport information

Revision history for this message
lirel (m8r-lcodw5) wrote : ProcInterrupts.txt

apport information

Revision history for this message
lirel (m8r-lcodw5) wrote : ProcModules.txt

apport information

Revision history for this message
lirel (m8r-lcodw5) wrote : PulseList.txt

apport information

Revision history for this message
lirel (m8r-lcodw5) wrote : RfKill.txt

apport information

Revision history for this message
lirel (m8r-lcodw5) wrote : UdevDb.txt

apport information

Revision history for this message
lirel (m8r-lcodw5) wrote : WifiSyslog.txt

apport information

Revision history for this message
lirel (m8r-lcodw5) wrote : acpidump.txt

apport information

Changed in linux (Ubuntu):
status: Incomplete → Confirmed
lirel (m8r-lcodw5)
tags: added: kinetic
removed: jammy
Revision history for this message
Krisztian Poos (rocky-poos) wrote :
Download full text (14.3 KiB)

Also affected on a T480 without Nvidia GPU, and issue only occurs when notebook is docked onto docking station via usb-c.

OS randomly gives kernel panic, sometimes it works for hours, sometimes it drops panic just after the boot...

Oct 26 09:43:07 perseus kernel: [ 13.579008] BUG: kernel NULL pointer dereference, address: 0000000000000000
Oct 26 09:43:07 perseus kernel: [ 13.579042] #PF: supervisor instruction fetch in kernel mode
Oct 26 09:43:07 perseus kernel: [ 13.579062] #PF: error_code(0x0010) - not-present page
Oct 26 09:43:07 perseus kernel: [ 13.579081] PGD 0 P4D 0
Oct 26 09:43:07 perseus kernel: [ 13.579094] Oops: 0010 [#1] PREEMPT SMP PTI
Oct 26 09:43:07 perseus kernel: [ 13.579111] CPU: 5 PID: 2229 Comm: sensors Tainted: G OE 5.19.0-23-generic #24-Ubuntu
Oct 26 09:43:07 perseus kernel: [ 13.579141] Hardware name: LENOVO 20L50003HV/20L50003HV, BIOS N24ET70W (1.45 ) 07/22/2022
Oct 26 09:43:07 perseus kernel: [ 13.579167] RIP: 0010:0x0
Oct 26 09:43:07 perseus kernel: [ 13.579182] Code: Unable to access opcode bytes at RIP 0xffffffffffffffd6.
Oct 26 09:43:07 perseus kernel: [ 13.579204] RSP: 0018:ffffb3cd8143fc50 EFLAGS: 00010202
Oct 26 09:43:07 perseus kernel: [ 13.579223] RAX: 0000000000000000 RBX: 0000000000000002 RCX: 0000000000000000
Oct 26 09:43:07 perseus kernel: [ 13.579246] RDX: ffffb3cd8143fc70 RSI: 000000000000000c RDI: ffff9f5981791000
Oct 26 09:43:07 perseus kernel: [ 13.579269] RBP: ffffb3cd8143fc60 R08: ffffb3cd8143fca0 R09: 0000000000000001
Oct 26 09:43:07 perseus kernel: [ 13.579292] R10: 0000000000000000 R11: 0000000000000000 R12: ffffb3cd8143fca0
Oct 26 09:43:07 perseus kernel: [ 13.579315] R13: ffffb3cd8143fda0 R14: 0000000000000001 R15: ffff9f59810f5960
Oct 26 09:43:07 perseus kernel: [ 13.579339] FS: 00007f7c9468f740(0000) GS:ffff9f60e2740000(0000) knlGS:0000000000000000
Oct 26 09:43:07 perseus kernel: [ 13.579365] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
Oct 26 09:43:07 perseus kernel: [ 13.579386] CR2: ffffffffffffffd6 CR3: 000000010df50001 CR4: 00000000003706e0
Oct 26 09:43:07 perseus kernel: [ 13.579410] Call Trace:
Oct 26 09:43:07 perseus kernel: [ 13.579420] <TASK>
Oct 26 09:43:07 perseus kernel: [ 13.579430] power_supply_get_property+0x1d/0x60
Oct 26 09:43:07 perseus kernel: [ 13.579453] power_supply_hwmon_read+0xb4/0x130
Oct 26 09:43:07 perseus kernel: [ 13.579473] hwmon_attr_show+0x44/0x110
Oct 26 09:43:07 perseus kernel: [ 13.579491] dev_attr_show+0x1a/0x50
Oct 26 09:43:07 perseus kernel: [ 13.579508] sysfs_kf_seq_show+0xa0/0x100
Oct 26 09:43:07 perseus kernel: [ 13.579526] kernfs_seq_show+0x23/0x40
Oct 26 09:43:07 perseus kernel: [ 13.579541] seq_read_iter+0x132/0x480
Oct 26 09:43:07 perseus kernel: [ 13.579557] ? _copy_to_user+0x25/0x60
Oct 26 09:43:07 perseus kernel: [ 13.579572] kernfs_fop_read_iter+0x34/0x40
Oct 26 09:43:07 perseus kernel: [ 13.579587] new_sync_read+0x12e/0x1c0
Oct 26 09:43:07 perseus kernel: [ 13.579605] vfs_read+0x15a/0x1b0
Oct 26 09:43:07 perseus kernel: [ 13.579621] ksys_read+0x73/0x100
Oct 26 09:43:07 perseus kernel: [ 13.579638] __x64_sys_read+0x19/0x30
Oct 26 09:43:07 pe...

Revision history for this message
lirel (m8r-lcodw5) wrote :
lirel (m8r-lcodw5)
description: updated
Revision history for this message
DanWei (danielweigl) wrote :

I see the same behaviour on my ThinkPad T15p after updating to 22.10 (from 22.04) - booting with the new 5.19.0-23-generic fails with a kernelpanic in `power_supply_get_property`. I can only boot by choosing an older kernel in GRUB.

The boot-panic message is attached:

Revision history for this message
lirel (m8r-lcodw5) wrote :

A very promising patch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.19.16&id=3d4044c9e6d2e3f11f1f8b5e0ee8647d3eb1afad is included in upstream Linux kernel https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/log/?h=v5.19.8
Let's hope this will be picked for some 22.10.1 release soon.

@danielweigl were you using some kind of usb port repeater or docking station?

Revision history for this message
DanWei (danielweigl) wrote :

@m8r-lcodw5 yes - a original Lenovo "USB-C Dock Gen2", but the laptop also is plugged in to a normal charging adapter (the rectangular one), because the USB-C PD via the dock does not provided enough power to allow the laptop to charge - if that matters.

Revision history for this message
Julian Santander (jsantander2) wrote :

I'm experiencing the same problem.
My equipment is a Lenovo P53 laptop, the kernel panic happens when connected to the Lenovo USB-C Dock and booting to the 5.19 kernel.

Revision history for this message
DanWei (danielweigl) wrote :

Yes, its definitly related to the USB-C Dock - if i boot without the dock plugged in, it boots just fine with 5.19.0-23-generic.

And it also works as expected if i plug the dock in, when it has booted to the Login-Screen.

Revision history for this message
Manfred Thole (tanfred) wrote :

I have the same problem with a T580 connected to the Lenovo Ultra Dock (40aj).
When I boot without the dock on battery or with the power supply connected, it works with 5.19.0-23-generic without problems. If the login screen is there, I can also use the dock without problems.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in linux (Ubuntu Kinetic):
status: New → Confirmed
Revision history for this message
Zhimin Lin (leolin479) wrote :

I have the same issue for my Thinkpad P53 and I don't have a dock. It definitely related to the usb-c.

case 1: If I connect my external monitor to usb-c port, it may panic on boot ( I say "may" because sometime it can last till I successfully login and run for a minute or so and then it hangs and I have to hard reboot by pressing power button for a few seconds)
case 2: After I switch my external monitor to HDMI, the issue never happen
case 3: If I connect my iphone to the usb-c port before reboot, it can also panic
case 4: I disconnected iphone then power up and it can successfully boot. Connect iphone to the usb-c after boot and it has no issue.

Revision history for this message
lirel (m8r-lcodw5) wrote :

Back in October I already mentioned what would fix this issue, but afaik nobody did backport the needed change from 5.19.8 to any respin of the installer iso. So for me there is no way to install ubuntu 22.10 by now. Let's keep watching for duplicates of this bug that might get more attention by the kernel-team until they apply the patch. Launchpad doesn't give me any buttons to draw more attention to this issue or provide changes to the package directly. But i can try to upload the *SPECULATIVE* patch from kernel.org again ;)

tags: added: patch
Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :

The fix is included in 5.19.0-28.29, which is in kinetic-proposed.

Revision history for this message
lirel (m8r-lcodw5) wrote :

@kaihengfeng nice, is there some live or installer .iso to try it out?

Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :

Install with kernel parameter "modprobe.blacklist=ucsi_acpi,ucsi_ccg" to avoid the issue and remove the line when kernel fix is landed.

Revision history for this message
lirel (m8r-lcodw5) wrote :

@kaihengfeng Booting an Live ISO with the mentioned blacklisting did work out well.
Also installing Ubuntu 2022.10 via do-release-upgrade was a success, because it installed the new kernel, that didn't pose any problem with the mentioned hardware.

Can we close this ticket, or should we wait until Live ISOs contain the patched kernel as well?

Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :

There will not be any update ISO for 22.10 unfortunately.

The best bet is to use 23.04 daily image for newer kernel:
https://cdimages.ubuntu.com/daily-live/current/

Revision history for this message
lirel (m8r-lcodw5) wrote :

Okay since the upcomming jammy 22.04.2 will contain those patches as well, we can close this bug
https://launchpad.net/ubuntu/+source/linux-hwe-5.19/

Changed in linux (Ubuntu):
status: Confirmed → Fix Released
Changed in linux (Ubuntu Kinetic):
status: Confirmed → Fix Committed
Revision history for this message
lirel (m8r-lcodw5) wrote (last edit ):

Not in installer images by now but dist-upgrade would use the patched kernel that can boot thinkpads again.

Revision history for this message
Utkarsh Gupta (utkarsh) wrote :

Ubuntu 22.10 (Kinetic Kudu) has reached end of life, so this bug will not be fixed for that specific release.

Changed in linux (Ubuntu Kinetic):
status: Fix Committed → Won't Fix
To post a comment you must log in.