Hay
Date
Dec. 5, 2024, 2:07 p.m.

Environment
qemu-arm64
qemu-x86_64

[   30.662329] ==================================================================
[   30.663212] BUG: KASAN: double-free in kfree_sensitive+0x3c/0xb0
[   30.664597] Free of addr fff00000c61b4340 by task kunit_try_catch/181
[   30.665476] 
[   30.665936] CPU: 0 UID: 0 PID: 181 Comm: kunit_try_catch Tainted: G    B            N 6.13.0-rc1-next-20241205 #1
[   30.667104] Tainted: [B]=BAD_PAGE, [N]=TEST
[   30.667638] Hardware name: linux,dummy-virt (DT)
[   30.670550] Call trace:
[   30.670975]  show_stack+0x20/0x38 (C)
[   30.671892]  dump_stack_lvl+0x8c/0xd0
[   30.672473]  print_report+0x118/0x5e0
[   30.673063]  kasan_report_invalid_free+0xb0/0xd8
[   30.673708]  check_slab_allocation+0xd4/0x108
[   30.674431]  __kasan_slab_pre_free+0x2c/0x48
[   30.675055]  kfree+0xe8/0x3c8
[   30.675780]  kfree_sensitive+0x3c/0xb0
[   30.676352]  kmalloc_double_kzfree+0x168/0x308
[   30.676973]  kunit_try_run_case+0x14c/0x3d0
[   30.677672]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   30.678486]  kthread+0x24c/0x2d0
[   30.678961]  ret_from_fork+0x10/0x20
[   30.679836] 
[   30.680361] Allocated by task 181:
[   30.680754]  kasan_save_stack+0x3c/0x68
[   30.681321]  kasan_save_track+0x20/0x40
[   30.681839]  kasan_save_alloc_info+0x40/0x58
[   30.682607]  __kasan_kmalloc+0xd4/0xd8
[   30.683119]  __kmalloc_cache_noprof+0x15c/0x3c0
[   30.684282]  kmalloc_double_kzfree+0xb8/0x308
[   30.684598]  kunit_try_run_case+0x14c/0x3d0
[   30.684927]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   30.685681]  kthread+0x24c/0x2d0
[   30.686437]  ret_from_fork+0x10/0x20
[   30.686982] 
[   30.687644] Freed by task 181:
[   30.688281]  kasan_save_stack+0x3c/0x68
[   30.688992]  kasan_save_track+0x20/0x40
[   30.689724]  kasan_save_free_info+0x4c/0x78
[   30.690501]  __kasan_slab_free+0x6c/0x98
[   30.691512]  kfree+0x114/0x3c8
[   30.692002]  kfree_sensitive+0x80/0xb0
[   30.692703]  kmalloc_double_kzfree+0x11c/0x308
[   30.693436]  kunit_try_run_case+0x14c/0x3d0
[   30.693971]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   30.694771]  kthread+0x24c/0x2d0
[   30.695605]  ret_from_fork+0x10/0x20
[   30.696196] 
[   30.696533] The buggy address belongs to the object at fff00000c61b4340
[   30.696533]  which belongs to the cache kmalloc-16 of size 16
[   30.697951] The buggy address is located 0 bytes inside of
[   30.697951]  16-byte region [fff00000c61b4340, fff00000c61b4350)
[   30.699515] 
[   30.699920] The buggy address belongs to the physical page:
[   30.700633] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1061b4
[   30.701603] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   30.702387] page_type: f5(slab)
[   30.702841] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000
[   30.704310] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   30.705198] page dumped because: kasan: bad access detected
[   30.705811] 
[   30.706527] Memory state around the buggy address:
[   30.707140]  fff00000c61b4200: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   30.708171]  fff00000c61b4280: 00 04 fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   30.709026] >fff00000c61b4300: fa fb fc fc fa fb fc fc fa fb fc fc fc fc fc fc
[   30.709797]                                            ^
[   30.710449]  fff00000c61b4380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   30.711467]  fff00000c61b4400: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   30.712275] ==================================================================

[   28.480198] ==================================================================
[   28.480792] BUG: KASAN: double-free in kfree_sensitive+0x2e/0x90
[   28.481343] Free of addr ffff8881025ed7c0 by task kunit_try_catch/199
[   28.483511] 
[   28.483725] CPU: 1 UID: 0 PID: 199 Comm: kunit_try_catch Tainted: G    B            N 6.13.0-rc1-next-20241205 #1
[   28.485210] Tainted: [B]=BAD_PAGE, [N]=TEST
[   28.485510] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   28.486713] Call Trace:
[   28.486944]  <TASK>
[   28.487235]  dump_stack_lvl+0x73/0xb0
[   28.487590]  print_report+0xd1/0x640
[   28.488046]  ? __virt_addr_valid+0x1db/0x2d0
[   28.488581]  ? kfree_sensitive+0x2e/0x90
[   28.489187]  ? kasan_complete_mode_report_info+0x64/0x200
[   28.489875]  ? kfree_sensitive+0x2e/0x90
[   28.490258]  kasan_report_invalid_free+0xc0/0xf0
[   28.491721]  ? kfree_sensitive+0x2e/0x90
[   28.492069]  ? kfree_sensitive+0x2e/0x90
[   28.492891]  check_slab_allocation+0x101/0x130
[   28.493600]  __kasan_slab_pre_free+0x28/0x40
[   28.494264]  kfree+0xf1/0x3f0
[   28.494674]  ? kfree_sensitive+0x2e/0x90
[   28.495146]  kfree_sensitive+0x2e/0x90
[   28.496274]  kmalloc_double_kzfree+0x19d/0x360
[   28.497437]  ? __pfx_kmalloc_double_kzfree+0x10/0x10
[   28.498543]  ? __schedule+0xc70/0x27e0
[   28.499495]  ? __pfx_read_tsc+0x10/0x10
[   28.500036]  ? ktime_get_ts64+0x86/0x230
[   28.500464]  kunit_try_run_case+0x1b3/0x490
[   28.501702]  ? __pfx_kunit_try_run_case+0x10/0x10
[   28.502273]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   28.502780]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   28.504068]  ? __kthread_parkme+0x82/0x160
[   28.504738]  ? preempt_count_sub+0x50/0x80
[   28.505479]  ? __pfx_kunit_try_run_case+0x10/0x10
[   28.506153]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   28.506751]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   28.507962]  kthread+0x257/0x310
[   28.508462]  ? __pfx_kthread+0x10/0x10
[   28.508980]  ret_from_fork+0x41/0x80
[   28.509813]  ? __pfx_kthread+0x10/0x10
[   28.510575]  ret_from_fork_asm+0x1a/0x30
[   28.511025]  </TASK>
[   28.511582] 
[   28.512033] Allocated by task 199:
[   28.512723]  kasan_save_stack+0x3d/0x60
[   28.513243]  kasan_save_track+0x18/0x40
[   28.514014]  kasan_save_alloc_info+0x3b/0x50
[   28.515070]  __kasan_kmalloc+0xb7/0xc0
[   28.515581]  __kmalloc_cache_noprof+0x184/0x410
[   28.516609]  kmalloc_double_kzfree+0xaa/0x360
[   28.517392]  kunit_try_run_case+0x1b3/0x490
[   28.517955]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   28.518708]  kthread+0x257/0x310
[   28.519196]  ret_from_fork+0x41/0x80
[   28.519642]  ret_from_fork_asm+0x1a/0x30
[   28.520431] 
[   28.520907] Freed by task 199:
[   28.521747]  kasan_save_stack+0x3d/0x60
[   28.522130]  kasan_save_track+0x18/0x40
[   28.522615]  kasan_save_free_info+0x3f/0x60
[   28.523505]  __kasan_slab_free+0x56/0x70
[   28.524452]  kfree+0x123/0x3f0
[   28.525230]  kfree_sensitive+0x67/0x90
[   28.525624]  kmalloc_double_kzfree+0x12c/0x360
[   28.526492]  kunit_try_run_case+0x1b3/0x490
[   28.527221]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   28.527720]  kthread+0x257/0x310
[   28.528573]  ret_from_fork+0x41/0x80
[   28.529255]  ret_from_fork_asm+0x1a/0x30
[   28.529833] 
[   28.530242] The buggy address belongs to the object at ffff8881025ed7c0
[   28.530242]  which belongs to the cache kmalloc-16 of size 16
[   28.531892] The buggy address is located 0 bytes inside of
[   28.531892]  16-byte region [ffff8881025ed7c0, ffff8881025ed7d0)
[   28.532555] 
[   28.532661] The buggy address belongs to the physical page:
[   28.533303] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1025ed
[   28.534371] flags: 0x200000000000000(node=0|zone=2)
[   28.535166] page_type: f5(slab)
[   28.535494] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000
[   28.536158] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   28.536855] page dumped because: kasan: bad access detected
[   28.537457] 
[   28.537715] Memory state around the buggy address:
[   28.538345]  ffff8881025ed680: 00 05 fc fc 00 02 fc fc 00 02 fc fc 00 02 fc fc
[   28.539165]  ffff8881025ed700: 00 02 fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   28.540173] >ffff8881025ed780: fa fb fc fc fa fb fc fc fa fb fc fc fc fc fc fc
[   28.540955]                                            ^
[   28.541523]  ffff8881025ed800: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   28.542305]  ffff8881025ed880: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   28.543130] ==================================================================