Subject: [Bug 215389] pagealloc: memory corruption at building glibc-2.33 and running its' testsuite

From: [email-masked]
Date: Mon, 16 May 2022 18:51:04 +0000

https://bugzilla.kernel.org/show_bug.cgi?id=215389

--- Comment #22 from Erhard F. ([email-masked]) ---
Created attachment 300977
  --> https://bugzilla.kernel.org/attachment.cgi?id=300977&action=edit
dmesg (5.18-rc6, CONFIG_LOWMEM_SIZE=0x28000000, outline KASAN, PowerMac G4 DP)

I increased THREAD_SHIFT to 14 and used outline KASAN still with
CONFIG_LOWMEM_SIZE=0x28000000. The memory corruption output looks slightly
different (but not much):

[...]
pagealloc: memory corruption
f5fcfff0: 00 00 00 00                                      ....
CPU: 1 PID: 29742 Comm: ld.so.1 Not tainted 5.18.0-rc6-PMacG4 #7
Call Trace:
[eea3ba90] [c09890d4] dump_stack_lvl+0x80/0xc0 (unreliable)
[eea3bab0] [c03cce40] __kernel_unpoison_pages+0x208/0x250
[eea3bb00] [c03a2e48] post_alloc_hook+0x108/0x144
[eea3bb30] [c03a66e0] get_page_from_freelist+0x9d4/0x12dc
[eea3bc70] [c03a7ad0] __alloc_pages+0x23c/0x1570
[eea3bde0] [c0379c8c] handle_mm_fault+0x610/0x1240
[eea3bed0] [c002e2d4] ___do_page_fault+0x19c/0x850
[eea3bf10] [c002ebbc] do_page_fault+0x28/0x5c
[eea3bf30] [c000433c] DataAccess_virt+0x124/0x17c
--- interrupt: 300 at 0x6fe0338c
NIP:  6fe0338c LR: 6fe032c4 CTR: 6fe033e0
REGS: eea3bf40 TRAP: 0300   Not tainted  (5.18.0-rc6-PMacG4)
MSR:  0000d032 <EE,PR,ME,IR,DR,RI>  CR: 48002262  XER: 20000000
DAR: 046a5000 DSISR: 42000000 
GPR00: 6ffbcb94 afc45940 a7c95560 046a4fe4 8a000000 000127e0 03e59a8b 00000003 
GPR08: 046a5004 046a5000 04621cfc 6fe03170 6fe032c4 6ffece34 00000000 6ffef34d 
GPR16: 02dea020 04416750 00000003 01f8cbec 02de9fa0 01f8c660 00000000 00000000 
GPR24: afc45aa0 6ffef37c afc45a18 04678c7c 0007630c 04678c7c 6ff76ff4 045f5990 
NIP [6fe0338c] 0x6fe0338c
LR [6fe032c4] 0x6fe032c4
--- interrupt: 300
page:e739d6ec refcount:1 mapcount:0 mapping:00000000 index:0x1 pfn:0x290a3
flags: 0x80000000(zone=2)
raw: 80000000 00000100 00000122 00000000 00000001 00000000 ffffffff 00000001
raw: 00000000
page dumped because: pagealloc: corrupted page details
[...]

With THREAD_SHIFT=14 the stack issue does not show up.

A kernel with inline KASAN and same setup otherwise won't boot showing me this
at the OpenFirmware prompt:

[...]
Finalizing device tree... using OF tree (promptr=ff847240)

Invalid memory access at %SRR0: 40000000 %SRR1: 00000000

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.