Hay
Date
July 15, 2025, 2:09 p.m.

Environment
qemu-arm64
qemu-x86_64

[   18.052987] ==================================================================
[   18.053226] BUG: KASAN: slab-use-after-free in kmalloc_uaf2+0x3f4/0x468
[   18.053737] Read of size 1 at addr fff00000c59d5fa8 by task kunit_try_catch/190
[   18.054075] 
[   18.054113] CPU: 0 UID: 0 PID: 190 Comm: kunit_try_catch Tainted: G    B            N  6.15.7-rc1 #1 PREEMPT 
[   18.054217] Tainted: [B]=BAD_PAGE, [N]=TEST
[   18.054243] Hardware name: linux,dummy-virt (DT)
[   18.054276] Call trace:
[   18.054297]  show_stack+0x20/0x38 (C)
[   18.054390]  dump_stack_lvl+0x8c/0xd0
[   18.054442]  print_report+0x118/0x5d0
[   18.054488]  kasan_report+0xdc/0x128
[   18.054541]  __asan_report_load1_noabort+0x20/0x30
[   18.054599]  kmalloc_uaf2+0x3f4/0x468
[   18.054646]  kunit_try_run_case+0x170/0x3f0
[   18.054704]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.054759]  kthread+0x328/0x630
[   18.054804]  ret_from_fork+0x10/0x20
[   18.054853] 
[   18.054871] Allocated by task 190:
[   18.054899]  kasan_save_stack+0x3c/0x68
[   18.054938]  kasan_save_track+0x20/0x40
[   18.054974]  kasan_save_alloc_info+0x40/0x58
[   18.055016]  __kasan_kmalloc+0xd4/0xd8
[   18.055062]  __kmalloc_cache_noprof+0x16c/0x3c0
[   18.055110]  kmalloc_uaf2+0xc4/0x468
[   18.055157]  kunit_try_run_case+0x170/0x3f0
[   18.055194]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.055525]  kthread+0x328/0x630
[   18.055657]  ret_from_fork+0x10/0x20
[   18.056255] 
[   18.056638] Freed by task 190:
[   18.056804]  kasan_save_stack+0x3c/0x68
[   18.057114]  kasan_save_track+0x20/0x40
[   18.057297]  kasan_save_free_info+0x4c/0x78
[   18.057692]  __kasan_slab_free+0x6c/0x98
[   18.057895]  kfree+0x214/0x3c8
[   18.057942]  kmalloc_uaf2+0x134/0x468
[   18.058166]  kunit_try_run_case+0x170/0x3f0
[   18.058275]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.058352]  kthread+0x328/0x630
[   18.058730]  ret_from_fork+0x10/0x20
[   18.058797] 
[   18.058919] The buggy address belongs to the object at fff00000c59d5f80
[   18.058919]  which belongs to the cache kmalloc-64 of size 64
[   18.059004] The buggy address is located 40 bytes inside of
[   18.059004]  freed 64-byte region [fff00000c59d5f80, fff00000c59d5fc0)
[   18.059384] 
[   18.059421] The buggy address belongs to the physical page:
[   18.059609] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1059d5
[   18.059824] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   18.059998] page_type: f5(slab)
[   18.060040] raw: 0bfffe0000000000 fff00000c00018c0 dead000000000122 0000000000000000
[   18.060562] raw: 0000000000000000 0000000000200020 00000000f5000000 0000000000000000
[   18.060644] page dumped because: kasan: bad access detected
[   18.060679] 
[   18.060835] Memory state around the buggy address:
[   18.061057]  fff00000c59d5e80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   18.061163]  fff00000c59d5f00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   18.061224] >fff00000c59d5f80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   18.061658]                                   ^
[   18.061730]  fff00000c59d6000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   18.061786]  fff00000c59d6080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   18.061826] ==================================================================

[   11.298088] ==================================================================
[   11.298542] BUG: KASAN: slab-use-after-free in kmalloc_uaf2+0x4a8/0x520
[   11.298841] Read of size 1 at addr ffff888102f39328 by task kunit_try_catch/207
[   11.299203] 
[   11.299298] CPU: 1 UID: 0 PID: 207 Comm: kunit_try_catch Tainted: G    B            N  6.15.7-rc1 #1 PREEMPT(voluntary) 
[   11.299338] Tainted: [B]=BAD_PAGE, [N]=TEST
[   11.299349] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   11.299367] Call Trace:
[   11.299377]  <TASK>
[   11.299390]  dump_stack_lvl+0x73/0xb0
[   11.299412]  print_report+0xd1/0x610
[   11.299435]  ? __virt_addr_valid+0x1db/0x2d0
[   11.299455]  ? kmalloc_uaf2+0x4a8/0x520
[   11.299475]  ? kasan_complete_mode_report_info+0x64/0x200
[   11.299497]  ? kmalloc_uaf2+0x4a8/0x520
[   11.299518]  kasan_report+0x141/0x180
[   11.299539]  ? kmalloc_uaf2+0x4a8/0x520
[   11.299564]  __asan_report_load1_noabort+0x18/0x20
[   11.299584]  kmalloc_uaf2+0x4a8/0x520
[   11.299605]  ? __pfx_kmalloc_uaf2+0x10/0x10
[   11.299624]  ? __schedule+0x207f/0x2b60
[   11.299644]  ? schedule+0x7c/0x2e0
[   11.299664]  ? trace_hardirqs_on+0x37/0xe0
[   11.299687]  ? __schedule+0x207f/0x2b60
[   11.299708]  ? __pfx_read_tsc+0x10/0x10
[   11.299727]  ? ktime_get_ts64+0x86/0x230
[   11.299750]  kunit_try_run_case+0x1a5/0x480
[   11.299769]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.299787]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   11.299809]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   11.299832]  ? __kthread_parkme+0x82/0x180
[   11.299853]  ? preempt_count_sub+0x50/0x80
[   11.299876]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.299908]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.299930]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   11.299952]  kthread+0x337/0x6f0
[   11.299968]  ? trace_preempt_on+0x20/0xc0
[   11.299989]  ? __pfx_kthread+0x10/0x10
[   11.300007]  ? _raw_spin_unlock_irq+0x47/0x80
[   11.300027]  ? calculate_sigpending+0x7b/0xa0
[   11.300048]  ? __pfx_kthread+0x10/0x10
[   11.300065]  ret_from_fork+0x41/0x80
[   11.300084]  ? __pfx_kthread+0x10/0x10
[   11.300101]  ret_from_fork_asm+0x1a/0x30
[   11.300131]  </TASK>
[   11.300140] 
[   11.307465] Allocated by task 207:
[   11.307646]  kasan_save_stack+0x45/0x70
[   11.307859]  kasan_save_track+0x18/0x40
[   11.308084]  kasan_save_alloc_info+0x3b/0x50
[   11.308294]  __kasan_kmalloc+0xb7/0xc0
[   11.308487]  __kmalloc_cache_noprof+0x189/0x420
[   11.308705]  kmalloc_uaf2+0xc6/0x520
[   11.308910]  kunit_try_run_case+0x1a5/0x480
[   11.309092]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.309272]  kthread+0x337/0x6f0
[   11.309389]  ret_from_fork+0x41/0x80
[   11.309548]  ret_from_fork_asm+0x1a/0x30
[   11.309747] 
[   11.309899] Freed by task 207:
[   11.310069]  kasan_save_stack+0x45/0x70
[   11.310268]  kasan_save_track+0x18/0x40
[   11.310455]  kasan_save_free_info+0x3f/0x60
[   11.310633]  __kasan_slab_free+0x56/0x70
[   11.311073]  kfree+0x222/0x3f0
[   11.311209]  kmalloc_uaf2+0x14c/0x520
[   11.311435]  kunit_try_run_case+0x1a5/0x480
[   11.311587]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.311760]  kthread+0x337/0x6f0
[   11.311876]  ret_from_fork+0x41/0x80
[   11.312019]  ret_from_fork_asm+0x1a/0x30
[   11.312161] 
[   11.312242] The buggy address belongs to the object at ffff888102f39300
[   11.312242]  which belongs to the cache kmalloc-64 of size 64
[   11.312757] The buggy address is located 40 bytes inside of
[   11.312757]  freed 64-byte region [ffff888102f39300, ffff888102f39340)
[   11.313480] 
[   11.313552] The buggy address belongs to the physical page:
[   11.313720] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102f39
[   11.313969] flags: 0x200000000000000(node=0|zone=2)
[   11.314130] page_type: f5(slab)
[   11.314247] raw: 0200000000000000 ffff8881000418c0 dead000000000122 0000000000000000
[   11.314988] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   11.315334] page dumped because: kasan: bad access detected
[   11.315587] 
[   11.315680] Memory state around the buggy address:
[   11.315912]  ffff888102f39200: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   11.316308]  ffff888102f39280: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   11.316548] >ffff888102f39300: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   11.316752]                                   ^
[   11.317327]  ffff888102f39380: 00 00 00 00 00 03 fc fc fc fc fc fc fc fc fc fc
[   11.317659]  ffff888102f39400: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.318108] ==================================================================