Hay
Date
July 12, 2025, 11:09 a.m.

Environment
qemu-arm64
qemu-x86_64

[   19.432005] ==================================================================
[   19.432171] BUG: KASAN: slab-out-of-bounds in kmalloc_oob_memset_2+0x150/0x2f8
[   19.432878] Write of size 2 at addr fff00000c4569d77 by task kunit_try_catch/173
[   19.433106] 
[   19.433227] CPU: 0 UID: 0 PID: 173 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT 
[   19.433524] Tainted: [B]=BAD_PAGE, [N]=TEST
[   19.433603] Hardware name: linux,dummy-virt (DT)
[   19.433755] Call trace:
[   19.433973]  show_stack+0x20/0x38 (C)
[   19.434437]  dump_stack_lvl+0x8c/0xd0
[   19.434677]  print_report+0x118/0x608
[   19.434842]  kasan_report+0xdc/0x128
[   19.434961]  kasan_check_range+0x100/0x1a8
[   19.435181]  __asan_memset+0x34/0x78
[   19.435735]  kmalloc_oob_memset_2+0x150/0x2f8
[   19.435914]  kunit_try_run_case+0x170/0x3f0
[   19.436146]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.436297]  kthread+0x328/0x630
[   19.436844]  ret_from_fork+0x10/0x20
[   19.437100] 
[   19.437153] Allocated by task 173:
[   19.437320]  kasan_save_stack+0x3c/0x68
[   19.437443]  kasan_save_track+0x20/0x40
[   19.437743]  kasan_save_alloc_info+0x40/0x58
[   19.437848]  __kasan_kmalloc+0xd4/0xd8
[   19.437944]  __kmalloc_cache_noprof+0x16c/0x3c0
[   19.438068]  kmalloc_oob_memset_2+0xb0/0x2f8
[   19.438416]  kunit_try_run_case+0x170/0x3f0
[   19.438520]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.438642]  kthread+0x328/0x630
[   19.438720]  ret_from_fork+0x10/0x20
[   19.438852] 
[   19.438924] The buggy address belongs to the object at fff00000c4569d00
[   19.438924]  which belongs to the cache kmalloc-128 of size 128
[   19.439345] The buggy address is located 119 bytes inside of
[   19.439345]  allocated 120-byte region [fff00000c4569d00, fff00000c4569d78)
[   19.439972] 
[   19.440035] The buggy address belongs to the physical page:
[   19.440367] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x104569
[   19.440685] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   19.440837] page_type: f5(slab)
[   19.440936] raw: 0bfffe0000000000 fff00000c0001a00 dead000000000122 0000000000000000
[   19.441059] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   19.441792] page dumped because: kasan: bad access detected
[   19.441905] 
[   19.442419] Memory state around the buggy address:
[   19.442518]  fff00000c4569c00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   19.442644]  fff00000c4569c80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   19.442755] >fff00000c4569d00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   19.443476]                                                                 ^
[   19.443786]  fff00000c4569d80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   19.444498]  fff00000c4569e00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   19.444614] ==================================================================

[   12.717231] ==================================================================
[   12.717726] BUG: KASAN: slab-out-of-bounds in kmalloc_oob_memset_2+0x166/0x330
[   12.718028] Write of size 2 at addr ffff888102b92677 by task kunit_try_catch/190
[   12.718341] 
[   12.718442] CPU: 0 UID: 0 PID: 190 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT(voluntary) 
[   12.718487] Tainted: [B]=BAD_PAGE, [N]=TEST
[   12.718498] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   12.718517] Call Trace:
[   12.718529]  <TASK>
[   12.718543]  dump_stack_lvl+0x73/0xb0
[   12.719214]  print_report+0xd1/0x650
[   12.719260]  ? __virt_addr_valid+0x1db/0x2d0
[   12.719284]  ? kmalloc_oob_memset_2+0x166/0x330
[   12.719307]  ? kasan_complete_mode_report_info+0x2a/0x200
[   12.719330]  ? kmalloc_oob_memset_2+0x166/0x330
[   12.719352]  kasan_report+0x141/0x180
[   12.719373]  ? kmalloc_oob_memset_2+0x166/0x330
[   12.719400]  kasan_check_range+0x10c/0x1c0
[   12.719424]  __asan_memset+0x27/0x50
[   12.719445]  kmalloc_oob_memset_2+0x166/0x330
[   12.719468]  ? __pfx_kmalloc_oob_memset_2+0x10/0x10
[   12.719491]  ? __schedule+0x10cc/0x2b60
[   12.719512]  ? __pfx_read_tsc+0x10/0x10
[   12.719533]  ? ktime_get_ts64+0x86/0x230
[   12.719557]  kunit_try_run_case+0x1a5/0x480
[   12.719580]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.719604]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   12.719627]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   12.719668]  ? __kthread_parkme+0x82/0x180
[   12.719700]  ? preempt_count_sub+0x50/0x80
[   12.719724]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.719756]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.719780]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   12.719805]  kthread+0x337/0x6f0
[   12.719833]  ? trace_preempt_on+0x20/0xc0
[   12.719857]  ? __pfx_kthread+0x10/0x10
[   12.719877]  ? _raw_spin_unlock_irq+0x47/0x80
[   12.719899]  ? calculate_sigpending+0x7b/0xa0
[   12.719922]  ? __pfx_kthread+0x10/0x10
[   12.719943]  ret_from_fork+0x116/0x1d0
[   12.719961]  ? __pfx_kthread+0x10/0x10
[   12.719982]  ret_from_fork_asm+0x1a/0x30
[   12.720011]  </TASK>
[   12.720022] 
[   12.729720] Allocated by task 190:
[   12.729882]  kasan_save_stack+0x45/0x70
[   12.730222]  kasan_save_track+0x18/0x40
[   12.730514]  kasan_save_alloc_info+0x3b/0x50
[   12.730803]  __kasan_kmalloc+0xb7/0xc0
[   12.731136]  __kmalloc_cache_noprof+0x189/0x420
[   12.731313]  kmalloc_oob_memset_2+0xac/0x330
[   12.731884]  kunit_try_run_case+0x1a5/0x480
[   12.732093]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.732294]  kthread+0x337/0x6f0
[   12.732459]  ret_from_fork+0x116/0x1d0
[   12.732621]  ret_from_fork_asm+0x1a/0x30
[   12.732908] 
[   12.733446] The buggy address belongs to the object at ffff888102b92600
[   12.733446]  which belongs to the cache kmalloc-128 of size 128
[   12.734081] The buggy address is located 119 bytes inside of
[   12.734081]  allocated 120-byte region [ffff888102b92600, ffff888102b92678)
[   12.734580] 
[   12.735061] The buggy address belongs to the physical page:
[   12.735289] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102b92
[   12.735979] flags: 0x200000000000000(node=0|zone=2)
[   12.736208] page_type: f5(slab)
[   12.736339] raw: 0200000000000000 ffff888100041a00 dead000000000122 0000000000000000
[   12.736854] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   12.737169] page dumped because: kasan: bad access detected
[   12.737413] 
[   12.737502] Memory state around the buggy address:
[   12.737709]  ffff888102b92500: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   12.739015]  ffff888102b92580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.739836] >ffff888102b92600: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   12.740069]                                                                 ^
[   12.740285]  ffff888102b92680: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.740497]  ffff888102b92700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.740705] ==================================================================