Hay
Date
July 3, 2025, 6:13 p.m.

Environment
qemu-arm64
qemu-x86_64

[   16.789319] ==================================================================
[   16.789727] BUG: KASAN: slab-use-after-free in kmalloc_uaf_16+0x3bc/0x438
[   16.790172] Read of size 16 at addr fff00000c3fbdd60 by task kunit_try_catch/168
[   16.790246] 
[   16.790280] CPU: 0 UID: 0 PID: 168 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT 
[   16.790401] Tainted: [B]=BAD_PAGE, [N]=TEST
[   16.790528] Hardware name: linux,dummy-virt (DT)
[   16.790565] Call trace:
[   16.790686]  show_stack+0x20/0x38 (C)
[   16.790749]  dump_stack_lvl+0x8c/0xd0
[   16.790794]  print_report+0x118/0x608
[   16.790838]  kasan_report+0xdc/0x128
[   16.790882]  __asan_report_load16_noabort+0x20/0x30
[   16.790927]  kmalloc_uaf_16+0x3bc/0x438
[   16.790970]  kunit_try_run_case+0x170/0x3f0
[   16.791015]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   16.791407]  kthread+0x328/0x630
[   16.791470]  ret_from_fork+0x10/0x20
[   16.791816] 
[   16.791884] Allocated by task 168:
[   16.791926]  kasan_save_stack+0x3c/0x68
[   16.791969]  kasan_save_track+0x20/0x40
[   16.792074]  kasan_save_alloc_info+0x40/0x58
[   16.792153]  __kasan_kmalloc+0xd4/0xd8
[   16.792189]  __kmalloc_cache_noprof+0x16c/0x3c0
[   16.792491]  kmalloc_uaf_16+0x140/0x438
[   16.792744]  kunit_try_run_case+0x170/0x3f0
[   16.792960]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   16.793070]  kthread+0x328/0x630
[   16.793157]  ret_from_fork+0x10/0x20
[   16.793226] 
[   16.793355] Freed by task 168:
[   16.793392]  kasan_save_stack+0x3c/0x68
[   16.793595]  kasan_save_track+0x20/0x40
[   16.793655]  kasan_save_free_info+0x4c/0x78
[   16.793832]  __kasan_slab_free+0x6c/0x98
[   16.793985]  kfree+0x214/0x3c8
[   16.794193]  kmalloc_uaf_16+0x190/0x438
[   16.794282]  kunit_try_run_case+0x170/0x3f0
[   16.794424]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   16.794579]  kthread+0x328/0x630
[   16.794658]  ret_from_fork+0x10/0x20
[   16.794816] 
[   16.794908] The buggy address belongs to the object at fff00000c3fbdd60
[   16.794908]  which belongs to the cache kmalloc-16 of size 16
[   16.795354] The buggy address is located 0 bytes inside of
[   16.795354]  freed 16-byte region [fff00000c3fbdd60, fff00000c3fbdd70)
[   16.795470] 
[   16.795503] The buggy address belongs to the physical page:
[   16.795532] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x103fbd
[   16.795769] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   16.795864] page_type: f5(slab)
[   16.796060] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000
[   16.796116] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   16.796352] page dumped because: kasan: bad access detected
[   16.796401] 
[   16.796491] Memory state around the buggy address:
[   16.796523]  fff00000c3fbdc00: fa fb fc fc 00 02 fc fc fa fb fc fc fa fb fc fc
[   16.796909]  fff00000c3fbdc80: fa fb fc fc fa fb fc fc fa fb fc fc 00 04 fc fc
[   16.797062] >fff00000c3fbdd00: fa fb fc fc fa fb fc fc 00 00 fc fc fa fb fc fc
[   16.797104]                                                        ^
[   16.797148]  fff00000c3fbdd80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   16.797396]  fff00000c3fbde00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   16.797686] ==================================================================

[   11.487929] ==================================================================
[   11.488611] BUG: KASAN: slab-use-after-free in kmalloc_uaf_16+0x47b/0x4c0
[   11.488948] Read of size 16 at addr ffff888101745e80 by task kunit_try_catch/186
[   11.489358] 
[   11.489657] CPU: 1 UID: 0 PID: 186 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT(voluntary) 
[   11.489703] Tainted: [B]=BAD_PAGE, [N]=TEST
[   11.489715] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   11.489733] Call Trace:
[   11.489745]  <TASK>
[   11.489759]  dump_stack_lvl+0x73/0xb0
[   11.489789]  print_report+0xd1/0x650
[   11.489811]  ? __virt_addr_valid+0x1db/0x2d0
[   11.489834]  ? kmalloc_uaf_16+0x47b/0x4c0
[   11.489853]  ? kasan_complete_mode_report_info+0x64/0x200
[   11.489874]  ? kmalloc_uaf_16+0x47b/0x4c0
[   11.489894]  kasan_report+0x141/0x180
[   11.489915]  ? kmalloc_uaf_16+0x47b/0x4c0
[   11.489939]  __asan_report_load16_noabort+0x18/0x20
[   11.489962]  kmalloc_uaf_16+0x47b/0x4c0
[   11.489982]  ? __pfx_kmalloc_uaf_16+0x10/0x10
[   11.490003]  ? __schedule+0x10cc/0x2b60
[   11.490024]  ? __pfx_read_tsc+0x10/0x10
[   11.490044]  ? ktime_get_ts64+0x86/0x230
[   11.490067]  kunit_try_run_case+0x1a5/0x480
[   11.490092]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.490127]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   11.490185]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   11.490208]  ? __kthread_parkme+0x82/0x180
[   11.490229]  ? preempt_count_sub+0x50/0x80
[   11.490252]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.490275]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.490297]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   11.490319]  kthread+0x337/0x6f0
[   11.490337]  ? trace_preempt_on+0x20/0xc0
[   11.490360]  ? __pfx_kthread+0x10/0x10
[   11.490380]  ? _raw_spin_unlock_irq+0x47/0x80
[   11.490400]  ? calculate_sigpending+0x7b/0xa0
[   11.490423]  ? __pfx_kthread+0x10/0x10
[   11.490443]  ret_from_fork+0x116/0x1d0
[   11.490460]  ? __pfx_kthread+0x10/0x10
[   11.490480]  ret_from_fork_asm+0x1a/0x30
[   11.490509]  </TASK>
[   11.490520] 
[   11.498830] Allocated by task 186:
[   11.499029]  kasan_save_stack+0x45/0x70
[   11.499377]  kasan_save_track+0x18/0x40
[   11.499579]  kasan_save_alloc_info+0x3b/0x50
[   11.499796]  __kasan_kmalloc+0xb7/0xc0
[   11.499994]  __kmalloc_cache_noprof+0x189/0x420
[   11.500246]  kmalloc_uaf_16+0x15b/0x4c0
[   11.500551]  kunit_try_run_case+0x1a5/0x480
[   11.500770]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.501015]  kthread+0x337/0x6f0
[   11.501301]  ret_from_fork+0x116/0x1d0
[   11.501523]  ret_from_fork_asm+0x1a/0x30
[   11.501767] 
[   11.501857] Freed by task 186:
[   11.501968]  kasan_save_stack+0x45/0x70
[   11.502150]  kasan_save_track+0x18/0x40
[   11.502338]  kasan_save_free_info+0x3f/0x60
[   11.502535]  __kasan_slab_free+0x56/0x70
[   11.502723]  kfree+0x222/0x3f0
[   11.503147]  kmalloc_uaf_16+0x1d6/0x4c0
[   11.503395]  kunit_try_run_case+0x1a5/0x480
[   11.503574]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.503744]  kthread+0x337/0x6f0
[   11.503903]  ret_from_fork+0x116/0x1d0
[   11.504223]  ret_from_fork_asm+0x1a/0x30
[   11.504550] 
[   11.504686] The buggy address belongs to the object at ffff888101745e80
[   11.504686]  which belongs to the cache kmalloc-16 of size 16
[   11.505333] The buggy address is located 0 bytes inside of
[   11.505333]  freed 16-byte region [ffff888101745e80, ffff888101745e90)
[   11.505895] 
[   11.505997] The buggy address belongs to the physical page:
[   11.506442] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x101745
[   11.506709] flags: 0x200000000000000(node=0|zone=2)
[   11.506879] page_type: f5(slab)
[   11.507051] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000
[   11.507775] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   11.508003] page dumped because: kasan: bad access detected
[   11.508184] 
[   11.508254] Memory state around the buggy address:
[   11.508476]  ffff888101745d80: 00 01 fc fc 00 04 fc fc 00 04 fc fc 00 05 fc fc
[   11.508833]  ffff888101745e00: fa fb fc fc fa fb fc fc fa fb fc fc 00 00 fc fc
[   11.509251] >ffff888101745e80: fa fb fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.509960]                    ^
[   11.510296]  ffff888101745f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.510665]  ffff888101745f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.510916] ==================================================================