Hay
Date
Nov. 26, 2024, 6:09 a.m.

Environment
qemu-arm64
qemu-x86_64

[   31.794385] ==================================================================
[   31.795859] BUG: KASAN: slab-use-after-free in kmalloc_double_kzfree+0x168/0x308
[   31.796587] Read of size 1 at addr fff00000c599a880 by task kunit_try_catch/181
[   31.798088] 
[   31.798479] CPU: 1 UID: 0 PID: 181 Comm: kunit_try_catch Tainted: G    B            N 6.12.0-next-20241126 #1
[   31.799698] Tainted: [B]=BAD_PAGE, [N]=TEST
[   31.800299] Hardware name: linux,dummy-virt (DT)
[   31.800831] Call trace:
[   31.801500]  show_stack+0x20/0x38 (C)
[   31.802161]  dump_stack_lvl+0x8c/0xd0
[   31.802804]  print_report+0x118/0x5e0
[   31.803428]  kasan_report+0xc8/0x118
[   31.804067]  __kasan_check_byte+0x54/0x70
[   31.805021]  kfree_sensitive+0x30/0xb0
[   31.805635]  kmalloc_double_kzfree+0x168/0x308
[   31.806313]  kunit_try_run_case+0x14c/0x3d0
[   31.806969]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   31.807703]  kthread+0x24c/0x2d0
[   31.808190]  ret_from_fork+0x10/0x20
[   31.809130] 
[   31.809487] Allocated by task 181:
[   31.810040]  kasan_save_stack+0x3c/0x68
[   31.810612]  kasan_save_track+0x20/0x40
[   31.811209]  kasan_save_alloc_info+0x40/0x58
[   31.811875]  __kasan_kmalloc+0xd4/0xd8
[   31.812784]  __kmalloc_cache_noprof+0x15c/0x3c8
[   31.813379]  kmalloc_double_kzfree+0xb8/0x308
[   31.814044]  kunit_try_run_case+0x14c/0x3d0
[   31.814623]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   31.815350]  kthread+0x24c/0x2d0
[   31.815922]  ret_from_fork+0x10/0x20
[   31.816918] 
[   31.817257] Freed by task 181:
[   31.817665]  kasan_save_stack+0x3c/0x68
[   31.818288]  kasan_save_track+0x20/0x40
[   31.819687]  kasan_save_free_info+0x4c/0x78
[   31.820338]  __kasan_slab_free+0x6c/0x98
[   31.820969]  kfree+0x114/0x3d0
[   31.821478]  kfree_sensitive+0x80/0xb0
[   31.822264]  kmalloc_double_kzfree+0x11c/0x308
[   31.822993]  kunit_try_run_case+0x14c/0x3d0
[   31.823547]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   31.824229]  kthread+0x24c/0x2d0
[   31.825102]  ret_from_fork+0x10/0x20
[   31.825737] 
[   31.826157] The buggy address belongs to the object at fff00000c599a880
[   31.826157]  which belongs to the cache kmalloc-16 of size 16
[   31.827419] The buggy address is located 0 bytes inside of
[   31.827419]  freed 16-byte region [fff00000c599a880, fff00000c599a890)
[   31.828960] 
[   31.829328] The buggy address belongs to the physical page:
[   31.830084] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10599a
[   31.830848] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   31.831710] page_type: f5(slab)
[   31.832288] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000
[   31.833181] raw: 0000000000000000 0000000080800080 00000001f5000000 0000000000000000
[   31.834116] page dumped because: kasan: bad access detected
[   31.834814] 
[   31.835145] Memory state around the buggy address:
[   31.835858]  fff00000c599a780: 00 00 fc fc 00 00 fc fc fa fb fc fc fa fb fc fc
[   31.837189]  fff00000c599a800: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   31.838262] >fff00000c599a880: fa fb fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   31.839546]                    ^
[   31.840163]  fff00000c599a900: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   31.841312]  fff00000c599a980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   31.842320] ==================================================================

[   31.772015] ==================================================================
[   31.773614] BUG: KASAN: slab-use-after-free in kmalloc_double_kzfree+0x168/0x308
[   31.774856] Read of size 1 at addr fff00000c56f3820 by task kunit_try_catch/181
[   31.775619] 
[   31.776016] CPU: 0 UID: 0 PID: 181 Comm: kunit_try_catch Tainted: G    B            N 6.12.0-next-20241126 #1
[   31.777234] Tainted: [B]=BAD_PAGE, [N]=TEST
[   31.777703] Hardware name: linux,dummy-virt (DT)
[   31.778636] Call trace:
[   31.779083]  show_stack+0x20/0x38 (C)
[   31.780125]  dump_stack_lvl+0x8c/0xd0
[   31.780801]  print_report+0x118/0x5e0
[   31.781433]  kasan_report+0xc8/0x118
[   31.782690]  __kasan_check_byte+0x54/0x70
[   31.783246]  kfree_sensitive+0x30/0xb0
[   31.783868]  kmalloc_double_kzfree+0x168/0x308
[   31.784567]  kunit_try_run_case+0x14c/0x3d0
[   31.785198]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   31.786651]  kthread+0x24c/0x2d0
[   31.786930]  ret_from_fork+0x10/0x20
[   31.787198] 
[   31.787352] Allocated by task 181:
[   31.787890]  kasan_save_stack+0x3c/0x68
[   31.788415]  kasan_save_track+0x20/0x40
[   31.789087]  kasan_save_alloc_info+0x40/0x58
[   31.789656]  __kasan_kmalloc+0xd4/0xd8
[   31.790133]  __kmalloc_cache_noprof+0x15c/0x3c8
[   31.791623]  kmalloc_double_kzfree+0xb8/0x308
[   31.792355]  kunit_try_run_case+0x14c/0x3d0
[   31.793146]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   31.794202]  kthread+0x24c/0x2d0
[   31.794684]  ret_from_fork+0x10/0x20
[   31.795163] 
[   31.795542] Freed by task 181:
[   31.795972]  kasan_save_stack+0x3c/0x68
[   31.796606]  kasan_save_track+0x20/0x40
[   31.797222]  kasan_save_free_info+0x4c/0x78
[   31.797915]  __kasan_slab_free+0x6c/0x98
[   31.798558]  kfree+0x114/0x3d0
[   31.799066]  kfree_sensitive+0x80/0xb0
[   31.799599]  kmalloc_double_kzfree+0x11c/0x308
[   31.800513]  kunit_try_run_case+0x14c/0x3d0
[   31.801056]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   31.802682]  kthread+0x24c/0x2d0
[   31.803156]  ret_from_fork+0x10/0x20
[   31.803780] 
[   31.804145] The buggy address belongs to the object at fff00000c56f3820
[   31.804145]  which belongs to the cache kmalloc-16 of size 16
[   31.805430] The buggy address is located 0 bytes inside of
[   31.805430]  freed 16-byte region [fff00000c56f3820, fff00000c56f3830)
[   31.807056] 
[   31.807427] The buggy address belongs to the physical page:
[   31.808101] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1056f3
[   31.809386] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   31.811213] page_type: f5(slab)
[   31.811700] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000
[   31.812652] raw: 0000000000000000 0000000080800080 00000001f5000000 0000000000000000
[   31.813472] page dumped because: kasan: bad access detected
[   31.814241] 
[   31.814598] Memory state around the buggy address:
[   31.815276]  fff00000c56f3700: fa fb fc fc 00 02 fc fc fa fb fc fc fa fb fc fc
[   31.816051]  fff00000c56f3780: fa fb fc fc fa fb fc fc fa fb fc fc 00 04 fc fc
[   31.817304] >fff00000c56f3800: fa fb fc fc fa fb fc fc fc fc fc fc fc fc fc fc
[   31.819029]                                ^
[   31.819492]  fff00000c56f3880: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   31.820427]  fff00000c56f3900: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   31.821101] ==================================================================

[   25.925954] ==================================================================
[   25.926252] BUG: KASAN: slab-use-after-free in kmalloc_double_kzfree+0x19d/0x360
[   25.928323] Read of size 1 at addr ffff888101a468e0 by task kunit_try_catch/201
[   25.928323] 
[   25.928323] CPU: 0 UID: 0 PID: 201 Comm: kunit_try_catch Tainted: G    B            N 6.12.0-next-20241126 #1
[   25.928323] Tainted: [B]=BAD_PAGE, [N]=TEST
[   25.928323] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   25.928323] Call Trace:
[   25.928323]  <TASK>
[   25.928323]  dump_stack_lvl+0x73/0xb0
[   25.928323]  print_report+0xd1/0x640
[   25.928323]  ? __virt_addr_valid+0x1db/0x2d0
[   25.928323]  ? kasan_complete_mode_report_info+0x64/0x200
[   25.928323]  kasan_report+0x102/0x140
[   25.928323]  ? kmalloc_double_kzfree+0x19d/0x360
[   25.928323]  ? kmalloc_double_kzfree+0x19d/0x360
[   25.928323]  ? kmalloc_double_kzfree+0x19d/0x360
[   25.928323]  __kasan_check_byte+0x3d/0x50
[   25.928323]  kfree_sensitive+0x22/0x90
[   25.928323]  kmalloc_double_kzfree+0x19d/0x360
[   25.928323]  ? __pfx_kmalloc_double_kzfree+0x10/0x10
[   25.928323]  ? __pfx_kmalloc_double_kzfree+0x10/0x10
[   25.928323]  kunit_try_run_case+0x1b3/0x490
[   25.928323]  ? __pfx_kunit_try_run_case+0x10/0x10
[   25.928323]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   25.928323]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   25.928323]  ? __kthread_parkme+0x82/0x160
[   25.928323]  ? preempt_count_sub+0x50/0x80
[   25.928323]  ? __pfx_kunit_try_run_case+0x10/0x10
[   25.928323]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   25.928323]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   25.928323]  kthread+0x257/0x310
[   25.928323]  ? __pfx_kthread+0x10/0x10
[   25.928323]  ret_from_fork+0x41/0x80
[   25.928323]  ? __pfx_kthread+0x10/0x10
[   25.928323]  ret_from_fork_asm+0x1a/0x30
[   25.928323]  </TASK>
[   25.928323] 
[   25.928323] Allocated by task 201:
[   25.928323]  kasan_save_stack+0x3d/0x60
[   25.928323]  kasan_save_track+0x18/0x40
[   25.928323]  kasan_save_alloc_info+0x3b/0x50
[   25.928323]  __kasan_kmalloc+0xb7/0xc0
[   25.928323]  __kmalloc_cache_noprof+0x184/0x410
[   25.928323]  kmalloc_double_kzfree+0xaa/0x360
[   25.928323]  kunit_try_run_case+0x1b3/0x490
[   25.928323]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   25.928323]  kthread+0x257/0x310
[   25.928323]  ret_from_fork+0x41/0x80
[   25.928323]  ret_from_fork_asm+0x1a/0x30
[   25.928323] 
[   25.928323] Freed by task 201:
[   25.928323]  kasan_save_stack+0x3d/0x60
[   25.928323]  kasan_save_track+0x18/0x40
[   25.928323]  kasan_save_free_info+0x3f/0x60
[   25.928323]  __kasan_slab_free+0x56/0x70
[   25.928323]  kfree+0x123/0x3f0
[   25.928323]  kfree_sensitive+0x67/0x90
[   25.928323]  kmalloc_double_kzfree+0x12c/0x360
[   25.928323]  kunit_try_run_case+0x1b3/0x490
[   25.928323]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   25.928323]  kthread+0x257/0x310
[   25.928323]  ret_from_fork+0x41/0x80
[   25.928323]  ret_from_fork_asm+0x1a/0x30
[   25.928323] 
[   25.928323] The buggy address belongs to the object at ffff888101a468e0
[   25.928323]  which belongs to the cache kmalloc-16 of size 16
[   25.928323] The buggy address is located 0 bytes inside of
[   25.928323]  freed 16-byte region [ffff888101a468e0, ffff888101a468f0)
[   25.928323] 
[   25.928323] The buggy address belongs to the physical page:
[   25.928323] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x101a46
[   25.928323] flags: 0x200000000000000(node=0|zone=2)
[   25.928323] page_type: f5(slab)
[   25.928323] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000
[   25.928323] raw: 0000000000000000 0000000080800080 00000001f5000000 0000000000000000
[   25.928323] page dumped because: kasan: bad access detected
[   25.928323] 
[   25.928323] Memory state around the buggy address:
[   25.928323]  ffff888101a46780: 00 05 fc fc 00 05 fc fc 00 02 fc fc fa fb fc fc
[   25.928323]  ffff888101a46800: 00 05 fc fc fa fb fc fc 00 04 fc fc fa fb fc fc
[   25.928323] >ffff888101a46880: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   25.928323]                                                        ^
[   25.928323]  ffff888101a46900: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   25.928323]  ffff888101a46980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   25.928323] ==================================================================

[   20.944931] ==================================================================
[   20.945958] BUG: KASAN: slab-use-after-free in kmalloc_double_kzfree+0x19d/0x360
[   20.946464] Read of size 1 at addr ffff8881011ae2e0 by task kunit_try_catch/199
[   20.947109] 
[   20.947295] CPU: 1 UID: 0 PID: 199 Comm: kunit_try_catch Tainted: G    B            N 6.12.0-next-20241126 #1
[   20.948408] Tainted: [B]=BAD_PAGE, [N]=TEST
[   20.948893] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   20.949759] Call Trace:
[   20.950225]  <TASK>
[   20.950529]  dump_stack_lvl+0x73/0xb0
[   20.950949]  print_report+0xd1/0x640
[   20.951869]  ? __virt_addr_valid+0x1db/0x2d0
[   20.952438]  ? kasan_complete_mode_report_info+0x64/0x200
[   20.953123]  kasan_report+0x102/0x140
[   20.953572]  ? kmalloc_double_kzfree+0x19d/0x360
[   20.953958]  ? kmalloc_double_kzfree+0x19d/0x360
[   20.954332]  ? kmalloc_double_kzfree+0x19d/0x360
[   20.954841]  __kasan_check_byte+0x3d/0x50
[   20.955340]  kfree_sensitive+0x22/0x90
[   20.956093]  kmalloc_double_kzfree+0x19d/0x360
[   20.956542]  ? __pfx_kmalloc_double_kzfree+0x10/0x10
[   20.957405]  ? __schedule+0xc3e/0x2790
[   20.957917]  ? __pfx_read_tsc+0x10/0x10
[   20.958546]  ? ktime_get_ts64+0x84/0x230
[   20.959178]  kunit_try_run_case+0x1b3/0x490
[   20.959640]  ? __pfx_kunit_try_run_case+0x10/0x10
[   20.960269]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   20.960821]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   20.961429]  ? __kthread_parkme+0x82/0x160
[   20.961840]  ? preempt_count_sub+0x50/0x80
[   20.962741]  ? __pfx_kunit_try_run_case+0x10/0x10
[   20.963378]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   20.963895]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   20.964605]  kthread+0x257/0x310
[   20.964978]  ? __pfx_kthread+0x10/0x10
[   20.965386]  ret_from_fork+0x41/0x80
[   20.965823]  ? __pfx_kthread+0x10/0x10
[   20.966252]  ret_from_fork_asm+0x1a/0x30
[   20.966780]  </TASK>
[   20.967217] 
[   20.967420] Allocated by task 199:
[   20.967845]  kasan_save_stack+0x3d/0x60
[   20.968693]  kasan_save_track+0x18/0x40
[   20.969168]  kasan_save_alloc_info+0x3b/0x50
[   20.969524]  __kasan_kmalloc+0xb7/0xc0
[   20.970120]  __kmalloc_cache_noprof+0x184/0x410
[   20.970837]  kmalloc_double_kzfree+0xaa/0x360
[   20.971283]  kunit_try_run_case+0x1b3/0x490
[   20.972478]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   20.973538]  kthread+0x257/0x310
[   20.973898]  ret_from_fork+0x41/0x80
[   20.974221]  ret_from_fork_asm+0x1a/0x30
[   20.974899] 
[   20.975063] Freed by task 199:
[   20.975282]  kasan_save_stack+0x3d/0x60
[   20.976128]  kasan_save_track+0x18/0x40
[   20.976801]  kasan_save_free_info+0x3f/0x60
[   20.977308]  __kasan_slab_free+0x56/0x70
[   20.977742]  kfree+0x123/0x3f0
[   20.978028]  kfree_sensitive+0x67/0x90
[   20.978439]  kmalloc_double_kzfree+0x12c/0x360
[   20.979876]  kunit_try_run_case+0x1b3/0x490
[   20.980318]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   20.980906]  kthread+0x257/0x310
[   20.981563]  ret_from_fork+0x41/0x80
[   20.981988]  ret_from_fork_asm+0x1a/0x30
[   20.982433] 
[   20.982683] The buggy address belongs to the object at ffff8881011ae2e0
[   20.982683]  which belongs to the cache kmalloc-16 of size 16
[   20.984235] The buggy address is located 0 bytes inside of
[   20.984235]  freed 16-byte region [ffff8881011ae2e0, ffff8881011ae2f0)
[   20.986110] 
[   20.986368] The buggy address belongs to the physical page:
[   20.986883] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1011ae
[   20.987858] flags: 0x200000000000000(node=0|zone=2)
[   20.988440] page_type: f5(slab)
[   20.989219] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000
[   20.990124] raw: 0000000000000000 0000000080800080 00000001f5000000 0000000000000000
[   20.990815] page dumped because: kasan: bad access detected
[   20.991153] 
[   20.991306] Memory state around the buggy address:
[   20.992635]  ffff8881011ae180: fa fb fc fc 00 02 fc fc 00 05 fc fc 00 02 fc fc
[   20.993080]  ffff8881011ae200: 00 02 fc fc 00 02 fc fc 00 02 fc fc 00 05 fc fc
[   20.993971] >ffff8881011ae280: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   20.994524]                                                        ^
[   20.995396]  ffff8881011ae300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   20.995900]  ffff8881011ae380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   20.997002] ==================================================================