Hay
Date
Dec. 3, 2024, 11:38 p.m.

Environment
qemu-arm64
qemu-x86_64

[   29.444262] ==================================================================
[   29.445516] BUG: KASAN: invalid-free in kfree+0x270/0x3c8
[   29.446195] Free of addr fff00000c62c4001 by task kunit_try_catch/139
[   29.446982] 
[   29.447440] CPU: 0 UID: 0 PID: 139 Comm: kunit_try_catch Tainted: G    B            N 6.13.0-rc1-next-20241203 #1
[   29.448918] Tainted: [B]=BAD_PAGE, [N]=TEST
[   29.450149] Hardware name: linux,dummy-virt (DT)
[   29.450932] Call trace:
[   29.451698]  show_stack+0x20/0x38 (C)
[   29.452280]  dump_stack_lvl+0x8c/0xd0
[   29.452906]  print_report+0x118/0x5e0
[   29.453612]  kasan_report_invalid_free+0xb0/0xd8
[   29.454263]  __kasan_kfree_large+0x5c/0xa8
[   29.454918]  free_large_kmalloc+0x58/0x140
[   29.455559]  kfree+0x270/0x3c8
[   29.456177]  kmalloc_large_invalid_free+0x108/0x270
[   29.456913]  kunit_try_run_case+0x14c/0x3d0
[   29.457952]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   29.458505]  kthread+0x24c/0x2d0
[   29.459028]  ret_from_fork+0x10/0x20
[   29.459571] 
[   29.460000] The buggy address belongs to the physical page:
[   29.460712] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1062c4
[   29.461905] head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
[   29.462803] flags: 0xbfffe0000000040(head|node=0|zone=2|lastcpupid=0x1ffff)
[   29.463765] raw: 0bfffe0000000040 0000000000000000 dead000000000122 0000000000000000
[   29.465160] raw: 0000000000000000 0000000000000000 00000001ffffffff 0000000000000000
[   29.466727] head: 0bfffe0000000040 0000000000000000 dead000000000122 0000000000000000
[   29.468374] head: 0000000000000000 0000000000000000 00000001ffffffff 0000000000000000
[   29.469427] head: 0bfffe0000000002 ffffc1ffc318b101 ffffffffffffffff 0000000000000000
[   29.470859] head: 0000000000000004 0000000000000000 00000000ffffffff 0000000000000000
[   29.472000] page dumped because: kasan: bad access detected
[   29.472506] 
[   29.472680] Memory state around the buggy address:
[   29.472990]  fff00000c62c3f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   29.473489]  fff00000c62c3f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   29.475346] >fff00000c62c4000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   29.476883]                    ^
[   29.477468]  fff00000c62c4080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   29.478520]  fff00000c62c4100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   29.479584] ==================================================================

[   25.057138] ==================================================================
[   25.057855] BUG: KASAN: invalid-free in kfree+0x271/0x3f0
[   25.059856] Free of addr ffff888102a38001 by task kunit_try_catch/159
[   25.060255] 
[   25.060787] CPU: 1 UID: 0 PID: 159 Comm: kunit_try_catch Tainted: G    B            N 6.13.0-rc1-next-20241203 #1
[   25.061633] Tainted: [B]=BAD_PAGE, [N]=TEST
[   25.062766] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   25.064084] Call Trace:
[   25.064323]  <TASK>
[   25.065155]  dump_stack_lvl+0x73/0xb0
[   25.065586]  print_report+0xd1/0x640
[   25.066184]  ? __virt_addr_valid+0x1db/0x2d0
[   25.066899]  ? kfree+0x271/0x3f0
[   25.067170]  ? kasan_addr_to_slab+0x11/0xa0
[   25.068227]  ? kfree+0x271/0x3f0
[   25.068496]  kasan_report_invalid_free+0xc0/0xf0
[   25.069005]  ? kfree+0x271/0x3f0
[   25.069822]  ? kfree+0x271/0x3f0
[   25.070106]  __kasan_kfree_large+0x86/0xd0
[   25.070585]  free_large_kmalloc+0x3b/0xd0
[   25.071015]  kfree+0x271/0x3f0
[   25.072042]  kmalloc_large_invalid_free+0x121/0x2b0
[   25.072629]  ? __pfx_kmalloc_large_invalid_free+0x10/0x10
[   25.073400]  ? __schedule+0xc3e/0x2790
[   25.074137]  ? __pfx_read_tsc+0x10/0x10
[   25.074474]  ? ktime_get_ts64+0x86/0x230
[   25.074953]  kunit_try_run_case+0x1b3/0x490
[   25.075264]  ? __pfx_kunit_try_run_case+0x10/0x10
[   25.076336]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   25.077042]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   25.077592]  ? __kthread_parkme+0x82/0x160
[   25.078149]  ? preempt_count_sub+0x50/0x80
[   25.079142]  ? __pfx_kunit_try_run_case+0x10/0x10
[   25.079754]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   25.080196]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   25.081207]  kthread+0x257/0x310
[   25.081515]  ? __pfx_kthread+0x10/0x10
[   25.082270]  ret_from_fork+0x41/0x80
[   25.082825]  ? __pfx_kthread+0x10/0x10
[   25.083173]  ret_from_fork_asm+0x1a/0x30
[   25.084321]  </TASK>
[   25.084528] 
[   25.084645] The buggy address belongs to the physical page:
[   25.085155] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102a38
[   25.085821] head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
[   25.086484] flags: 0x200000000000040(head|node=0|zone=2)
[   25.087482] raw: 0200000000000040 0000000000000000 dead000000000122 0000000000000000
[   25.088019] raw: 0000000000000000 0000000000000000 00000001ffffffff 0000000000000000
[   25.088726] head: 0200000000000040 0000000000000000 dead000000000122 0000000000000000
[   25.089856] head: 0000000000000000 0000000000000000 00000001ffffffff 0000000000000000
[   25.090536] head: 0200000000000002 ffffea00040a8e01 ffffffffffffffff 0000000000000000
[   25.091136] head: 0000000000000004 0000000000000000 00000000ffffffff 0000000000000000
[   25.091955] page dumped because: kasan: bad access detected
[   25.092896] 
[   25.093891] Memory state around the buggy address:
[   25.094277]  ffff888102a37f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   25.095157]  ffff888102a37f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   25.096005] >ffff888102a38000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   25.096452]                    ^
[   25.097807]  ffff888102a38080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   25.098275]  ffff888102a38100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   25.099526] ==================================================================