Hay
Date
July 25, 2025, 3:13 a.m.

Environment
qemu-arm64
qemu-x86_64

[   32.585786] ==================================================================
[   32.585858] BUG: KASAN: double-free in kfree_sensitive+0x3c/0xb0
[   32.585920] Free of addr fff00000c85ecee0 by task kunit_try_catch/224
[   32.585964] 
[   32.585997] CPU: 1 UID: 0 PID: 224 Comm: kunit_try_catch Tainted: G    B   W        N  6.16.0-rc7-next-20250725 #1 PREEMPT 
[   32.586084] Tainted: [B]=BAD_PAGE, [W]=WARN, [N]=TEST
[   32.586133] Hardware name: linux,dummy-virt (DT)
[   32.586165] Call trace:
[   32.586188]  show_stack+0x20/0x38 (C)
[   32.586237]  dump_stack_lvl+0x8c/0xd0
[   32.586281]  print_report+0x118/0x5e8
[   32.586326]  kasan_report_invalid_free+0xc0/0xe8
[   32.586373]  check_slab_allocation+0xd4/0x108
[   32.586419]  __kasan_slab_pre_free+0x2c/0x48
[   32.586470]  kfree+0xe8/0x3c8
[   32.586513]  kfree_sensitive+0x3c/0xb0
[   32.586559]  kmalloc_double_kzfree+0x168/0x308
[   32.586607]  kunit_try_run_case+0x170/0x3f0
[   32.586665]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   32.586717]  kthread+0x328/0x630
[   32.586758]  ret_from_fork+0x10/0x20
[   32.586806] 
[   32.586824] Allocated by task 224:
[   32.586851]  kasan_save_stack+0x3c/0x68
[   32.586889]  kasan_save_track+0x20/0x40
[   32.586923]  kasan_save_alloc_info+0x40/0x58
[   32.588311]  __kasan_kmalloc+0xd4/0xd8
[   32.588504]  __kmalloc_cache_noprof+0x16c/0x3c0
[   32.589001]  kmalloc_double_kzfree+0xb8/0x308
[   32.589100]  kunit_try_run_case+0x170/0x3f0
[   32.589276]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   32.589671]  kthread+0x328/0x630
[   32.590176]  ret_from_fork+0x10/0x20
[   32.590295] 
[   32.590368] Freed by task 224:
[   32.590398]  kasan_save_stack+0x3c/0x68
[   32.590601]  kasan_save_track+0x20/0x40
[   32.590946]  kasan_save_free_info+0x4c/0x78
[   32.591068]  __kasan_slab_free+0x7c/0xa8
[   32.591305]  kfree+0x214/0x3c8
[   32.591449]  kfree_sensitive+0x80/0xb0
[   32.591567]  kmalloc_double_kzfree+0x11c/0x308
[   32.591711]  kunit_try_run_case+0x170/0x3f0
[   32.591870]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   32.591955]  kthread+0x328/0x630
[   32.591996]  ret_from_fork+0x10/0x20
[   32.592159] 
[   32.592371] The buggy address belongs to the object at fff00000c85ecee0
[   32.592371]  which belongs to the cache kmalloc-16 of size 16
[   32.592590] The buggy address is located 0 bytes inside of
[   32.592590]  16-byte region [fff00000c85ecee0, fff00000c85ecef0)
[   32.592724] 
[   32.592746] The buggy address belongs to the physical page:
[   32.593118] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1085ec
[   32.593236] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   32.593303] page_type: f5(slab)
[   32.593339] raw: 0bfffe0000000000 fff00000c0001640 dead000000000100 dead000000000122
[   32.594072] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   32.594491] page dumped because: kasan: bad access detected
[   32.594650] 
[   32.594674] Memory state around the buggy address:
[   32.594760]  fff00000c85ecd80: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   32.595255]  fff00000c85ece00: fa fb fc fc fa fb fc fc 00 00 fc fc fa fb fc fc
[   32.595528] >fff00000c85ece80: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   32.595615]                                                        ^
[   32.595724]  fff00000c85ecf00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   32.595987]  fff00000c85ecf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   32.596151] ==================================================================

[   26.160896] ==================================================================
[   26.161978] BUG: KASAN: double-free in kfree_sensitive+0x2e/0x90
[   26.162609] Free of addr ffff8881057d7660 by task kunit_try_catch/241
[   26.163516] 
[   26.163619] CPU: 0 UID: 0 PID: 241 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc7-next-20250725 #1 PREEMPT(voluntary) 
[   26.163670] Tainted: [B]=BAD_PAGE, [N]=TEST
[   26.163683] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   26.163703] Call Trace:
[   26.163717]  <TASK>
[   26.163735]  dump_stack_lvl+0x73/0xb0
[   26.163766]  print_report+0xd1/0x640
[   26.163961]  ? __virt_addr_valid+0x1db/0x2d0
[   26.163994]  ? kasan_complete_mode_report_info+0x64/0x200
[   26.164022]  ? kfree_sensitive+0x2e/0x90
[   26.164043]  kasan_report_invalid_free+0x10a/0x130
[   26.164069]  ? kfree_sensitive+0x2e/0x90
[   26.164145]  ? kfree_sensitive+0x2e/0x90
[   26.164165]  check_slab_allocation+0x101/0x130
[   26.164188]  __kasan_slab_pre_free+0x28/0x40
[   26.164209]  kfree+0xf0/0x3f0
[   26.164232]  ? kfree_sensitive+0x2e/0x90
[   26.164254]  kfree_sensitive+0x2e/0x90
[   26.164274]  kmalloc_double_kzfree+0x19c/0x350
[   26.164298]  ? __pfx_kmalloc_double_kzfree+0x10/0x10
[   26.164322]  ? __schedule+0x10da/0x2b60
[   26.164344]  ? __pfx_read_tsc+0x10/0x10
[   26.164367]  ? ktime_get_ts64+0x86/0x230
[   26.164391]  kunit_try_run_case+0x1a5/0x480
[   26.164416]  ? __pfx_kunit_try_run_case+0x10/0x10
[   26.164439]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   26.164461]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   26.164488]  ? __kthread_parkme+0x82/0x180
[   26.164508]  ? preempt_count_sub+0x50/0x80
[   26.164531]  ? __pfx_kunit_try_run_case+0x10/0x10
[   26.164556]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   26.164579]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   26.164603]  kthread+0x337/0x6f0
[   26.164623]  ? trace_preempt_on+0x20/0xc0
[   26.164647]  ? __pfx_kthread+0x10/0x10
[   26.164668]  ? _raw_spin_unlock_irq+0x47/0x80
[   26.164693]  ? calculate_sigpending+0x7b/0xa0
[   26.164716]  ? __pfx_kthread+0x10/0x10
[   26.164738]  ret_from_fork+0x116/0x1d0
[   26.164758]  ? __pfx_kthread+0x10/0x10
[   26.164778]  ret_from_fork_asm+0x1a/0x30
[   26.164820]  </TASK>
[   26.164832] 
[   26.178401] Allocated by task 241:
[   26.178637]  kasan_save_stack+0x45/0x70
[   26.178782]  kasan_save_track+0x18/0x40
[   26.179209]  kasan_save_alloc_info+0x3b/0x50
[   26.179601]  __kasan_kmalloc+0xb7/0xc0
[   26.179906]  __kmalloc_cache_noprof+0x189/0x420
[   26.180342]  kmalloc_double_kzfree+0xa9/0x350
[   26.180505]  kunit_try_run_case+0x1a5/0x480
[   26.180653]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   26.180861]  kthread+0x337/0x6f0
[   26.180992]  ret_from_fork+0x116/0x1d0
[   26.181319]  ret_from_fork_asm+0x1a/0x30
[   26.181497] 
[   26.181571] Freed by task 241:
[   26.181693]  kasan_save_stack+0x45/0x70
[   26.181884]  kasan_save_track+0x18/0x40
[   26.182126]  kasan_save_free_info+0x3f/0x60
[   26.182306]  __kasan_slab_free+0x5e/0x80
[   26.182480]  kfree+0x222/0x3f0
[   26.182595]  kfree_sensitive+0x67/0x90
[   26.182726]  kmalloc_double_kzfree+0x12b/0x350
[   26.182939]  kunit_try_run_case+0x1a5/0x480
[   26.183263]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   26.183553]  kthread+0x337/0x6f0
[   26.183717]  ret_from_fork+0x116/0x1d0
[   26.184065]  ret_from_fork_asm+0x1a/0x30
[   26.184248] 
[   26.184335] The buggy address belongs to the object at ffff8881057d7660
[   26.184335]  which belongs to the cache kmalloc-16 of size 16
[   26.184788] The buggy address is located 0 bytes inside of
[   26.184788]  16-byte region [ffff8881057d7660, ffff8881057d7670)
[   26.185336] 
[   26.185413] The buggy address belongs to the physical page:
[   26.185609] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1057d7
[   26.185974] flags: 0x200000000000000(node=0|zone=2)
[   26.186203] page_type: f5(slab)
[   26.186413] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000
[   26.186658] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   26.187414] page dumped because: kasan: bad access detected
[   26.187638] 
[   26.187729] Memory state around the buggy address:
[   26.187936]  ffff8881057d7500: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   26.188271]  ffff8881057d7580: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   26.188537] >ffff8881057d7600: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   26.188908]                                                        ^
[   26.189198]  ffff8881057d7680: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   26.189474]  ffff8881057d7700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   26.189766] ==================================================================