Re: [patch 064/158] mm: add generic ptdump

Borislav Petkov
2019-12-01T15:21:34Z

On Sun, Dec 01, 2019 at 04:10:11PM +0100, Borislav Petkov wrote:
> So lemme first confirm it really is caused by those patches.

Yeah, those patches are causing it. Tried your current master - it is OK
- and then applied Andrew's patches I was CCed on, ontop, and I got in a
VM:

VFS: Mounted root (ext4 filesystem) readonly on device 8:2.
devtmpfs: mounted
Freeing unused kernel image (initmem) memory: 664K
Write protecting kernel text and read-only data: 18164k
NX-protecting the kernel data: 7416k
BUG: kernel NULL pointer dereference, address: 00000014
#PF: supervisor read access in kernel mode
#PF: error_code(0x0000) - not-present page
*pdpt = 0000000000000000 *pde = f000ff53f000ff53
Oops: 0000 [#1] PREEMPT SMP PTI
CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.4.0+ #3
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.11.1-1 04/01/2014
EIP: __lock_acquire.isra.0+0x2e8/0x4e0
Code: e8 bd a1 2f 00 85 c0 74 11 8b 1d 08 8f 26 c5 85 db 0f 84 05 1a 00 00 8d 76 00 31 db 8d 65 f4 89 d8 5b 5e 5f 5d c3 8d 74 26 00 <8b> 44 90 04 85 c0 0f 85 4c fd ff ff e9 33 fd ff ff 8d b4 26 00 00
EAX: 00000010 EBX: 00000010 ECX: 00000001 EDX: 00000000
ESI: f1070040 EDI: f1070040 EBP: f1073e04 ESP: f1073de0
DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068 EFLAGS: 00010097
CR0: 80050033 CR2: 00000014 CR3: 05348000 CR4: 001406b0
Call Trace:
lock_acquire+0x42/0x60
? __walk_page_range+0x4d9/0x590
_raw_spin_lock+0x22/0x40
? __walk_page_range+0x4d9/0x590
__walk_page_range+0x4d9/0x590
walk_page_range_novma+0x57/0xa0
ptdump_walk_pgd+0x38/0x70
ptdump_walk_pgd_level_core+0x66/0x90
? ptdump_walk_pgd_level_core+0x90/0x90
ptdump_walk_pgd_level_checkwx+0x16/0x19
mark_rodata_ro+0x95/0x9a
? rest_init+0xfb/0xfb
kernel_init+0x25/0xe5
ret_from_fork+0x2e/0x38
Modules linked in:
CR2: 0000000000000014
---[ end trace 8b67ede738f0029a ]---
EIP: __lock_acquire.isra.0+0x2e8/0x4e0
Code: e8 bd a1 2f 00 85 c0 74 11 8b 1d 08 8f 26 c5 85 db 0f 84 05 1a 00 00 8d 76 00 31 db 8d 65 f4 89 d8 5b 5e 5f 5d c3 8d 74 26 00 <8b> 44 90 04 85 c0 0f 85 4c fd ff ff e9 33 fd ff ff 8d b4 26 00 00
EAX: 00000010 EBX: 00000010 ECX: 00000001 EDX: 00000000
ESI: f1070040 EDI: f1070040 EBP: f1073e04 ESP: f1073de0
DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068 EFLAGS: 00010097
CR0: 80050033 CR2: 00000014 CR3: 05348000 CR4: 001406b0
note: swapper/0[1] exited with preempt_count 1
Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000009
Kernel Offset: disabled
---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000009 ]---