Hay
Date
July 3, 2025, 6:13 p.m.

Environment
qemu-arm64
qemu-x86_64

[   16.823714] ==================================================================
[   16.824090] BUG: KASAN: slab-out-of-bounds in kmalloc_oob_memset_2+0x150/0x2f8
[   16.824202] Write of size 2 at addr fff00000c652df77 by task kunit_try_catch/172
[   16.824304] 
[   16.824380] CPU: 0 UID: 0 PID: 172 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT 
[   16.824671] Tainted: [B]=BAD_PAGE, [N]=TEST
[   16.824735] Hardware name: linux,dummy-virt (DT)
[   16.824814] Call trace:
[   16.824933]  show_stack+0x20/0x38 (C)
[   16.825332]  dump_stack_lvl+0x8c/0xd0
[   16.825542]  print_report+0x118/0x608
[   16.825603]  kasan_report+0xdc/0x128
[   16.825810]  kasan_check_range+0x100/0x1a8
[   16.825867]  __asan_memset+0x34/0x78
[   16.825977]  kmalloc_oob_memset_2+0x150/0x2f8
[   16.826392]  kunit_try_run_case+0x170/0x3f0
[   16.826579]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   16.826776]  kthread+0x328/0x630
[   16.827067]  ret_from_fork+0x10/0x20
[   16.827330] 
[   16.827515] Allocated by task 172:
[   16.827712]  kasan_save_stack+0x3c/0x68
[   16.827863]  kasan_save_track+0x20/0x40
[   16.827953]  kasan_save_alloc_info+0x40/0x58
[   16.828181]  __kasan_kmalloc+0xd4/0xd8
[   16.828357]  __kmalloc_cache_noprof+0x16c/0x3c0
[   16.828560]  kmalloc_oob_memset_2+0xb0/0x2f8
[   16.828600]  kunit_try_run_case+0x170/0x3f0
[   16.828636]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   16.828971]  kthread+0x328/0x630
[   16.829140]  ret_from_fork+0x10/0x20
[   16.829225] 
[   16.829246] The buggy address belongs to the object at fff00000c652df00
[   16.829246]  which belongs to the cache kmalloc-128 of size 128
[   16.829471] The buggy address is located 119 bytes inside of
[   16.829471]  allocated 120-byte region [fff00000c652df00, fff00000c652df78)
[   16.829698] 
[   16.829786] The buggy address belongs to the physical page:
[   16.829855] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10652d
[   16.829963] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   16.830210] page_type: f5(slab)
[   16.830308] raw: 0bfffe0000000000 fff00000c0001a00 dead000000000122 0000000000000000
[   16.830434] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   16.830582] page dumped because: kasan: bad access detected
[   16.830935] 
[   16.831314] Memory state around the buggy address:
[   16.831382]  fff00000c652de00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   16.831856]  fff00000c652de80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   16.831946] >fff00000c652df00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   16.832105]                                                                 ^
[   16.832163]  fff00000c652df80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   16.832219]  fff00000c652e000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   16.832256] ==================================================================

[   11.543559] ==================================================================
[   11.544063] BUG: KASAN: slab-out-of-bounds in kmalloc_oob_memset_2+0x166/0x330
[   11.544551] Write of size 2 at addr ffff888103328677 by task kunit_try_catch/190
[   11.544864] 
[   11.544978] CPU: 1 UID: 0 PID: 190 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT(voluntary) 
[   11.545041] Tainted: [B]=BAD_PAGE, [N]=TEST
[   11.545052] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   11.545073] Call Trace:
[   11.545084]  <TASK>
[   11.545099]  dump_stack_lvl+0x73/0xb0
[   11.545223]  print_report+0xd1/0x650
[   11.545254]  ? __virt_addr_valid+0x1db/0x2d0
[   11.545278]  ? kmalloc_oob_memset_2+0x166/0x330
[   11.545299]  ? kasan_complete_mode_report_info+0x2a/0x200
[   11.545343]  ? kmalloc_oob_memset_2+0x166/0x330
[   11.545365]  kasan_report+0x141/0x180
[   11.545386]  ? kmalloc_oob_memset_2+0x166/0x330
[   11.545411]  kasan_check_range+0x10c/0x1c0
[   11.545434]  __asan_memset+0x27/0x50
[   11.545453]  kmalloc_oob_memset_2+0x166/0x330
[   11.545474]  ? __pfx_kmalloc_oob_memset_2+0x10/0x10
[   11.545496]  ? __schedule+0x10cc/0x2b60
[   11.545517]  ? __pfx_read_tsc+0x10/0x10
[   11.545537]  ? ktime_get_ts64+0x86/0x230
[   11.545579]  kunit_try_run_case+0x1a5/0x480
[   11.545603]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.545624]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   11.545646]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   11.545668]  ? __kthread_parkme+0x82/0x180
[   11.545687]  ? preempt_count_sub+0x50/0x80
[   11.545709]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.545733]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.545754]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   11.545796]  kthread+0x337/0x6f0
[   11.545816]  ? trace_preempt_on+0x20/0xc0
[   11.545839]  ? __pfx_kthread+0x10/0x10
[   11.545859]  ? _raw_spin_unlock_irq+0x47/0x80
[   11.545879]  ? calculate_sigpending+0x7b/0xa0
[   11.545901]  ? __pfx_kthread+0x10/0x10
[   11.545921]  ret_from_fork+0x116/0x1d0
[   11.545938]  ? __pfx_kthread+0x10/0x10
[   11.545958]  ret_from_fork_asm+0x1a/0x30
[   11.545987]  </TASK>
[   11.545998] 
[   11.553691] Allocated by task 190:
[   11.553848]  kasan_save_stack+0x45/0x70
[   11.553994]  kasan_save_track+0x18/0x40
[   11.554209]  kasan_save_alloc_info+0x3b/0x50
[   11.554484]  __kasan_kmalloc+0xb7/0xc0
[   11.554693]  __kmalloc_cache_noprof+0x189/0x420
[   11.554922]  kmalloc_oob_memset_2+0xac/0x330
[   11.555242]  kunit_try_run_case+0x1a5/0x480
[   11.555504]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.555684]  kthread+0x337/0x6f0
[   11.555814]  ret_from_fork+0x116/0x1d0
[   11.556022]  ret_from_fork_asm+0x1a/0x30
[   11.556309] 
[   11.556456] The buggy address belongs to the object at ffff888103328600
[   11.556456]  which belongs to the cache kmalloc-128 of size 128
[   11.557008] The buggy address is located 119 bytes inside of
[   11.557008]  allocated 120-byte region [ffff888103328600, ffff888103328678)
[   11.557557] 
[   11.557666] The buggy address belongs to the physical page:
[   11.557917] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x103328
[   11.558290] flags: 0x200000000000000(node=0|zone=2)
[   11.558495] page_type: f5(slab)
[   11.558638] raw: 0200000000000000 ffff888100041a00 dead000000000122 0000000000000000
[   11.558940] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   11.559253] page dumped because: kasan: bad access detected
[   11.559482] 
[   11.559565] Memory state around the buggy address:
[   11.559774]  ffff888103328500: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   11.560061]  ffff888103328580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.561557] >ffff888103328600: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   11.561860]                                                                 ^
[   11.562557]  ffff888103328680: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.563039]  ffff888103328700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.563611] ==================================================================