Hay
Date
July 8, 2025, 7:07 p.m.

Environment
qemu-arm64
qemu-x86_64

[   18.961437] ==================================================================
[   18.961542] BUG: KASAN: slab-out-of-bounds in kmalloc_oob_left+0x2ec/0x320
[   18.961603] Read of size 1 at addr fff00000c564f2bf by task kunit_try_catch/138
[   18.961769] 
[   18.961835] CPU: 1 UID: 0 PID: 138 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT 
[   18.961969] Tainted: [B]=BAD_PAGE, [N]=TEST
[   18.962176] Hardware name: linux,dummy-virt (DT)
[   18.962221] Call trace:
[   18.962406]  show_stack+0x20/0x38 (C)
[   18.962467]  dump_stack_lvl+0x8c/0xd0
[   18.962512]  print_report+0x118/0x608
[   18.962556]  kasan_report+0xdc/0x128
[   18.962599]  __asan_report_load1_noabort+0x20/0x30
[   18.962667]  kmalloc_oob_left+0x2ec/0x320
[   18.962731]  kunit_try_run_case+0x170/0x3f0
[   18.963207]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.963285]  kthread+0x328/0x630
[   18.963328]  ret_from_fork+0x10/0x20
[   18.963453] 
[   18.963514] Allocated by task 26:
[   18.963566]  kasan_save_stack+0x3c/0x68
[   18.963769]  kasan_save_track+0x20/0x40
[   18.963813]  kasan_save_alloc_info+0x40/0x58
[   18.963894]  __kasan_kmalloc+0xd4/0xd8
[   18.964134]  __kmalloc_node_track_caller_noprof+0x194/0x4b8
[   18.964197]  kstrdup+0x54/0xc8
[   18.964232]  devtmpfs_work_loop+0x6f8/0xa58
[   18.964278]  devtmpfsd+0x50/0x58
[   18.964312]  kthread+0x328/0x630
[   18.964344]  ret_from_fork+0x10/0x20
[   18.964378] 
[   18.964462] Freed by task 26:
[   18.964532]  kasan_save_stack+0x3c/0x68
[   18.964582]  kasan_save_track+0x20/0x40
[   18.964617]  kasan_save_free_info+0x4c/0x78
[   18.964655]  __kasan_slab_free+0x6c/0x98
[   18.964695]  kfree+0x214/0x3c8
[   18.964741]  devtmpfs_work_loop+0x804/0xa58
[   18.964781]  devtmpfsd+0x50/0x58
[   18.964830]  kthread+0x328/0x630
[   18.964864]  ret_from_fork+0x10/0x20
[   18.964909] 
[   18.964931] The buggy address belongs to the object at fff00000c564f2a0
[   18.964931]  which belongs to the cache kmalloc-16 of size 16
[   18.964986] The buggy address is located 15 bytes to the right of
[   18.964986]  allocated 16-byte region [fff00000c564f2a0, fff00000c564f2b0)
[   18.965064] 
[   18.965092] The buggy address belongs to the physical page:
[   18.965129] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10564f
[   18.965181] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   18.965228] page_type: f5(slab)
[   18.965265] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000
[   18.965323] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   18.965362] page dumped because: kasan: bad access detected
[   18.965391] 
[   18.965409] Memory state around the buggy address:
[   18.965454]  fff00000c564f180: 00 05 fc fc fa fb fc fc fa fb fc fc 00 02 fc fc
[   18.965496]  fff00000c564f200: fa fb fc fc fa fb fc fc 00 01 fc fc fa fb fc fc
[   18.965553] >fff00000c564f280: fa fb fc fc fa fb fc fc 00 07 fc fc fc fc fc fc
[   18.965596]                                         ^
[   18.965635]  fff00000c564f300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.965688]  fff00000c564f380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.965999] ==================================================================

[   12.123620] ==================================================================
[   12.124593] BUG: KASAN: slab-out-of-bounds in kmalloc_oob_left+0x361/0x3c0
[   12.125030] Read of size 1 at addr ffff8881022bac3f by task kunit_try_catch/155
[   12.125727] 
[   12.126028] CPU: 0 UID: 0 PID: 155 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT(voluntary) 
[   12.126107] Tainted: [B]=BAD_PAGE, [N]=TEST
[   12.126119] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   12.126143] Call Trace:
[   12.126158]  <TASK>
[   12.126178]  dump_stack_lvl+0x73/0xb0
[   12.126209]  print_report+0xd1/0x650
[   12.126231]  ? __virt_addr_valid+0x1db/0x2d0
[   12.126254]  ? kmalloc_oob_left+0x361/0x3c0
[   12.126274]  ? kasan_complete_mode_report_info+0x2a/0x200
[   12.126298]  ? kmalloc_oob_left+0x361/0x3c0
[   12.126319]  kasan_report+0x141/0x180
[   12.126339]  ? kmalloc_oob_left+0x361/0x3c0
[   12.126364]  __asan_report_load1_noabort+0x18/0x20
[   12.126387]  kmalloc_oob_left+0x361/0x3c0
[   12.126407]  ? __pfx_kmalloc_oob_left+0x10/0x10
[   12.126428]  ? __schedule+0x10cc/0x2b60
[   12.126449]  ? __pfx_read_tsc+0x10/0x10
[   12.126470]  ? ktime_get_ts64+0x86/0x230
[   12.126495]  kunit_try_run_case+0x1a5/0x480
[   12.126519]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.126540]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   12.126562]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   12.126584]  ? __kthread_parkme+0x82/0x180
[   12.126604]  ? preempt_count_sub+0x50/0x80
[   12.126628]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.126650]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.126671]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   12.126692]  kthread+0x337/0x6f0
[   12.126710]  ? trace_preempt_on+0x20/0xc0
[   12.126733]  ? __pfx_kthread+0x10/0x10
[   12.126752]  ? _raw_spin_unlock_irq+0x47/0x80
[   12.126771]  ? calculate_sigpending+0x7b/0xa0
[   12.126795]  ? __pfx_kthread+0x10/0x10
[   12.126815]  ret_from_fork+0x116/0x1d0
[   12.126832]  ? __pfx_kthread+0x10/0x10
[   12.126851]  ret_from_fork_asm+0x1a/0x30
[   12.126882]  </TASK>
[   12.126894] 
[   12.138540] Allocated by task 1:
[   12.138801]  kasan_save_stack+0x45/0x70
[   12.139206]  kasan_save_track+0x18/0x40
[   12.139407]  kasan_save_alloc_info+0x3b/0x50
[   12.139630]  __kasan_kmalloc+0xb7/0xc0
[   12.139824]  __kmalloc_node_track_caller_noprof+0x1cb/0x500
[   12.140496]  kstrdup+0x3e/0xa0
[   12.140662]  kstrdup_const+0x2c/0x40
[   12.140996]  __kernfs_new_node+0xa7/0x6d0
[   12.141464]  kernfs_new_node+0x140/0x1e0
[   12.141773]  kernfs_create_dir_ns+0x30/0x140
[   12.142171]  sysfs_create_dir_ns+0x130/0x290
[   12.142400]  kobject_add_internal+0x222/0x9b0
[   12.142755]  kobject_init_and_add+0xf1/0x160
[   12.143091]  sysfs_slab_add+0x19a/0x1f0
[   12.143270]  slab_sysfs_init+0x76/0x110
[   12.143455]  do_one_initcall+0xd8/0x370
[   12.143886]  kernel_init_freeable+0x420/0x6f0
[   12.144086]  kernel_init+0x23/0x1e0
[   12.144576]  ret_from_fork+0x116/0x1d0
[   12.144867]  ret_from_fork_asm+0x1a/0x30
[   12.145425] 
[   12.145635] The buggy address belongs to the object at ffff8881022bac20
[   12.145635]  which belongs to the cache kmalloc-16 of size 16
[   12.146335] The buggy address is located 19 bytes to the right of
[   12.146335]  allocated 12-byte region [ffff8881022bac20, ffff8881022bac2c)
[   12.147057] 
[   12.147185] The buggy address belongs to the physical page:
[   12.147536] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1022ba
[   12.147886] flags: 0x200000000000000(node=0|zone=2)
[   12.148400] page_type: f5(slab)
[   12.148704] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000
[   12.149168] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   12.149633] page dumped because: kasan: bad access detected
[   12.149951] 
[   12.150065] Memory state around the buggy address:
[   12.150368]  ffff8881022bab00: 00 02 fc fc 00 02 fc fc 00 06 fc fc 00 06 fc fc
[   12.151095]  ffff8881022bab80: 00 04 fc fc 00 04 fc fc 00 01 fc fc 00 01 fc fc
[   12.151635] >ffff8881022bac00: 00 04 fc fc 00 04 fc fc 00 07 fc fc fc fc fc fc
[   12.152002]                                         ^
[   12.152464]  ffff8881022bac80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.152923]  ffff8881022bad00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.153471] ==================================================================