Hay
Date
June 7, 2025, 10:40 a.m.

Environment
qemu-arm64
qemu-x86_64

[   21.372941] ==================================================================
[   21.373887] BUG: KASAN: slab-out-of-bounds in kmalloc_oob_memset_4+0x15c/0x318
[   21.374653] Write of size 4 at addr fff00000c41c1775 by task kunit_try_catch/162
[   21.375429] 
[   21.376186] CPU: 0 UID: 0 PID: 162 Comm: kunit_try_catch Tainted: G    B            N 6.12.33-rc1 #1
[   21.376870] Tainted: [B]=BAD_PAGE, [N]=TEST
[   21.376910] Hardware name: linux,dummy-virt (DT)
[   21.376947] Call trace:
[   21.377003]  dump_backtrace+0x9c/0x128
[   21.377060]  show_stack+0x20/0x38
[   21.377102]  dump_stack_lvl+0x8c/0xd0
[   21.377147]  print_report+0x118/0x5f0
[   21.377191]  kasan_report+0xdc/0x128
[   21.377234]  kasan_check_range+0x100/0x1a8
[   21.377280]  __asan_memset+0x34/0x78
[   21.377324]  kmalloc_oob_memset_4+0x15c/0x318
[   21.377373]  kunit_try_run_case+0x170/0x3f0
[   21.377418]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   21.377469]  kthread+0x24c/0x2d0
[   21.377515]  ret_from_fork+0x10/0x20
[   21.377563] 
[   21.385843] Allocated by task 162:
[   21.386399]  kasan_save_stack+0x3c/0x68
[   21.386949]  kasan_save_track+0x20/0x40
[   21.387886]  kasan_save_alloc_info+0x40/0x58
[   21.388595]  __kasan_kmalloc+0xd4/0xd8
[   21.388992]  __kmalloc_cache_noprof+0x154/0x320
[   21.389747]  kmalloc_oob_memset_4+0xb0/0x318
[   21.390391]  kunit_try_run_case+0x170/0x3f0
[   21.390942]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   21.391976]  kthread+0x24c/0x2d0
[   21.392611]  ret_from_fork+0x10/0x20
[   21.393093] 
[   21.393613] The buggy address belongs to the object at fff00000c41c1700
[   21.393613]  which belongs to the cache kmalloc-128 of size 128
[   21.394841] The buggy address is located 117 bytes inside of
[   21.394841]  allocated 120-byte region [fff00000c41c1700, fff00000c41c1778)
[   21.396242] 
[   21.396553] The buggy address belongs to the physical page:
[   21.397525] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1041c1
[   21.398385] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   21.399133] page_type: f5(slab)
[   21.400033] raw: 0bfffe0000000000 fff00000c0001a00 dead000000000122 0000000000000000
[   21.400692] raw: 0000000000000000 0000000080100010 00000001f5000000 0000000000000000
[   21.401503] page dumped because: kasan: bad access detected
[   21.402087] 
[   21.402392] Memory state around the buggy address:
[   21.402868]  fff00000c41c1600: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc fc
[   21.404045]  fff00000c41c1680: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   21.404676] >fff00000c41c1700: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   21.405409]                                                                 ^
[   21.406082]  fff00000c41c1780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   21.406799]  fff00000c41c1800: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   21.408211] ==================================================================

[   17.719194] ==================================================================
[   17.720279] BUG: KASAN: slab-out-of-bounds in kmalloc_oob_memset_4+0x167/0x330
[   17.720845] Write of size 4 at addr ffff88810230d375 by task kunit_try_catch/179
[   17.721557] 
[   17.721813] CPU: 1 UID: 0 PID: 179 Comm: kunit_try_catch Tainted: G    B            N 6.12.33-rc1 #1
[   17.721933] Tainted: [B]=BAD_PAGE, [N]=TEST
[   17.721970] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   17.722027] Call Trace:
[   17.722067]  <TASK>
[   17.722113]  dump_stack_lvl+0x73/0xb0
[   17.722193]  print_report+0xd1/0x640
[   17.722287]  ? __virt_addr_valid+0x1db/0x2d0
[   17.722363]  ? kmalloc_oob_memset_4+0x167/0x330
[   17.722433]  ? kasan_complete_mode_report_info+0x2a/0x200
[   17.722505]  ? kmalloc_oob_memset_4+0x167/0x330
[   17.722577]  kasan_report+0x140/0x180
[   17.722655]  ? kmalloc_oob_memset_4+0x167/0x330
[   17.722745]  kasan_check_range+0x10c/0x1c0
[   17.722819]  __asan_memset+0x27/0x50
[   17.722888]  kmalloc_oob_memset_4+0x167/0x330
[   17.722968]  ? __pfx_kmalloc_oob_memset_4+0x10/0x10
[   17.723048]  ? __schedule+0xc49/0x27a0
[   17.723121]  ? __pfx_read_tsc+0x10/0x10
[   17.723186]  ? ktime_get_ts64+0x84/0x230
[   17.723358]  kunit_try_run_case+0x1a6/0x480
[   17.723404]  ? __pfx_kunit_try_run_case+0x10/0x10
[   17.723432]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   17.723579]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   17.723616]  ? __kthread_parkme+0x82/0x160
[   17.723643]  ? preempt_count_sub+0x50/0x80
[   17.723672]  ? __pfx_kunit_try_run_case+0x10/0x10
[   17.723700]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   17.723736]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   17.723772]  kthread+0x257/0x310
[   17.723795]  ? __pfx_kthread+0x10/0x10
[   17.723849]  ret_from_fork+0x41/0x80
[   17.723883]  ? __pfx_kthread+0x10/0x10
[   17.723908]  ret_from_fork_asm+0x1a/0x30
[   17.723949]  </TASK>
[   17.723962] 
[   17.738944] Allocated by task 179:
[   17.739361]  kasan_save_stack+0x45/0x70
[   17.740242]  kasan_save_track+0x18/0x40
[   17.740775]  kasan_save_alloc_info+0x3b/0x50
[   17.741256]  __kasan_kmalloc+0xb7/0xc0
[   17.741745]  __kmalloc_cache_noprof+0x168/0x350
[   17.742168]  kmalloc_oob_memset_4+0xad/0x330
[   17.742613]  kunit_try_run_case+0x1a6/0x480
[   17.743036]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   17.743530]  kthread+0x257/0x310
[   17.744049]  ret_from_fork+0x41/0x80
[   17.744568]  ret_from_fork_asm+0x1a/0x30
[   17.745042] 
[   17.745284] The buggy address belongs to the object at ffff88810230d300
[   17.745284]  which belongs to the cache kmalloc-128 of size 128
[   17.746710] The buggy address is located 117 bytes inside of
[   17.746710]  allocated 120-byte region [ffff88810230d300, ffff88810230d378)
[   17.747811] 
[   17.748083] The buggy address belongs to the physical page:
[   17.748713] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10230d
[   17.749366] flags: 0x200000000000000(node=0|zone=2)
[   17.749858] page_type: f5(slab)
[   17.750148] raw: 0200000000000000 ffff888100041a00 dead000000000122 0000000000000000
[   17.750831] raw: 0000000000000000 0000000080100010 00000001f5000000 0000000000000000
[   17.751488] page dumped because: kasan: bad access detected
[   17.752427] 
[   17.752768] Memory state around the buggy address:
[   17.753189]  ffff88810230d200: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc fc
[   17.753845]  ffff88810230d280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   17.754355] >ffff88810230d300: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   17.755082]                                                                 ^
[   17.755843]  ffff88810230d380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   17.756856]  ffff88810230d400: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   17.757583] ==================================================================