Hay
Date
Dec. 9, 2024, 6:35 a.m.

Environment
qemu-arm64
qemu-x86_64

[   23.342605] ==================================================================
[   23.344225] BUG: KASAN: invalid-free in kfree+0x270/0x3c8
[   23.344754] Free of addr fff00000c64a8001 by task kunit_try_catch/138
[   23.345310] 
[   23.345572] CPU: 0 UID: 0 PID: 138 Comm: kunit_try_catch Tainted: G    B            N 6.13.0-rc2-next-20241209 #1
[   23.348019] Tainted: [B]=BAD_PAGE, [N]=TEST
[   23.348555] Hardware name: linux,dummy-virt (DT)
[   23.349254] Call trace:
[   23.349773]  show_stack+0x20/0x38 (C)
[   23.350267]  dump_stack_lvl+0x8c/0xd0
[   23.350796]  print_report+0x118/0x5e0
[   23.351445]  kasan_report_invalid_free+0xb0/0xd8
[   23.352199]  __kasan_kfree_large+0x5c/0xa8
[   23.352869]  free_large_kmalloc+0x58/0x140
[   23.353403]  kfree+0x270/0x3c8
[   23.353917]  kmalloc_large_invalid_free+0x108/0x270
[   23.354532]  kunit_try_run_case+0x14c/0x3d0
[   23.355162]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   23.356138]  kthread+0x24c/0x2d0
[   23.356797]  ret_from_fork+0x10/0x20
[   23.357336] 
[   23.357728] The buggy address belongs to the physical page:
[   23.358355] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1064a8
[   23.359423] head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
[   23.360577] flags: 0xbfffe0000000040(head|node=0|zone=2|lastcpupid=0x1ffff)
[   23.361573] raw: 0bfffe0000000040 0000000000000000 dead000000000122 0000000000000000
[   23.362447] raw: 0000000000000000 0000000000000000 00000001ffffffff 0000000000000000
[   23.363820] head: 0bfffe0000000040 0000000000000000 dead000000000122 0000000000000000
[   23.364752] head: 0000000000000000 0000000000000000 00000001ffffffff 0000000000000000
[   23.365637] head: 0bfffe0000000002 ffffc1ffc3192a01 ffffffffffffffff 0000000000000000
[   23.366531] head: 0000000000000004 0000000000000000 00000000ffffffff 0000000000000000
[   23.367629] page dumped because: kasan: bad access detected
[   23.368190] 
[   23.368557] Memory state around the buggy address:
[   23.369364]  fff00000c64a7f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   23.370188]  fff00000c64a7f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   23.371020] >fff00000c64a8000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   23.372210]                    ^
[   23.372732]  fff00000c64a8080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   23.373446]  fff00000c64a8100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   23.374531] ==================================================================

[   22.979166] ==================================================================
[   22.980133] BUG: KASAN: invalid-free in kfree+0x271/0x3f0
[   22.981488] Free of addr ffff8881022e4001 by task kunit_try_catch/157
[   22.982719] 
[   22.983129] CPU: 0 UID: 0 PID: 157 Comm: kunit_try_catch Tainted: G    B            N 6.13.0-rc2-next-20241209 #1
[   22.984241] Tainted: [B]=BAD_PAGE, [N]=TEST
[   22.984736] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   22.985921] Call Trace:
[   22.986576]  <TASK>
[   22.987070]  dump_stack_lvl+0x73/0xb0
[   22.987970]  print_report+0xd1/0x640
[   22.989228]  ? __virt_addr_valid+0x1db/0x2d0
[   22.989676]  ? kfree+0x271/0x3f0
[   22.990457]  ? kasan_addr_to_slab+0x11/0xa0
[   22.991220]  ? kfree+0x271/0x3f0
[   22.991588]  kasan_report_invalid_free+0xc0/0xf0
[   22.992529]  ? kfree+0x271/0x3f0
[   22.993381]  ? kfree+0x271/0x3f0
[   22.994365]  __kasan_kfree_large+0x86/0xd0
[   22.994840]  free_large_kmalloc+0x3b/0xd0
[   22.995248]  kfree+0x271/0x3f0
[   22.995616]  kmalloc_large_invalid_free+0x121/0x2b0
[   22.996078]  ? __pfx_kmalloc_large_invalid_free+0x10/0x10
[   22.996624]  ? __schedule+0xc70/0x27e0
[   22.997477]  ? __pfx_read_tsc+0x10/0x10
[   22.998286]  ? ktime_get_ts64+0x86/0x230
[   22.998836]  kunit_try_run_case+0x1b3/0x490
[   22.999509]  ? __pfx_kunit_try_run_case+0x10/0x10
[   23.000365]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   23.001089]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   23.001602]  ? __kthread_parkme+0x82/0x160
[   23.001997]  ? preempt_count_sub+0x50/0x80
[   23.002941]  ? __pfx_kunit_try_run_case+0x10/0x10
[   23.003682]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   23.004526]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   23.005520]  kthread+0x257/0x310
[   23.005881]  ? __pfx_kthread+0x10/0x10
[   23.006735]  ret_from_fork+0x41/0x80
[   23.007364]  ? __pfx_kthread+0x10/0x10
[   23.008028]  ret_from_fork_asm+0x1a/0x30
[   23.008904]  </TASK>
[   23.009526] 
[   23.009684] The buggy address belongs to the physical page:
[   23.010738] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1022e4
[   23.012112] head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
[   23.013030] flags: 0x200000000000040(head|node=0|zone=2)
[   23.013739] raw: 0200000000000040 0000000000000000 dead000000000122 0000000000000000
[   23.014653] raw: 0000000000000000 0000000000000000 00000001ffffffff 0000000000000000
[   23.015278] head: 0200000000000040 0000000000000000 dead000000000122 0000000000000000
[   23.016090] head: 0000000000000000 0000000000000000 00000001ffffffff 0000000000000000
[   23.017046] head: 0200000000000002 ffffea000408b901 ffffffffffffffff 0000000000000000
[   23.018043] head: 0000000000000004 0000000000000000 00000000ffffffff 0000000000000000
[   23.018999] page dumped because: kasan: bad access detected
[   23.019729] 
[   23.020155] Memory state around the buggy address:
[   23.020913]  ffff8881022e3f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   23.021869]  ffff8881022e3f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   23.022657] >ffff8881022e4000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   23.023248]                    ^
[   23.023886]  ffff8881022e4080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   23.024738]  ffff8881022e4100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   23.025526] ==================================================================