Hay
Date
July 10, 2025, 9:07 a.m.

Environment
qemu-arm64
qemu-x86_64

[   29.480198] ==================================================================
[   29.480362] BUG: KASAN: slab-out-of-bounds in kmalloc_oob_memset_2+0x150/0x2f8
[   29.480413] Write of size 2 at addr fff00000c9af0077 by task kunit_try_catch/203
[   29.480628] 
[   29.480711] CPU: 0 UID: 0 PID: 203 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5-next-20250710 #1 PREEMPT 
[   29.480981] Tainted: [B]=BAD_PAGE, [N]=TEST
[   29.481058] Hardware name: linux,dummy-virt (DT)
[   29.481089] Call trace:
[   29.481201]  show_stack+0x20/0x38 (C)
[   29.481282]  dump_stack_lvl+0x8c/0xd0
[   29.481381]  print_report+0x118/0x5d0
[   29.481424]  kasan_report+0xdc/0x128
[   29.481471]  kasan_check_range+0x100/0x1a8
[   29.481567]  __asan_memset+0x34/0x78
[   29.481699]  kmalloc_oob_memset_2+0x150/0x2f8
[   29.481897]  kunit_try_run_case+0x170/0x3f0
[   29.481944]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   29.481997]  kthread+0x328/0x630
[   29.482037]  ret_from_fork+0x10/0x20
[   29.482082] 
[   29.482100] Allocated by task 203:
[   29.482835]  kasan_save_stack+0x3c/0x68
[   29.482908]  kasan_save_track+0x20/0x40
[   29.482978]  kasan_save_alloc_info+0x40/0x58
[   29.483015]  __kasan_kmalloc+0xd4/0xd8
[   29.483070]  __kmalloc_cache_noprof+0x16c/0x3c0
[   29.483110]  kmalloc_oob_memset_2+0xb0/0x2f8
[   29.483157]  kunit_try_run_case+0x170/0x3f0
[   29.483195]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   29.483240]  kthread+0x328/0x630
[   29.483271]  ret_from_fork+0x10/0x20
[   29.483305] 
[   29.483324] The buggy address belongs to the object at fff00000c9af0000
[   29.483324]  which belongs to the cache kmalloc-128 of size 128
[   29.483381] The buggy address is located 119 bytes inside of
[   29.483381]  allocated 120-byte region [fff00000c9af0000, fff00000c9af0078)
[   29.483461] 
[   29.483568] The buggy address belongs to the physical page:
[   29.483623] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x109af0
[   29.483711] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   29.483842] page_type: f5(slab)
[   29.483880] raw: 0bfffe0000000000 fff00000c0001a00 dead000000000122 0000000000000000
[   29.483930] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   29.483983] page dumped because: kasan: bad access detected
[   29.484014] 
[   29.484031] Memory state around the buggy address:
[   29.484062]  fff00000c9aeff00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   29.484105]  fff00000c9aeff80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   29.484156] >fff00000c9af0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   29.484194]                                                                 ^
[   29.484288]  fff00000c9af0080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   29.484337]  fff00000c9af0100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   29.484375] ==================================================================

[   25.112556] ==================================================================
[   25.113261] BUG: KASAN: slab-out-of-bounds in kmalloc_oob_memset_2+0x166/0x330
[   25.113609] Write of size 2 at addr ffff888105182a77 by task kunit_try_catch/220
[   25.114879] 
[   25.115220] CPU: 1 UID: 0 PID: 220 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5-next-20250710 #1 PREEMPT(voluntary) 
[   25.115274] Tainted: [B]=BAD_PAGE, [N]=TEST
[   25.115287] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   25.115309] Call Trace:
[   25.115324]  <TASK>
[   25.115342]  dump_stack_lvl+0x73/0xb0
[   25.115499]  print_report+0xd1/0x610
[   25.115528]  ? __virt_addr_valid+0x1db/0x2d0
[   25.115553]  ? kmalloc_oob_memset_2+0x166/0x330
[   25.115574]  ? kasan_complete_mode_report_info+0x2a/0x200
[   25.115600]  ? kmalloc_oob_memset_2+0x166/0x330
[   25.115622]  kasan_report+0x141/0x180
[   25.115643]  ? kmalloc_oob_memset_2+0x166/0x330
[   25.115669]  kasan_check_range+0x10c/0x1c0
[   25.115692]  __asan_memset+0x27/0x50
[   25.115727]  kmalloc_oob_memset_2+0x166/0x330
[   25.115749]  ? __pfx_kmalloc_oob_memset_2+0x10/0x10
[   25.115810]  ? __schedule+0x10cc/0x2b60
[   25.115836]  ? __pfx_read_tsc+0x10/0x10
[   25.115865]  ? ktime_get_ts64+0x86/0x230
[   25.115892]  kunit_try_run_case+0x1a5/0x480
[   25.115916]  ? __pfx_kunit_try_run_case+0x10/0x10
[   25.115936]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   25.115959]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   25.115982]  ? __kthread_parkme+0x82/0x180
[   25.116002]  ? preempt_count_sub+0x50/0x80
[   25.116025]  ? __pfx_kunit_try_run_case+0x10/0x10
[   25.116046]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   25.116071]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   25.116096]  kthread+0x337/0x6f0
[   25.116115]  ? trace_preempt_on+0x20/0xc0
[   25.116137]  ? __pfx_kthread+0x10/0x10
[   25.116158]  ? _raw_spin_unlock_irq+0x47/0x80
[   25.116179]  ? calculate_sigpending+0x7b/0xa0
[   25.116202]  ? __pfx_kthread+0x10/0x10
[   25.116223]  ret_from_fork+0x116/0x1d0
[   25.116242]  ? __pfx_kthread+0x10/0x10
[   25.116262]  ret_from_fork_asm+0x1a/0x30
[   25.116293]  </TASK>
[   25.116305] 
[   25.130840] Allocated by task 220:
[   25.130998]  kasan_save_stack+0x45/0x70
[   25.131384]  kasan_save_track+0x18/0x40
[   25.131564]  kasan_save_alloc_info+0x3b/0x50
[   25.132036]  __kasan_kmalloc+0xb7/0xc0
[   25.132185]  __kmalloc_cache_noprof+0x189/0x420
[   25.132337]  kmalloc_oob_memset_2+0xac/0x330
[   25.132476]  kunit_try_run_case+0x1a5/0x480
[   25.132900]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   25.133432]  kthread+0x337/0x6f0
[   25.133807]  ret_from_fork+0x116/0x1d0
[   25.134229]  ret_from_fork_asm+0x1a/0x30
[   25.134581] 
[   25.134762] The buggy address belongs to the object at ffff888105182a00
[   25.134762]  which belongs to the cache kmalloc-128 of size 128
[   25.135553] The buggy address is located 119 bytes inside of
[   25.135553]  allocated 120-byte region [ffff888105182a00, ffff888105182a78)
[   25.136143] 
[   25.136216] The buggy address belongs to the physical page:
[   25.136385] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x105182
[   25.136978] flags: 0x200000000000000(node=0|zone=2)
[   25.137461] page_type: f5(slab)
[   25.137948] raw: 0200000000000000 ffff888100041a00 dead000000000122 0000000000000000
[   25.138612] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   25.139544] page dumped because: kasan: bad access detected
[   25.140143] 
[   25.140219] Memory state around the buggy address:
[   25.140367]  ffff888105182900: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   25.140771]  ffff888105182980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   25.141510] >ffff888105182a00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   25.142172]                                                                 ^
[   25.142713]  ffff888105182a80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   25.143128]  ffff888105182b00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   25.143911] ==================================================================