Hay
Date
Nov. 28, 2024, 2:36 a.m.

Environment
qemu-arm64
qemu-x86_64

[   29.682770] ==================================================================
[   29.684004] BUG: KASAN: invalid-free in kfree+0x270/0x3c8
[   29.684665] Free of addr fff00000c64e0001 by task kunit_try_catch/138
[   29.685950] 
[   29.686222] CPU: 1 UID: 0 PID: 138 Comm: kunit_try_catch Tainted: G    B            N 6.12.0-next-20241128 #1
[   29.687275] Tainted: [B]=BAD_PAGE, [N]=TEST
[   29.687871] Hardware name: linux,dummy-virt (DT)
[   29.688392] Call trace:
[   29.688851]  show_stack+0x20/0x38 (C)
[   29.689779]  dump_stack_lvl+0x8c/0xd0
[   29.690422]  print_report+0x118/0x5e0
[   29.691019]  kasan_report_invalid_free+0xb0/0xd8
[   29.691687]  __kasan_kfree_large+0x5c/0xa8
[   29.692375]  free_large_kmalloc+0x58/0x140
[   29.693041]  kfree+0x270/0x3c8
[   29.693563]  kmalloc_large_invalid_free+0x108/0x270
[   29.694214]  kunit_try_run_case+0x14c/0x3d0
[   29.694805]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   29.695709]  kthread+0x24c/0x2d0
[   29.696272]  ret_from_fork+0x10/0x20
[   29.696968] 
[   29.697511] The buggy address belongs to the physical page:
[   29.698090] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1064e0
[   29.699038] head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
[   29.699885] flags: 0xbfffe0000000040(head|node=0|zone=2|lastcpupid=0x1ffff)
[   29.700758] raw: 0bfffe0000000040 0000000000000000 dead000000000122 0000000000000000
[   29.701850] raw: 0000000000000000 0000000000000000 00000001ffffffff 0000000000000000
[   29.702744] head: 0bfffe0000000040 0000000000000000 dead000000000122 0000000000000000
[   29.703545] head: 0000000000000000 0000000000000000 00000001ffffffff 0000000000000000
[   29.704687] head: 0bfffe0000000002 ffffc1ffc3193801 ffffffffffffffff 0000000000000000
[   29.705773] head: 0000000000000004 0000000000000000 00000000ffffffff 0000000000000000
[   29.706404] page dumped because: kasan: bad access detected
[   29.707021] 
[   29.707869] Memory state around the buggy address:
[   29.708551]  fff00000c64dff00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   29.709733]  fff00000c64dff80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   29.710547] >fff00000c64e0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   29.711339]                    ^
[   29.711823]  fff00000c64e0080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   29.712632]  fff00000c64e0100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   29.713710] ==================================================================

[   20.433972] ==================================================================
[   20.435043] BUG: KASAN: invalid-free in kfree+0x271/0x3f0
[   20.435587] Free of addr ffff888102bb8001 by task kunit_try_catch/158
[   20.436257] 
[   20.436536] CPU: 0 UID: 0 PID: 158 Comm: kunit_try_catch Tainted: G    B            N 6.12.0-next-20241128 #1
[   20.437780] Tainted: [B]=BAD_PAGE, [N]=TEST
[   20.438186] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   20.438967] Call Trace:
[   20.439248]  <TASK>
[   20.439656]  dump_stack_lvl+0x73/0xb0
[   20.440110]  print_report+0xd1/0x640
[   20.440722]  ? __virt_addr_valid+0x1db/0x2d0
[   20.441147]  ? kfree+0x271/0x3f0
[   20.441617]  ? kasan_addr_to_slab+0x11/0xa0
[   20.442122]  ? kfree+0x271/0x3f0
[   20.442589]  kasan_report_invalid_free+0xc0/0xf0
[   20.443051]  ? kfree+0x271/0x3f0
[   20.443598]  ? kfree+0x271/0x3f0
[   20.443999]  __kasan_kfree_large+0x86/0xd0
[   20.444679]  free_large_kmalloc+0x3b/0xd0
[   20.445005]  kfree+0x271/0x3f0
[   20.446288]  kmalloc_large_invalid_free+0x121/0x2b0
[   20.446846]  ? __pfx_kmalloc_large_invalid_free+0x10/0x10
[   20.447391]  ? __schedule+0xc3e/0x2790
[   20.447794]  ? __pfx_read_tsc+0x10/0x10
[   20.448187]  ? ktime_get_ts64+0x84/0x230
[   20.448791]  kunit_try_run_case+0x1b3/0x490
[   20.449307]  ? __pfx_kunit_try_run_case+0x10/0x10
[   20.449871]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   20.450479]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   20.450991]  ? __kthread_parkme+0x82/0x160
[   20.451714]  ? preempt_count_sub+0x50/0x80
[   20.452108]  ? __pfx_kunit_try_run_case+0x10/0x10
[   20.452797]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   20.453393]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   20.453993]  kthread+0x257/0x310
[   20.454451]  ? __pfx_kthread+0x10/0x10
[   20.454873]  ret_from_fork+0x41/0x80
[   20.455518]  ? __pfx_kthread+0x10/0x10
[   20.455867]  ret_from_fork_asm+0x1a/0x30
[   20.456462]  </TASK>
[   20.456742] 
[   20.456897] The buggy address belongs to the physical page:
[   20.457682] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102bb8
[   20.458445] head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
[   20.459307] flags: 0x200000000000040(head|node=0|zone=2)
[   20.459826] raw: 0200000000000040 0000000000000000 dead000000000122 0000000000000000
[   20.460435] raw: 0000000000000000 0000000000000000 00000001ffffffff 0000000000000000
[   20.461215] head: 0200000000000040 0000000000000000 dead000000000122 0000000000000000
[   20.461765] head: 0000000000000000 0000000000000000 00000001ffffffff 0000000000000000
[   20.462666] head: 0200000000000002 ffffea00040aee01 ffffffffffffffff 0000000000000000
[   20.463448] head: 0000000000000004 0000000000000000 00000000ffffffff 0000000000000000
[   20.464368] page dumped because: kasan: bad access detected
[   20.464701] 
[   20.464943] Memory state around the buggy address:
[   20.465574]  ffff888102bb7f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   20.466362]  ffff888102bb7f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   20.466935] >ffff888102bb8000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   20.467695]                    ^
[   20.467994]  ffff888102bb8080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   20.468743]  ffff888102bb8100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   20.469603] ==================================================================