Repository navigation
Closed
Labels
[BUG] linuxA bug that should be fixed in the mainline kernel.[FIXED][LINUX] development cycleThis bug was only present and fixed in a -next or -rc cycle
Description
Hello, it's-a me again with my ye-olde crashing x86_32 box. 😉 CONFIG_STACKPROTECTOR is not set this time.
I gave kernel 6.7-rc1 a test ride and it crashes at boot with:
BUG: kernel NULL pointer dereference, address: 00000007
#PF: supervisor read access in kernel mode
#PF: error_code(0x0000) - not-present page
*pdpt = 0000000002398001 *pde = 0000000000000000
Oops: 0000 [#1] SMP PTI
CPU: 1 PID: 1 Comm: systemd Not tainted 6.7.0-rc1-P3 #1
Hardware name: LENOVO 2007F2G/2007F2G, BIOS 79ETE7WW (2.27 ) 03/21/2011
EIP: obj_cgroup_charge_pages+0xc/0xa8
Code: 75 ee eb cf 31 db 4b eb a0 e8 34 fe ff ff 89 c3 eb 93 8b 43 04 f0 83 00 01 eb b0 90 90 90 55 89 e5 53 57 56 83 ec 08 8b 7d 08 <8b> 71 08 f6 46 2c 01 75 38 8b 46 08 a8 03 74 2e 8b 46 0c 89 45 ec
EAX: 00000001 EBX: 00000000 ECX: ffffffff EDX: 00400cc0
ESI: ffffffff EDI: 00000001 EBP: c1155ce8 ESP: c1155cd4
DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068 EFLAGS: 00210286
CR0: 80050033 CR2: 00000007 CR3: 0204e000 CR4: 000006f0
Call Trace:
? show_regs+0x4e/0x5c
? __die_body+0x11/0x4c
? __die+0x21/0x30
? page_fault_oops+0x20f/0x238
? mt_find+0x94/0x15c
? kernelmode_fixup_or_oops+0x92/0xa8
? __bad_area_nosemaphore+0x40/0x168
? bad_area_nosemaphore+0xd/0x14
? exc_page_fault+0x277/0x32c
? doublefault_shim+0x100/0x100
? handle_exception+0x101/0x101
? add_swap_count_continuation+0x1af/0x204
? doublefault_shim+0x100/0x100
? obj_cgroup_charge_pages+0xc/0xa8
? doublefault_shim+0x100/0x100
? obj_cgroup_charge_pages+0xc/0xa8
obj_cgroup_charge+0x8d/0xcc
pcpu_alloc+0x107/0x5c0
? cgroup_apply_control_enable+0xb1/0x250
__alloc_percpu_gfp+0x10/0x18
mem_cgroup_css_alloc+0xea/0x498
cgroup_apply_control_enable+0xb1/0x250
? css_populate_dir+0xb5/0xd0
cgroup_mkdir+0x1a2/0x2f4
? css_task_iter_end+0xbc/0xbc
kernfs_iop_mkdir+0x52/0x68
? kernfs_iop_lookup+0xc0/0xc0
vfs_mkdir+0x149/0x198
do_mkdirat+0x72/0xb4
__ia32_sys_mkdir+0x23/0x2c
__do_fast_syscall_32+0x86/0xb0
? kmem_cache_free+0x2c3/0x2f0
? putname+0x3c/0x48
? putname+0x3c/0x48
? putname+0x3c/0x48
? syscall_exit_to_user_mode+0x1d/0x90
? __do_fast_syscall_32+0x92/0xb0
? syscall_exit_to_user_mode+0x1d/0x90
? __do_fast_syscall_32+0x92/0xb0
? __ia32_sys_clock_gettime+0x86/0xa0
? syscall_exit_to_user_mode+0x1d/0x90
? __do_fast_syscall_32+0x92/0xb0
? irqentry_exit_to_user_mode+0xa/0x1c
? irqentry_exit+0x12/0x2c
? exc_page_fault+0x112/0x32c
do_fast_syscall_32+0x29/0x54
do_SYSENTER_32+0x12/0x18
entry_SYSENTER_32+0x98/0xf1
EIP: 0xb7fc8539
Code: 03 74 b4 01 10 07 03 74 b0 01 10 08 03 74 d8 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 51 52 55 89 e5 0f 34 cd 80 <5d> 5a 59 c3 90 90 90 90 0f 1f 00 58 b8 77 00 00 00 cd 80 90 0f 1f
EAX: ffffffda EBX: 00a89d50 ECX: 000001ed EDX: b79f9e4c
ESI: b7ab3614 EDI: 00ad7dc0 EBP: bfea7578 ESP: bfea7508
DS: 007b ES: 007b FS: 0000 GS: 0033 SS: 007b EFLAGS: 00200292
? asm_exc_nmi+0xb0/0x10d
Modules linked in: dmi_sysfs
CR2: 0000000000000007
---[ end trace 0000000000000000 ]---
EIP: obj_cgroup_charge_pages+0xc/0xa8
Code: 75 ee eb cf 31 db 4b eb a0 e8 34 fe ff ff 89 c3 eb 93 8b 43 04 f0 83 00 01 eb b0 90 90 90 55 89 e5 53 57 56 83 ec 08 8b 7d 08 <8b> 71 08 f6 46 2c 01 75 38 8b 46 08 a8 03 74 2e 8b 46 0c 89 45 ec
EAX: 00000001 EBX: 00000000 ECX: ffffffff EDX: 00400cc0
ESI: ffffffff EDI: 00000001 EBP: c1155ce8 ESP: c1155cd4
DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068 EFLAGS: 00210286
CR0: 80050033 CR2: 00000007 CR3: 0204e000 CR4: 000006f0
Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000009
Kernel Offset: disabled
Rebooting in 40 seconds..
dmesg was captured via netconsole. The gcc-13 built kernel with the same .config boots just fine,
Some data about the hardware:
# inxi -bz
System:
Kernel: 6.7.0-rc1-P3 arch: i686 bits: 32 Console: pty pts/0 Distro: Gentoo
Base System release 2.14
Machine:
Type: Laptop System: LENOVO product: 2007F2G v: ThinkPad T60
serial: <filter>
Mobo: LENOVO model: 2007F2G serial: <filter> BIOS: LENOVO
v: 79ETE7WW (2.27 ) date: 03/21/2011
Battery:
ID-1: BAT0 charge: 35.7 Wh (99.7%) condition: 35.8/56.2 Wh (63.7%)
CPU:
Info: dual core Intel T2400 [MCP] speed (MHz): avg: 1000 min/max: 1000/1833
Graphics:
Device-1: AMD RV515/M52 [Mobility Radeon X1300] driver: radeon v: kernel
Display: x11 server: X.org v: 1.21.1.9 driver: X: loaded: radeon
unloaded: fbdev,modesetting dri: r300 gpu: radeon
resolution: <missing: xdpyinfo/xrandr> resolution: 1024x768
API: OpenGL v: 4.5 Mesa 23.3.0-rc3 (git-65109bc8ac) renderer: llvmpipe
(LLVM 16.0.6 128 bits)
Network:
Device-1: Intel 82573L Gigabit Ethernet driver: e1000e
Device-2: Intel PRO/Wireless 3945ABG [Golan] Network driver: iwl3945
Drives:
Local Storage: total: 465.76 GiB used: 10.89 GiB (2.3%)
Info:
Processes: 221 Uptime: 44m Memory: available: 2.95 GiB
used: 472.7 MiB (15.6%) Shell: Bash inxi: 3.3.27
# lspci
00:00.0 Host bridge: Intel Corporation Mobile 945GM/PM/GMS, 943/940GML and 945GT Express Memory Controller Hub (rev 03)
00:01.0 PCI bridge: Intel Corporation Mobile 945GM/PM/GMS, 943/940GML and 945GT Express PCI Express Root Port (rev 03)
00:1b.0 Audio device: Intel Corporation NM10/ICH7 Family High Definition Audio Controller (rev 02)
00:1c.0 PCI bridge: Intel Corporation NM10/ICH7 Family PCI Express Port 1 (rev 02)
00:1c.1 PCI bridge: Intel Corporation NM10/ICH7 Family PCI Express Port 2 (rev 02)
00:1c.2 PCI bridge: Intel Corporation NM10/ICH7 Family PCI Express Port 3 (rev 02)
00:1c.3 PCI bridge: Intel Corporation NM10/ICH7 Family PCI Express Port 4 (rev 02)
00:1d.0 USB controller: Intel Corporation NM10/ICH7 Family USB UHCI Controller #1 (rev 02)
00:1d.1 USB controller: Intel Corporation NM10/ICH7 Family USB UHCI Controller #2 (rev 02)
00:1d.2 USB controller: Intel Corporation NM10/ICH7 Family USB UHCI Controller #3 (rev 02)
00:1d.3 USB controller: Intel Corporation NM10/ICH7 Family USB UHCI Controller #4 (rev 02)
00:1d.7 USB controller: Intel Corporation NM10/ICH7 Family USB2 EHCI Controller (rev 02)
00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev e2)
00:1f.0 ISA bridge: Intel Corporation 82801GBM (ICH7-M) LPC Interface Bridge (rev 02)
00:1f.1 IDE interface: Intel Corporation 82801G (ICH7 Family) IDE Controller (rev 02)
00:1f.2 SATA controller: Intel Corporation 82801GBM/GHM (ICH7-M Family) SATA Controller [AHCI mode] (rev 02)
00:1f.3 SMBus: Intel Corporation NM10/ICH7 Family SMBus Controller (rev 02)
01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] RV515/M52 [Mobility Radeon X1300]
02:00.0 Ethernet controller: Intel Corporation 82573L Gigabit Ethernet Controller
03:00.0 Network controller: Intel Corporation PRO/Wireless 3945ABG [Golan] Network Connection (rev 02)
15:00.0 CardBus bridge: Texas Instruments PCI1510 PC card Cardbus Controller
Kernel .config and both dmesg outputs attached.
config_67-rc1_p3.txt
clang16_dmesg_67-rc1_p3.txt
gcc13_dmesg_67-rc1_p3.txt
Metadata
Metadata
Assignees
Labels
[BUG] linuxA bug that should be fixed in the mainline kernel.[FIXED][LINUX] development cycleThis bug was only present and fixed in a -next or -rc cycle
Activity
nathanchance commentedon Nov 14, 2023
If this doesn't happen with 6.6, can you bisect Linux to see what change introduced this in 6.7-rc1?
ernsteiswuerfel commentedon Nov 14, 2023
The bisect was straightforward so it didn't take me long:
Simply reverting this rather big patch failed however so I was not able to test v6.7-r1 with the changes reverted for now.
bisect.log
nathanchance commentedon Nov 14, 2023
That change is a part of a larger series. It reverts cleanly for me on 6.7-rc1 with the following
gitcommand:Unfortunately, none of the sanitizers like KASAN, KCSAN, or KMSAN support 32-bit x86, so those won't really help us here :/ It may be worth reporting this upstream directly to see if the developer of that change could spot anything obviously wrong with it in this context. They could just be getting lucky that they are not hitting this issue with GCC.
ernsteiswuerfel commentedon Nov 15, 2023
Your git command worked in cleanly reverting the series. Thanks! Also with the patch reverted the kernel boots ok.
As suggested I reported it upstream. [email protected] mailing list seemed the proper place for me:
https://lore.kernel.org/linux-mm/20231115011506.0edd8870@yea/
ernsteiswuerfel commentedon Nov 15, 2023
Turns out the issue also happens on x86_64! At least I strongly suppose it's the same issue as reverting the bisected patchset also 'fixes' the clang-16 built kernel.
The trace looks a bit different thouth. I also enabled KASAN:
config_67-rc1_zen3.txt
dmesg_67-rc1_zen3_02.log
mm: kmem: properly initialize local objcg variable in current_obj_cgr…
nathanchance commentedon Nov 16, 2023
I should have caught
CONFIG_INIT_STACK_ALL_PATTERN=y...Fix: https://lore.kernel.org/[email protected]/
mm: kmem: properly initialize local objcg variable in current_obj_cgr…
mm: kmem: properly initialize local objcg variable in current_obj_cgr…
mm: kmem: properly initialize local objcg variable in current_obj_cgr…
mm: kmem: properly initialize local objcg variable in current_obj_cgr…
mm: kmem: properly initialize local objcg variable in current_obj_cgr…
mm: kmem: properly initialize local objcg variable in current_obj_cgr…
8 remaining items
mm: kmem: properly initialize local objcg variable in current_obj_cgr…
mm: kmem: properly initialize local objcg variable in current_obj_cgr…
mm: kmem: properly initialize local objcg variable in current_obj_cgr…
mm: kmem: properly initialize local objcg variable in current_obj_cgr…
nathanchance commentedon Dec 12, 2023
https://git.kernel.org/linus/5f79489a73d77419d18952e0258efbd5ecb74770
mm: kmem: properly initialize local objcg variable in current_obj_cgr…
mm: kmem: properly initialize local objcg variable in current_obj_cgr…
mm: kmem: properly initialize local objcg variable in current_obj_cgr…
mm: kmem: properly initialize local objcg variable in current_obj_cgr…
mm: kmem: properly initialize local objcg variable in current_obj_cgr…
mm: kmem: properly initialize local objcg variable in current_obj_cgr…
mm: kmem: properly initialize local objcg variable in current_obj_cgr…