Hay
Date
May 26, 2025, 9:10 a.m.

Environment
qemu-arm64
qemu-x86_64

[   17.787644] ==================================================================
[   17.787829] BUG: KASAN: double-free in kfree_sensitive+0x3c/0xb0
[   17.787945] Free of addr fff00000c3eeb5c0 by task kunit_try_catch/192
[   17.788039] 
[   17.788106] CPU: 0 UID: 0 PID: 192 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-rc7-next-20250526 #1 PREEMPT 
[   17.788269] Tainted: [B]=BAD_PAGE, [N]=TEST
[   17.788371] Hardware name: linux,dummy-virt (DT)
[   17.788442] Call trace:
[   17.788513]  show_stack+0x20/0x38 (C)
[   17.788775]  dump_stack_lvl+0x8c/0xd0
[   17.788943]  print_report+0x118/0x608
[   17.789103]  kasan_report_invalid_free+0xc0/0xe8
[   17.789231]  check_slab_allocation+0xd4/0x108
[   17.789457]  __kasan_slab_pre_free+0x2c/0x48
[   17.790331]  kfree+0xe8/0x3c8
[   17.790515]  kfree_sensitive+0x3c/0xb0
[   17.790643]  kmalloc_double_kzfree+0x168/0x308
[   17.790763]  kunit_try_run_case+0x170/0x3f0
[   17.790892]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   17.791024]  kthread+0x328/0x630
[   17.791136]  ret_from_fork+0x10/0x20
[   17.791257] 
[   17.791298] Allocated by task 192:
[   17.791376]  kasan_save_stack+0x3c/0x68
[   17.791469]  kasan_save_track+0x20/0x40
[   17.791550]  kasan_save_alloc_info+0x40/0x58
[   17.791643]  __kasan_kmalloc+0xd4/0xd8
[   17.791727]  __kmalloc_cache_noprof+0x15c/0x3c0
[   17.791818]  kmalloc_double_kzfree+0xb8/0x308
[   17.791906]  kunit_try_run_case+0x170/0x3f0
[   17.791989]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   17.792087]  kthread+0x328/0x630
[   17.792159]  ret_from_fork+0x10/0x20
[   17.792242] 
[   17.792285] Freed by task 192:
[   17.792781]  kasan_save_stack+0x3c/0x68
[   17.792931]  kasan_save_track+0x20/0x40
[   17.793027]  kasan_save_free_info+0x4c/0x78
[   17.793140]  __kasan_slab_free+0x6c/0x98
[   17.793277]  kfree+0x214/0x3c8
[   17.793383]  kfree_sensitive+0x80/0xb0
[   17.793495]  kmalloc_double_kzfree+0x11c/0x308
[   17.793568]  kunit_try_run_case+0x170/0x3f0
[   17.793840]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   17.794227]  kthread+0x328/0x630
[   17.794388]  ret_from_fork+0x10/0x20
[   17.794567] 
[   17.794624] The buggy address belongs to the object at fff00000c3eeb5c0
[   17.794624]  which belongs to the cache kmalloc-16 of size 16
[   17.795124] The buggy address is located 0 bytes inside of
[   17.795124]  16-byte region [fff00000c3eeb5c0, fff00000c3eeb5d0)
[   17.795508] 
[   17.795574] The buggy address belongs to the physical page:
[   17.795701] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x103eeb
[   17.795845] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   17.795963] page_type: f5(slab)
[   17.796139] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000
[   17.796697] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   17.796824] page dumped because: kasan: bad access detected
[   17.796908] 
[   17.796971] Memory state around the buggy address:
[   17.797094]  fff00000c3eeb480: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   17.797226]  fff00000c3eeb500: 00 04 fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   17.797331] >fff00000c3eeb580: fa fb fc fc fa fb fc fc fa fb fc fc fc fc fc fc
[   17.797437]                                            ^
[   17.797519]  fff00000c3eeb600: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   17.797632]  fff00000c3eeb680: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   17.797751] ==================================================================


[   11.339173] ==================================================================
[   11.339878] BUG: KASAN: double-free in kfree_sensitive+0x2e/0x90
[   11.340179] Free of addr ffff888101e62300 by task kunit_try_catch/210
[   11.340391] 
[   11.340473] CPU: 1 UID: 0 PID: 210 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-rc7-next-20250526 #1 PREEMPT(voluntary) 
[   11.340514] Tainted: [B]=BAD_PAGE, [N]=TEST
[   11.340526] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   11.340545] Call Trace:
[   11.340556]  <TASK>
[   11.340571]  dump_stack_lvl+0x73/0xb0
[   11.340596]  print_report+0xd1/0x650
[   11.340619]  ? __virt_addr_valid+0x1db/0x2d0
[   11.340641]  ? kasan_complete_mode_report_info+0x64/0x200
[   11.340662]  ? kfree_sensitive+0x2e/0x90
[   11.340683]  kasan_report_invalid_free+0x10a/0x130
[   11.340708]  ? kfree_sensitive+0x2e/0x90
[   11.340742]  ? kfree_sensitive+0x2e/0x90
[   11.340761]  check_slab_allocation+0x101/0x130
[   11.340783]  __kasan_slab_pre_free+0x28/0x40
[   11.340804]  kfree+0xf0/0x3f0
[   11.340821]  ? kfree_sensitive+0x2e/0x90
[   11.340843]  kfree_sensitive+0x2e/0x90
[   11.340863]  kmalloc_double_kzfree+0x19c/0x350
[   11.340886]  ? __pfx_kmalloc_double_kzfree+0x10/0x10
[   11.340909]  ? __schedule+0x10cc/0x2b60
[   11.340933]  ? __pfx_read_tsc+0x10/0x10
[   11.340954]  ? ktime_get_ts64+0x86/0x230
[   11.340978]  kunit_try_run_case+0x1a5/0x480
[   11.340998]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.341057]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   11.341082]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   11.341106]  ? __kthread_parkme+0x82/0x180
[   11.341126]  ? preempt_count_sub+0x50/0x80
[   11.341149]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.341169]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.341192]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   11.341216]  kthread+0x337/0x6f0
[   11.341234]  ? trace_preempt_on+0x20/0xc0
[   11.341258]  ? __pfx_kthread+0x10/0x10
[   11.341278]  ? _raw_spin_unlock_irq+0x47/0x80
[   11.341301]  ? calculate_sigpending+0x7b/0xa0
[   11.341324]  ? __pfx_kthread+0x10/0x10
[   11.341345]  ret_from_fork+0x116/0x1d0
[   11.341363]  ? __pfx_kthread+0x10/0x10
[   11.341395]  ret_from_fork_asm+0x1a/0x30
[   11.341425]  </TASK>
[   11.341434] 
[   11.349928] Allocated by task 210:
[   11.350101]  kasan_save_stack+0x45/0x70
[   11.350292]  kasan_save_track+0x18/0x40
[   11.350470]  kasan_save_alloc_info+0x3b/0x50
[   11.350619]  __kasan_kmalloc+0xb7/0xc0
[   11.350776]  __kmalloc_cache_noprof+0x189/0x420
[   11.350992]  kmalloc_double_kzfree+0xa9/0x350
[   11.351215]  kunit_try_run_case+0x1a5/0x480
[   11.351431]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.351623]  kthread+0x337/0x6f0
[   11.351876]  ret_from_fork+0x116/0x1d0
[   11.352071]  ret_from_fork_asm+0x1a/0x30
[   11.352238] 
[   11.352335] Freed by task 210:
[   11.352493]  kasan_save_stack+0x45/0x70
[   11.352664]  kasan_save_track+0x18/0x40
[   11.352872]  kasan_save_free_info+0x3f/0x60
[   11.353051]  __kasan_slab_free+0x56/0x70
[   11.353229]  kfree+0x222/0x3f0
[   11.353371]  kfree_sensitive+0x67/0x90
[   11.353514]  kmalloc_double_kzfree+0x12b/0x350
[   11.353667]  kunit_try_run_case+0x1a5/0x480
[   11.353864]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.354219]  kthread+0x337/0x6f0
[   11.354398]  ret_from_fork+0x116/0x1d0
[   11.354600]  ret_from_fork_asm+0x1a/0x30
[   11.354783] 
[   11.354854] The buggy address belongs to the object at ffff888101e62300
[   11.354854]  which belongs to the cache kmalloc-16 of size 16
[   11.355508] The buggy address is located 0 bytes inside of
[   11.355508]  16-byte region [ffff888101e62300, ffff888101e62310)
[   11.355878] 
[   11.355950] The buggy address belongs to the physical page:
[   11.356266] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x101e62
[   11.356632] flags: 0x200000000000000(node=0|zone=2)
[   11.356984] page_type: f5(slab)
[   11.357104] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000
[   11.357587] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   11.357908] page dumped because: kasan: bad access detected
[   11.358152] 
[   11.358222] Memory state around the buggy address:
[   11.358455]  ffff888101e62200: 00 06 fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   11.358780]  ffff888101e62280: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   11.359065] >ffff888101e62300: fa fb fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.359342]                    ^
[   11.359501]  ffff888101e62380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.359804]  ffff888101e62400: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.360084] ==================================================================