Hay
Date
July 17, 2025, 11:10 a.m.

Environment
qemu-arm64
qemu-x86_64

[   15.472808] ==================================================================
[   15.472873] BUG: KASAN: slab-use-after-free in kmalloc_uaf+0x300/0x338
[   15.473071] Read of size 1 at addr fff00000c433ec48 by task kunit_try_catch/185
[   15.473298] 
[   15.473366] CPU: 0 UID: 0 PID: 185 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6 #1 PREEMPT 
[   15.473518] Tainted: [B]=BAD_PAGE, [N]=TEST
[   15.473567] Hardware name: linux,dummy-virt (DT)
[   15.473674] Call trace:
[   15.473714]  show_stack+0x20/0x38 (C)
[   15.473824]  dump_stack_lvl+0x8c/0xd0
[   15.474161]  print_report+0x118/0x5d0
[   15.474253]  kasan_report+0xdc/0x128
[   15.474391]  __asan_report_load1_noabort+0x20/0x30
[   15.474614]  kmalloc_uaf+0x300/0x338
[   15.474759]  kunit_try_run_case+0x170/0x3f0
[   15.474923]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   15.475076]  kthread+0x328/0x630
[   15.475181]  ret_from_fork+0x10/0x20
[   15.475522] 
[   15.475578] Allocated by task 185:
[   15.475610]  kasan_save_stack+0x3c/0x68
[   15.475816]  kasan_save_track+0x20/0x40
[   15.475864]  kasan_save_alloc_info+0x40/0x58
[   15.476111]  __kasan_kmalloc+0xd4/0xd8
[   15.476247]  __kmalloc_cache_noprof+0x16c/0x3c0
[   15.476359]  kmalloc_uaf+0xb8/0x338
[   15.476394]  kunit_try_run_case+0x170/0x3f0
[   15.476433]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   15.476499]  kthread+0x328/0x630
[   15.476531]  ret_from_fork+0x10/0x20
[   15.476576] 
[   15.476605] Freed by task 185:
[   15.476652]  kasan_save_stack+0x3c/0x68
[   15.476689]  kasan_save_track+0x20/0x40
[   15.476726]  kasan_save_free_info+0x4c/0x78
[   15.476923]  __kasan_slab_free+0x6c/0x98
[   15.477147]  kfree+0x214/0x3c8
[   15.477262]  kmalloc_uaf+0x11c/0x338
[   15.477299]  kunit_try_run_case+0x170/0x3f0
[   15.477335]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   15.477386]  kthread+0x328/0x630
[   15.477581]  ret_from_fork+0x10/0x20
[   15.477629] 
[   15.477650] The buggy address belongs to the object at fff00000c433ec40
[   15.477650]  which belongs to the cache kmalloc-16 of size 16
[   15.477875] The buggy address is located 8 bytes inside of
[   15.477875]  freed 16-byte region [fff00000c433ec40, fff00000c433ec50)
[   15.478087] 
[   15.478109] The buggy address belongs to the physical page:
[   15.478143] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10433e
[   15.478389] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   15.478493] page_type: f5(slab)
[   15.478743] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000
[   15.479138] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   15.479299] page dumped because: kasan: bad access detected
[   15.479345] 
[   15.479363] Memory state around the buggy address:
[   15.479441]  fff00000c433eb00: 00 07 fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   15.479695]  fff00000c433eb80: 00 04 fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   15.479855] >fff00000c433ec00: fa fb fc fc fa fb fc fc fa fb fc fc fc fc fc fc
[   15.479976]                                               ^
[   15.480046]  fff00000c433ec80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   15.480090]  fff00000c433ed00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   15.480249] ==================================================================

[   13.293660] ==================================================================
[   13.294162] BUG: KASAN: slab-use-after-free in kmalloc_uaf+0x320/0x380
[   13.294814] Read of size 1 at addr ffff88810254a288 by task kunit_try_catch/201
[   13.295142] 
[   13.295240] CPU: 1 UID: 0 PID: 201 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6 #1 PREEMPT(voluntary) 
[   13.295283] Tainted: [B]=BAD_PAGE, [N]=TEST
[   13.295294] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   13.295314] Call Trace:
[   13.295325]  <TASK>
[   13.295338]  dump_stack_lvl+0x73/0xb0
[   13.295367]  print_report+0xd1/0x610
[   13.295389]  ? __virt_addr_valid+0x1db/0x2d0
[   13.295411]  ? kmalloc_uaf+0x320/0x380
[   13.295430]  ? kasan_complete_mode_report_info+0x64/0x200
[   13.295453]  ? kmalloc_uaf+0x320/0x380
[   13.295518]  kasan_report+0x141/0x180
[   13.295541]  ? kmalloc_uaf+0x320/0x380
[   13.295620]  __asan_report_load1_noabort+0x18/0x20
[   13.295646]  kmalloc_uaf+0x320/0x380
[   13.295666]  ? __pfx_kmalloc_uaf+0x10/0x10
[   13.295686]  ? sysvec_apic_timer_interrupt+0x50/0x90
[   13.295712]  ? trace_hardirqs_on+0x37/0xe0
[   13.295735]  ? __pfx_read_tsc+0x10/0x10
[   13.295755]  ? ktime_get_ts64+0x86/0x230
[   13.295778]  kunit_try_run_case+0x1a5/0x480
[   13.295802]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.295827]  ? queued_spin_lock_slowpath+0x116/0xb40
[   13.295852]  ? __kthread_parkme+0x82/0x180
[   13.295872]  ? preempt_count_sub+0x50/0x80
[   13.295895]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.295919]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.295944]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   13.295969]  kthread+0x337/0x6f0
[   13.295988]  ? trace_preempt_on+0x20/0xc0
[   13.296010]  ? __pfx_kthread+0x10/0x10
[   13.296030]  ? _raw_spin_unlock_irq+0x47/0x80
[   13.296056]  ? calculate_sigpending+0x7b/0xa0
[   13.296080]  ? __pfx_kthread+0x10/0x10
[   13.296101]  ret_from_fork+0x116/0x1d0
[   13.296120]  ? __pfx_kthread+0x10/0x10
[   13.296140]  ret_from_fork_asm+0x1a/0x30
[   13.296171]  </TASK>
[   13.296181] 
[   13.303799] Allocated by task 201:
[   13.303998]  kasan_save_stack+0x45/0x70
[   13.304260]  kasan_save_track+0x18/0x40
[   13.304812]  kasan_save_alloc_info+0x3b/0x50
[   13.304985]  __kasan_kmalloc+0xb7/0xc0
[   13.305117]  __kmalloc_cache_noprof+0x189/0x420
[   13.305442]  kmalloc_uaf+0xaa/0x380
[   13.305625]  kunit_try_run_case+0x1a5/0x480
[   13.305862]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.306098]  kthread+0x337/0x6f0
[   13.306223]  ret_from_fork+0x116/0x1d0
[   13.306459]  ret_from_fork_asm+0x1a/0x30
[   13.306669] 
[   13.306782] Freed by task 201:
[   13.306936]  kasan_save_stack+0x45/0x70
[   13.307086]  kasan_save_track+0x18/0x40
[   13.307221]  kasan_save_free_info+0x3f/0x60
[   13.307615]  __kasan_slab_free+0x56/0x70
[   13.307813]  kfree+0x222/0x3f0
[   13.307962]  kmalloc_uaf+0x12c/0x380
[   13.308128]  kunit_try_run_case+0x1a5/0x480
[   13.308274]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.308642]  kthread+0x337/0x6f0
[   13.308840]  ret_from_fork+0x116/0x1d0
[   13.309025]  ret_from_fork_asm+0x1a/0x30
[   13.309211] 
[   13.309499] The buggy address belongs to the object at ffff88810254a280
[   13.309499]  which belongs to the cache kmalloc-16 of size 16
[   13.310033] The buggy address is located 8 bytes inside of
[   13.310033]  freed 16-byte region [ffff88810254a280, ffff88810254a290)
[   13.310661] 
[   13.310762] The buggy address belongs to the physical page:
[   13.311015] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10254a
[   13.311463] flags: 0x200000000000000(node=0|zone=2)
[   13.311649] page_type: f5(slab)
[   13.311770] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000
[   13.312000] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   13.312358] page dumped because: kasan: bad access detected
[   13.312682] 
[   13.312784] Memory state around the buggy address:
[   13.313004]  ffff88810254a180: 00 05 fc fc 00 02 fc fc 00 02 fc fc 00 02 fc fc
[   13.313341]  ffff88810254a200: 00 02 fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   13.313707] >ffff88810254a280: fa fb fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.314011]                       ^
[   13.314134]  ffff88810254a300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.314354]  ffff88810254a380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.314577] ==================================================================