android_kernel_motorola_sm6375/drivers/acpi
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Seiji Nishikawa 82191a21a0 ACPI: PAD: fix crash in exit_round_robin()
commit 0a2ed70a549e61c5181bad5db418d223b68ae932 upstream.

The kernel occasionally crashes in cpumask_clear_cpu(), which is called
within exit_round_robin(), because when executing clear_bit(nr, addr) with
nr set to 0xffffffff, the address calculation may cause misalignment within
the memory, leading to access to an invalid memory address.

----------
BUG: unable to handle kernel paging request at ffffffffe0740618
        ...
CPU: 3 PID: 2919323 Comm: acpi_pad/14 Kdump: loaded Tainted: G           OE  X --------- -  - 4.18.0-425.19.2.el8_7.x86_64 #1
        ...
RIP: 0010:power_saving_thread+0x313/0x411 [acpi_pad]
Code: 89 cd 48 89 d3 eb d1 48 c7 c7 55 70 72 c0 e8 64 86 b0 e4 c6 05 0d a1 02 00 01 e9 bc fd ff ff 45 89 e4 42 8b 04 a5 20 82 72 c0 <f0> 48 0f b3 05 f4 9c 01 00 42 c7 04 a5 20 82 72 c0 ff ff ff ff 31
RSP: 0018:ff72a5d51fa77ec8 EFLAGS: 00010202
RAX: 00000000ffffffff RBX: ff462981e5d8cb80 RCX: 0000000000000000
RDX: 0000000000000000 RSI: 0000000000000246 RDI: 0000000000000246
RBP: ff46297556959d80 R08: 0000000000000382 R09: ff46297c8d0f38d8
R10: 0000000000000000 R11: 0000000000000001 R12: 000000000000000e
R13: 0000000000000000 R14: ffffffffffffffff R15: 000000000000000e
FS:  0000000000000000(0000) GS:ff46297a800c0000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffffffe0740618 CR3: 0000007e20410004 CR4: 0000000000771ee0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
PKRU: 55555554
Call Trace:
 ? acpi_pad_add+0x120/0x120 [acpi_pad]
 kthread+0x10b/0x130
 ? set_kthread_struct+0x50/0x50
 ret_from_fork+0x1f/0x40
        ...
CR2: ffffffffe0740618

crash> dis -lr ffffffffc0726923
        ...
/usr/src/debug/kernel-4.18.0-425.19.2.el8_7/linux-4.18.0-425.19.2.el8_7.x86_64/./include/linux/cpumask.h: 114
0xffffffffc0726918 <power_saving_thread+776>:	mov    %r12d,%r12d
/usr/src/debug/kernel-4.18.0-425.19.2.el8_7/linux-4.18.0-425.19.2.el8_7.x86_64/./include/linux/cpumask.h: 325
0xffffffffc072691b <power_saving_thread+779>:	mov    -0x3f8d7de0(,%r12,4),%eax
/usr/src/debug/kernel-4.18.0-425.19.2.el8_7/linux-4.18.0-425.19.2.el8_7.x86_64/./arch/x86/include/asm/bitops.h: 80
0xffffffffc0726923 <power_saving_thread+787>:	lock btr %rax,0x19cf4(%rip)        # 0xffffffffc0740620 <pad_busy_cpus_bits>

crash> px tsk_in_cpu[14]
$66 = 0xffffffff

crash> px 0xffffffffc072692c+0x19cf4
$99 = 0xffffffffc0740620

crash> sym 0xffffffffc0740620
ffffffffc0740620 (b) pad_busy_cpus_bits [acpi_pad]

crash> px pad_busy_cpus_bits[0]
$42 = 0xfffc0
----------

To fix this, ensure that tsk_in_cpu[tsk_index] != -1 before calling
cpumask_clear_cpu() in exit_round_robin(), just as it is done in
round_robin_cpu().

Signed-off-by: Seiji Nishikawa <snishika@redhat.com>
Link: https://patch.msgid.link/20240825141352.25280-1-snishika@redhat.com
[ rjw: Subject edit, avoid updates to the same value ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Nobuhiro Iwamatsu (CIP) <nobuhiro1.iwamatsu@toshiba.co.jp>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-07-17 18:25:00 +02:00
..
acpica ACPICA: Refuse to evaluate a method if arguments are missing 2025-07-17 18:24:58 +02:00
apei APEI: GHES: Have GHES honor the panic= setting 2025-03-13 12:43:03 +01:00
arm64 acpi/arm64: Adjust error handling procedure in gtdt_parse_timer_block() 2024-12-14 19:44:22 +01:00
dptf
hmat
nfit ACPI: NFIT: fix a potential deadlock during NFIT teardown 2023-03-03 11:41:47 +01:00
pmic ACPI: PMIC: Remove unneeded check in tps68470_pmic_opregion_probe() 2024-11-08 16:20:26 +01:00
x86
ac.c
acpi_adxl.c
acpi_amba.c
acpi_apd.c
acpi_cmos_rtc.c
acpi_configfs.c
acpi_dbg.c
acpi_extlog.c ACPI: extlog: fix NULL pointer dereference check 2024-02-23 08:24:54 +01:00
acpi_ipmi.c
acpi_lpat.c
acpi_lpit.c ACPI: LPIT: Avoid u32 multiplication overflow 2024-01-25 14:34:22 -08:00
acpi_lpss.c
acpi_memhotplug.c
acpi_pad.c ACPI: PAD: fix crash in exit_round_robin() 2025-07-17 18:25:00 +02:00
acpi_platform.c
acpi_pnp.c
acpi_processor.c ACPI: processor: Fix memory leaks in error paths of processor_add() 2024-09-12 11:03:56 +02:00
acpi_tad.c
acpi_video.c ACPI: video: Add quirk for the Colorful X15 AT 23 Laptop 2024-02-23 08:24:54 +01:00
acpi_watchdog.c
battery.c ACPI: battery: negate current when discharging 2025-06-27 11:02:53 +01:00
bgrt.c
blacklist.c
bus.c
button.c ACPI: button: Add DMI quirk for Samsung Galaxy Book2 to fix initial lid detection issue 2024-11-08 16:20:51 +01:00
cm_sbs.c
container.c
cppc_acpi.c
custom_method.c
debugfs.c
device_pm.c
device_sysfs.c ACPI: sysfs: validate return type of _STR method 2024-11-08 16:20:34 +01:00
dock.c
ec.c ACPI: EC: Do not release locks during operation region accesses 2024-11-08 16:20:37 +01:00
ec_sys.c
event.c
evged.c
fan.c
glue.c
hed.c ACPI: HED: Always initialize before evged 2025-06-04 14:32:33 +02:00
internal.h
ioapic.c
irq.c ACPI: irq: Fix incorrect return value in acpi_register_gsi() 2023-10-25 11:53:24 +02:00
Kconfig ACPI: HED: Always initialize before evged 2025-06-04 14:32:33 +02:00
Makefile
numa.c
nvs.c
osi.c ACPI: OSI: Stop advertising support for "3.0 _SCP Extensions" 2025-06-27 11:02:45 +01:00
osl.c
pci_irq.c
pci_link.c
pci_mcfg.c
pci_root.c
pci_slot.c
power.c
pptt.c ACPI: PPTT: Fix processor subtable walk 2025-06-04 14:32:29 +02:00
proc.c
processor_core.c
processor_driver.c
processor_idle.c ACPI: processor_idle: Fix invalid comparison with insertion sort for latency 2024-07-27 10:38:32 +02:00
processor_pdc.c
processor_perflib.c ACPI: processor: perflib: Avoid updating frequency QoS unnecessarily 2023-08-11 11:53:53 +02:00
processor_thermal.c ACPI: processor: Remove freq Qos request for all CPUs 2022-09-05 10:27:44 +02:00
processor_throttling.c
property.c acpi: property: Let args be NULL in __acpi_node_get_property_reference 2024-01-25 14:34:31 -08:00
reboot.c
resource.c ACPI: resource: Skip IRQ override on ASUS Vivobook 14 X1404VAP 2025-04-10 14:29:43 +02:00
sbs.c ACPI: SBS: manage alarm sysfs attribute through psy core 2024-08-19 05:33:47 +02:00
sbshc.c
sbshc.h
scan.c ACPI: scan: Fix device check notification handling 2024-03-26 18:22:16 -04:00
sleep.c Revert "ACPI: PM: Block ASUS B1400CEAE from suspend to idle by default" 2024-04-13 12:51:38 +02:00
sleep.h
spcr.c
sysfs.c
tables.c
thermal.c ACPI: thermal: drop an always true check 2023-06-09 10:29:01 +02:00
utils.c
video_detect.c ACPI: video: Add backlight=native DMI quirk for Lenovo Ideapad Z470 2023-09-23 11:00:03 +02:00
wakeup.c