Hay
Date
May 12, 2025, 6:12 p.m.

Environment
qemu-arm64
qemu-x86_64

[   19.051847] ==================================================================
[   19.052754] BUG: KASAN: slab-use-after-free in kmalloc_double_kzfree+0x168/0x308
[   19.053536] Read of size 1 at addr fff00000c59b8560 by task kunit_try_catch/181
[   19.054136] 
[   19.054474] CPU: 1 UID: 0 PID: 181 Comm: kunit_try_catch Tainted: G    B            N 6.14.7-rc1 #1
[   19.054699] Tainted: [B]=BAD_PAGE, [N]=TEST
[   19.054779] Hardware name: linux,dummy-virt (DT)
[   19.055582] Call trace:
[   19.055623]  show_stack+0x20/0x38 (C)
[   19.055698]  dump_stack_lvl+0x8c/0xd0
[   19.055784]  print_report+0x118/0x608
[   19.055837]  kasan_report+0xdc/0x128
[   19.055884]  __kasan_check_byte+0x54/0x70
[   19.055933]  kfree_sensitive+0x30/0xb0
[   19.055983]  kmalloc_double_kzfree+0x168/0x308
[   19.056033]  kunit_try_run_case+0x170/0x3f0
[   19.056082]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.056134]  kthread+0x318/0x620
[   19.056180]  ret_from_fork+0x10/0x20
[   19.056230] 
[   19.060230] Allocated by task 181:
[   19.060445]  kasan_save_stack+0x3c/0x68
[   19.060677]  kasan_save_track+0x20/0x40
[   19.061853]  kasan_save_alloc_info+0x40/0x58
[   19.062405]  __kasan_kmalloc+0xd4/0xd8
[   19.062806]  __kmalloc_cache_noprof+0x15c/0x3c0
[   19.063060]  kmalloc_double_kzfree+0xb8/0x308
[   19.063303]  kunit_try_run_case+0x170/0x3f0
[   19.063535]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.064597]  kthread+0x318/0x620
[   19.065248]  ret_from_fork+0x10/0x20
[   19.066004] 
[   19.066564] Freed by task 181:
[   19.067305]  kasan_save_stack+0x3c/0x68
[   19.067715]  kasan_save_track+0x20/0x40
[   19.067964]  kasan_save_free_info+0x4c/0x78
[   19.068185]  __kasan_slab_free+0x6c/0x98
[   19.068395]  kfree+0x214/0x3c8
[   19.068585]  kfree_sensitive+0x80/0xb0
[   19.068797]  kmalloc_double_kzfree+0x11c/0x308
[   19.069018]  kunit_try_run_case+0x170/0x3f0
[   19.069233]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.069493]  kthread+0x318/0x620
[   19.069690]  ret_from_fork+0x10/0x20
[   19.070468] 
[   19.071059] The buggy address belongs to the object at fff00000c59b8560
[   19.071059]  which belongs to the cache kmalloc-16 of size 16
[   19.073051] The buggy address is located 0 bytes inside of
[   19.073051]  freed 16-byte region [fff00000c59b8560, fff00000c59b8570)
[   19.074401] 
[   19.074815] The buggy address belongs to the physical page:
[   19.075126] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1059b8
[   19.075684] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   19.076146] page_type: f5(slab)
[   19.077009] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000
[   19.077716] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   19.078488] page dumped because: kasan: bad access detected
[   19.079179] 
[   19.079427] Memory state around the buggy address:
[   19.079768]  fff00000c59b8400: fa fb fc fc 00 03 fc fc 00 03 fc fc 00 00 fc fc
[   19.080782]  fff00000c59b8480: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   19.081427] >fff00000c59b8500: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   19.082339]                                                        ^
[   19.083029]  fff00000c59b8580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   19.083910]  fff00000c59b8600: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   19.084611] ==================================================================

[   12.785533] ==================================================================
[   12.786454] BUG: KASAN: slab-use-after-free in kmalloc_double_kzfree+0x19d/0x360
[   12.786799] Read of size 1 at addr ffff888101b28040 by task kunit_try_catch/200
[   12.787154] 
[   12.787292] CPU: 1 UID: 0 PID: 200 Comm: kunit_try_catch Tainted: G    B            N 6.14.7-rc1 #1
[   12.787343] Tainted: [B]=BAD_PAGE, [N]=TEST
[   12.787355] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   12.787377] Call Trace:
[   12.787392]  <TASK>
[   12.787412]  dump_stack_lvl+0x73/0xb0
[   12.787440]  print_report+0xd1/0x650
[   12.787601]  ? __virt_addr_valid+0x1db/0x2d0
[   12.787627]  ? kmalloc_double_kzfree+0x19d/0x360
[   12.787649]  ? kasan_complete_mode_report_info+0x64/0x200
[   12.787698]  ? kmalloc_double_kzfree+0x19d/0x360
[   12.787720]  kasan_report+0x140/0x180
[   12.787741]  ? kmalloc_double_kzfree+0x19d/0x360
[   12.787766]  ? kmalloc_double_kzfree+0x19d/0x360
[   12.787787]  __kasan_check_byte+0x3d/0x50
[   12.787808]  kfree_sensitive+0x22/0x90
[   12.787830]  kmalloc_double_kzfree+0x19d/0x360
[   12.787862]  ? __pfx_kmalloc_double_kzfree+0x10/0x10
[   12.787885]  ? __schedule+0xce8/0x2840
[   12.787928]  ? __pfx_read_tsc+0x10/0x10
[   12.787951]  ? ktime_get_ts64+0x86/0x230
[   12.787977]  kunit_try_run_case+0x1a6/0x480
[   12.788098]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.788120]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   12.788142]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   12.788166]  ? __kthread_parkme+0x82/0x160
[   12.788190]  ? preempt_count_sub+0x50/0x80
[   12.788214]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.788236]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.788262]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   12.788287]  kthread+0x324/0x6e0
[   12.788308]  ? trace_preempt_on+0x20/0xc0
[   12.788332]  ? __pfx_kthread+0x10/0x10
[   12.788354]  ? _raw_spin_unlock_irq+0x47/0x80
[   12.788377]  ? calculate_sigpending+0x7b/0xa0
[   12.788400]  ? __pfx_kthread+0x10/0x10
[   12.788423]  ret_from_fork+0x41/0x80
[   12.788442]  ? __pfx_kthread+0x10/0x10
[   12.788463]  ret_from_fork_asm+0x1a/0x30
[   12.788496]  </TASK>
[   12.788510] 
[   12.796312] Allocated by task 200:
[   12.796526]  kasan_save_stack+0x45/0x70
[   12.796750]  kasan_save_track+0x18/0x40
[   12.796975]  kasan_save_alloc_info+0x3b/0x50
[   12.797313]  __kasan_kmalloc+0xb7/0xc0
[   12.797506]  __kmalloc_cache_noprof+0x18a/0x420
[   12.797665]  kmalloc_double_kzfree+0xaa/0x360
[   12.797918]  kunit_try_run_case+0x1a6/0x480
[   12.798218]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.798473]  kthread+0x324/0x6e0
[   12.798598]  ret_from_fork+0x41/0x80
[   12.798726]  ret_from_fork_asm+0x1a/0x30
[   12.798913] 
[   12.799161] Freed by task 200:
[   12.799327]  kasan_save_stack+0x45/0x70
[   12.799525]  kasan_save_track+0x18/0x40
[   12.799740]  kasan_save_free_info+0x3f/0x60
[   12.799957]  __kasan_slab_free+0x56/0x70
[   12.800237]  kfree+0x224/0x3f0
[   12.800427]  kfree_sensitive+0x67/0x90
[   12.800624]  kmalloc_double_kzfree+0x12c/0x360
[   12.800776]  kunit_try_run_case+0x1a6/0x480
[   12.800964]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.801333]  kthread+0x324/0x6e0
[   12.801525]  ret_from_fork+0x41/0x80
[   12.801708]  ret_from_fork_asm+0x1a/0x30
[   12.801922] 
[   12.802112] The buggy address belongs to the object at ffff888101b28040
[   12.802112]  which belongs to the cache kmalloc-16 of size 16
[   12.802588] The buggy address is located 0 bytes inside of
[   12.802588]  freed 16-byte region [ffff888101b28040, ffff888101b28050)
[   12.802965] 
[   12.803271] The buggy address belongs to the physical page:
[   12.803551] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x101b28
[   12.803941] flags: 0x200000000000000(node=0|zone=2)
[   12.804269] page_type: f5(slab)
[   12.804411] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000
[   12.804758] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   12.805213] page dumped because: kasan: bad access detected
[   12.805395] 
[   12.805465] Memory state around the buggy address:
[   12.805709]  ffff888101b27f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.806130]  ffff888101b27f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.806436] >ffff888101b28000: fa fb fc fc fa fb fc fc fa fb fc fc fc fc fc fc
[   12.806649]                                            ^
[   12.806911]  ffff888101b28080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.807242]  ffff888101b28100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.807535] ==================================================================