Hay
Date
May 29, 2025, 7:10 a.m.

Environment
qemu-arm64
qemu-x86_64

[   21.470309] ==================================================================
[   21.470586] BUG: KASAN: slab-use-after-free in kmalloc_uaf_16+0x3bc/0x438
[   21.470775] Read of size 16 at addr fff00000c66b1080 by task kunit_try_catch/168
[   21.470970] 
[   21.471109] CPU: 1 UID: 0 PID: 168 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-next-20250529 #1 PREEMPT 
[   21.471363] Tainted: [B]=BAD_PAGE, [N]=TEST
[   21.471443] Hardware name: linux,dummy-virt (DT)
[   21.471515] Call trace:
[   21.471571]  show_stack+0x20/0x38 (C)
[   21.471751]  dump_stack_lvl+0x8c/0xd0
[   21.471932]  print_report+0x118/0x608
[   21.472096]  kasan_report+0xdc/0x128
[   21.472435]  __asan_report_load16_noabort+0x20/0x30
[   21.472946]  kmalloc_uaf_16+0x3bc/0x438
[   21.473057]  kunit_try_run_case+0x170/0x3f0
[   21.473167]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   21.473279]  kthread+0x328/0x630
[   21.473365]  ret_from_fork+0x10/0x20
[   21.473485] 
[   21.473528] Allocated by task 168:
[   21.473593]  kasan_save_stack+0x3c/0x68
[   21.473975]  kasan_save_track+0x20/0x40
[   21.474069]  kasan_save_alloc_info+0x40/0x58
[   21.474163]  __kasan_kmalloc+0xd4/0xd8
[   21.474253]  __kmalloc_cache_noprof+0x15c/0x3c0
[   21.474481]  kmalloc_uaf_16+0x140/0x438
[   21.474570]  kunit_try_run_case+0x170/0x3f0
[   21.474653]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   21.474752]  kthread+0x328/0x630
[   21.474837]  ret_from_fork+0x10/0x20
[   21.474949] 
[   21.475161] Freed by task 168:
[   21.475254]  kasan_save_stack+0x3c/0x68
[   21.475437]  kasan_save_track+0x20/0x40
[   21.475571]  kasan_save_free_info+0x4c/0x78
[   21.475698]  __kasan_slab_free+0x6c/0x98
[   21.475786]  kfree+0x214/0x3c8
[   21.475882]  kmalloc_uaf_16+0x190/0x438
[   21.476005]  kunit_try_run_case+0x170/0x3f0
[   21.476099]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   21.476206]  kthread+0x328/0x630
[   21.476285]  ret_from_fork+0x10/0x20
[   21.476376] 
[   21.476440] The buggy address belongs to the object at fff00000c66b1080
[   21.476440]  which belongs to the cache kmalloc-16 of size 16
[   21.476587] The buggy address is located 0 bytes inside of
[   21.476587]  freed 16-byte region [fff00000c66b1080, fff00000c66b1090)
[   21.476747] 
[   21.476867] The buggy address belongs to the physical page:
[   21.476969] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1066b1
[   21.477165] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   21.477312] page_type: f5(slab)
[   21.477422] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000
[   21.477542] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   21.477690] page dumped because: kasan: bad access detected
[   21.477783] 
[   21.477833] Memory state around the buggy address:
[   21.477925]  fff00000c66b0f80: 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc fc
[   21.478252]  fff00000c66b1000: fa fb fc fc fa fb fc fc fa fb fc fc 00 00 fc fc
[   21.478529] >fff00000c66b1080: fa fb fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   21.478743]                    ^
[   21.479029]  fff00000c66b1100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   21.479222]  fff00000c66b1180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   21.479442] ==================================================================


[   10.896800] ==================================================================
[   10.897694] BUG: KASAN: slab-use-after-free in kmalloc_uaf_16+0x47b/0x4c0
[   10.898547] Read of size 16 at addr ffff888102856060 by task kunit_try_catch/185
[   10.899045] 
[   10.899313] CPU: 1 UID: 0 PID: 185 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-next-20250529 #1 PREEMPT(voluntary) 
[   10.899362] Tainted: [B]=BAD_PAGE, [N]=TEST
[   10.899374] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   10.899396] Call Trace:
[   10.899408]  <TASK>
[   10.899424]  dump_stack_lvl+0x73/0xb0
[   10.899484]  print_report+0xd1/0x650
[   10.899507]  ? __virt_addr_valid+0x1db/0x2d0
[   10.899530]  ? kmalloc_uaf_16+0x47b/0x4c0
[   10.899550]  ? kasan_complete_mode_report_info+0x64/0x200
[   10.899572]  ? kmalloc_uaf_16+0x47b/0x4c0
[   10.899593]  kasan_report+0x141/0x180
[   10.899626]  ? kmalloc_uaf_16+0x47b/0x4c0
[   10.899652]  __asan_report_load16_noabort+0x18/0x20
[   10.899672]  kmalloc_uaf_16+0x47b/0x4c0
[   10.899693]  ? __pfx_kmalloc_uaf_16+0x10/0x10
[   10.899715]  ? __schedule+0x10cc/0x2b60
[   10.899739]  ? __pfx_read_tsc+0x10/0x10
[   10.899767]  ? ktime_get_ts64+0x86/0x230
[   10.899792]  kunit_try_run_case+0x1a5/0x480
[   10.899814]  ? __pfx_kunit_try_run_case+0x10/0x10
[   10.899833]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   10.899857]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   10.899881]  ? __kthread_parkme+0x82/0x180
[   10.899902]  ? preempt_count_sub+0x50/0x80
[   10.899926]  ? __pfx_kunit_try_run_case+0x10/0x10
[   10.899946]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   10.899970]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   10.899994]  kthread+0x337/0x6f0
[   10.900013]  ? trace_preempt_on+0x20/0xc0
[   10.900037]  ? __pfx_kthread+0x10/0x10
[   10.900057]  ? _raw_spin_unlock_irq+0x47/0x80
[   10.900078]  ? calculate_sigpending+0x7b/0xa0
[   10.900103]  ? __pfx_kthread+0x10/0x10
[   10.900124]  ret_from_fork+0x116/0x1d0
[   10.900141]  ? __pfx_kthread+0x10/0x10
[   10.900161]  ret_from_fork_asm+0x1a/0x30
[   10.900192]  </TASK>
[   10.900202] 
[   10.914379] Allocated by task 185:
[   10.914520]  kasan_save_stack+0x45/0x70
[   10.914696]  kasan_save_track+0x18/0x40
[   10.914979]  kasan_save_alloc_info+0x3b/0x50
[   10.915172]  __kasan_kmalloc+0xb7/0xc0
[   10.915330]  __kmalloc_cache_noprof+0x189/0x420
[   10.915508]  kmalloc_uaf_16+0x15b/0x4c0
[   10.915716]  kunit_try_run_case+0x1a5/0x480
[   10.915912]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   10.916141]  kthread+0x337/0x6f0
[   10.916266]  ret_from_fork+0x116/0x1d0
[   10.916889]  ret_from_fork_asm+0x1a/0x30
[   10.917118] 
[   10.917220] Freed by task 185:
[   10.917380]  kasan_save_stack+0x45/0x70
[   10.917578]  kasan_save_track+0x18/0x40
[   10.917761]  kasan_save_free_info+0x3f/0x60
[   10.917963]  __kasan_slab_free+0x56/0x70
[   10.918346]  kfree+0x222/0x3f0
[   10.918493]  kmalloc_uaf_16+0x1d6/0x4c0
[   10.918683]  kunit_try_run_case+0x1a5/0x480
[   10.918987]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   10.919270]  kthread+0x337/0x6f0
[   10.919396]  ret_from_fork+0x116/0x1d0
[   10.919575]  ret_from_fork_asm+0x1a/0x30
[   10.919929] 
[   10.920020] The buggy address belongs to the object at ffff888102856060
[   10.920020]  which belongs to the cache kmalloc-16 of size 16
[   10.920508] The buggy address is located 0 bytes inside of
[   10.920508]  freed 16-byte region [ffff888102856060, ffff888102856070)
[   10.921551] 
[   10.921653] The buggy address belongs to the physical page:
[   10.922203] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102856
[   10.922848] flags: 0x200000000000000(node=0|zone=2)
[   10.923204] page_type: f5(slab)
[   10.923353] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000
[   10.924050] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   10.924397] page dumped because: kasan: bad access detected
[   10.924630] 
[   10.924729] Memory state around the buggy address:
[   10.925184]  ffff888102855f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   10.925620]  ffff888102855f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   10.926095] >ffff888102856000: fa fb fc fc fa fb fc fc 00 00 fc fc fa fb fc fc
[   10.926513]                                                        ^
[   10.927017]  ffff888102856080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   10.927341]  ffff888102856100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   10.927681] ==================================================================