Hay
Date
July 22, 2025, 5:13 a.m.

Environment
qemu-arm64
qemu-x86_64

[   30.383060] ==================================================================
[   30.383117] BUG: KASAN: slab-out-of-bounds in kmalloc_oob_memset_4+0x150/0x300
[   30.383169] Write of size 4 at addr fff00000c3f71c75 by task kunit_try_catch/205
[   30.383222] 
[   30.383253] CPU: 1 UID: 0 PID: 205 Comm: kunit_try_catch Tainted: G    B   W        N  6.16.0-rc7-next-20250722 #1 PREEMPT 
[   30.383340] Tainted: [B]=BAD_PAGE, [W]=WARN, [N]=TEST
[   30.383368] Hardware name: linux,dummy-virt (DT)
[   30.383407] Call trace:
[   30.383428]  show_stack+0x20/0x38 (C)
[   30.383476]  dump_stack_lvl+0x8c/0xd0
[   30.383520]  print_report+0x118/0x5e8
[   30.383562]  kasan_report+0xdc/0x128
[   30.383604]  kasan_check_range+0x100/0x1a8
[   30.383656]  __asan_memset+0x34/0x78
[   30.383700]  kmalloc_oob_memset_4+0x150/0x300
[   30.383745]  kunit_try_run_case+0x170/0x3f0
[   30.383800]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   30.384197]  kthread+0x328/0x630
[   30.384728]  ret_from_fork+0x10/0x20
[   30.384808] 
[   30.385220] Allocated by task 205:
[   30.385259]  kasan_save_stack+0x3c/0x68
[   30.385306]  kasan_save_track+0x20/0x40
[   30.385340]  kasan_save_alloc_info+0x40/0x58
[   30.385377]  __kasan_kmalloc+0xd4/0xd8
[   30.385443]  __kmalloc_cache_noprof+0x16c/0x3c0
[   30.385508]  kmalloc_oob_memset_4+0xb0/0x300
[   30.385573]  kunit_try_run_case+0x170/0x3f0
[   30.385844]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   30.385971]  kthread+0x328/0x630
[   30.386049]  ret_from_fork+0x10/0x20
[   30.386381] 
[   30.386438] The buggy address belongs to the object at fff00000c3f71c00
[   30.386438]  which belongs to the cache kmalloc-128 of size 128
[   30.386506] The buggy address is located 117 bytes inside of
[   30.386506]  allocated 120-byte region [fff00000c3f71c00, fff00000c3f71c78)
[   30.386567] 
[   30.386744] The buggy address belongs to the physical page:
[   30.386893] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x103f71
[   30.387007] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   30.387097] page_type: f5(slab)
[   30.387233] raw: 0bfffe0000000000 fff00000c0001a00 dead000000000100 dead000000000122
[   30.387295] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   30.387349] page dumped because: kasan: bad access detected
[   30.387726] 
[   30.387769] Memory state around the buggy address:
[   30.387803]  fff00000c3f71b00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   30.388132]  fff00000c3f71b80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   30.388240] >fff00000c3f71c00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   30.388280]                                                                 ^
[   30.388349]  fff00000c3f71c80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   30.388417]  fff00000c3f71d00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   30.388892] ==================================================================

[   25.217585] ==================================================================
[   25.218170] BUG: KASAN: slab-out-of-bounds in kmalloc_oob_memset_4+0x166/0x330
[   25.218406] Write of size 4 at addr ffff888104962f75 by task kunit_try_catch/222
[   25.219114] 
[   25.219313] CPU: 0 UID: 0 PID: 222 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc7-next-20250722 #1 PREEMPT(voluntary) 
[   25.219364] Tainted: [B]=BAD_PAGE, [N]=TEST
[   25.219606] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   25.219660] Call Trace:
[   25.219675]  <TASK>
[   25.219690]  dump_stack_lvl+0x73/0xb0
[   25.219865]  print_report+0xd1/0x640
[   25.219889]  ? __virt_addr_valid+0x1db/0x2d0
[   25.219914]  ? kmalloc_oob_memset_4+0x166/0x330
[   25.219935]  ? kasan_complete_mode_report_info+0x2a/0x200
[   25.219962]  ? kmalloc_oob_memset_4+0x166/0x330
[   25.219984]  kasan_report+0x141/0x180
[   25.220007]  ? kmalloc_oob_memset_4+0x166/0x330
[   25.220033]  kasan_check_range+0x10c/0x1c0
[   25.220059]  __asan_memset+0x27/0x50
[   25.220083]  kmalloc_oob_memset_4+0x166/0x330
[   25.220107]  ? __pfx_kmalloc_oob_memset_4+0x10/0x10
[   25.220130]  ? __schedule+0x10da/0x2b60
[   25.220155]  ? __pfx_read_tsc+0x10/0x10
[   25.220244]  ? ktime_get_ts64+0x86/0x230
[   25.220268]  kunit_try_run_case+0x1a5/0x480
[   25.220294]  ? __pfx_kunit_try_run_case+0x10/0x10
[   25.220317]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   25.220342]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   25.220367]  ? __kthread_parkme+0x82/0x180
[   25.220388]  ? preempt_count_sub+0x50/0x80
[   25.220411]  ? __pfx_kunit_try_run_case+0x10/0x10
[   25.220434]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   25.220526]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   25.220554]  kthread+0x337/0x6f0
[   25.220574]  ? trace_preempt_on+0x20/0xc0
[   25.220597]  ? __pfx_kthread+0x10/0x10
[   25.220618]  ? _raw_spin_unlock_irq+0x47/0x80
[   25.220641]  ? calculate_sigpending+0x7b/0xa0
[   25.220664]  ? __pfx_kthread+0x10/0x10
[   25.220686]  ret_from_fork+0x116/0x1d0
[   25.220706]  ? __pfx_kthread+0x10/0x10
[   25.220727]  ret_from_fork_asm+0x1a/0x30
[   25.220757]  </TASK>
[   25.220769] 
[   25.232329] Allocated by task 222:
[   25.232701]  kasan_save_stack+0x45/0x70
[   25.232962]  kasan_save_track+0x18/0x40
[   25.233151]  kasan_save_alloc_info+0x3b/0x50
[   25.233710]  __kasan_kmalloc+0xb7/0xc0
[   25.234049]  __kmalloc_cache_noprof+0x189/0x420
[   25.234407]  kmalloc_oob_memset_4+0xac/0x330
[   25.234878]  kunit_try_run_case+0x1a5/0x480
[   25.235098]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   25.235525]  kthread+0x337/0x6f0
[   25.235845]  ret_from_fork+0x116/0x1d0
[   25.236028]  ret_from_fork_asm+0x1a/0x30
[   25.236362] 
[   25.236456] The buggy address belongs to the object at ffff888104962f00
[   25.236456]  which belongs to the cache kmalloc-128 of size 128
[   25.237021] The buggy address is located 117 bytes inside of
[   25.237021]  allocated 120-byte region [ffff888104962f00, ffff888104962f78)
[   25.237973] 
[   25.238070] The buggy address belongs to the physical page:
[   25.238342] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x104962
[   25.238893] flags: 0x200000000000000(node=0|zone=2)
[   25.239124] page_type: f5(slab)
[   25.239596] raw: 0200000000000000 ffff888100041a00 dead000000000122 0000000000000000
[   25.240024] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   25.240444] page dumped because: kasan: bad access detected
[   25.240694] 
[   25.240790] Memory state around the buggy address:
[   25.241279]  ffff888104962e00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   25.241734]  ffff888104962e80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   25.242065] >ffff888104962f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   25.242681]                                                                 ^
[   25.242962]  ffff888104962f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   25.243558]  ffff888104963000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   25.243963] ==================================================================