Hay
Date
July 3, 2025, 6:13 p.m.

Environment
qemu-arm64
qemu-x86_64

[   18.856535] ==================================================================
[   18.857118] BUG: KASAN: slab-use-after-free in mempool_uaf_helper+0x314/0x340
[   18.857174] Read of size 1 at addr fff00000c78d5240 by task kunit_try_catch/231
[   18.857379] 
[   18.857743] CPU: 0 UID: 0 PID: 231 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT 
[   18.857835] Tainted: [B]=BAD_PAGE, [N]=TEST
[   18.857862] Hardware name: linux,dummy-virt (DT)
[   18.858174] Call trace:
[   18.858369]  show_stack+0x20/0x38 (C)
[   18.858710]  dump_stack_lvl+0x8c/0xd0
[   18.858761]  print_report+0x118/0x608
[   18.859078]  kasan_report+0xdc/0x128
[   18.859162]  __asan_report_load1_noabort+0x20/0x30
[   18.859219]  mempool_uaf_helper+0x314/0x340
[   18.859266]  mempool_slab_uaf+0xc0/0x118
[   18.859312]  kunit_try_run_case+0x170/0x3f0
[   18.859358]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.859410]  kthread+0x328/0x630
[   18.859449]  ret_from_fork+0x10/0x20
[   18.860374] 
[   18.860489] Allocated by task 231:
[   18.860628]  kasan_save_stack+0x3c/0x68
[   18.860881]  kasan_save_track+0x20/0x40
[   18.861255]  kasan_save_alloc_info+0x40/0x58
[   18.861502]  __kasan_mempool_unpoison_object+0xbc/0x180
[   18.861550]  remove_element+0x16c/0x1f8
[   18.861590]  mempool_alloc_preallocated+0x58/0xc0
[   18.861630]  mempool_uaf_helper+0xa4/0x340
[   18.862126]  mempool_slab_uaf+0xc0/0x118
[   18.862506]  kunit_try_run_case+0x170/0x3f0
[   18.862858]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.862967]  kthread+0x328/0x630
[   18.863074]  ret_from_fork+0x10/0x20
[   18.863110] 
[   18.863286] Freed by task 231:
[   18.863403]  kasan_save_stack+0x3c/0x68
[   18.863641]  kasan_save_track+0x20/0x40
[   18.864045]  kasan_save_free_info+0x4c/0x78
[   18.864090]  __kasan_mempool_poison_object+0xc0/0x150
[   18.864131]  mempool_free+0x28c/0x328
[   18.864372]  mempool_uaf_helper+0x104/0x340
[   18.864800]  mempool_slab_uaf+0xc0/0x118
[   18.864876]  kunit_try_run_case+0x170/0x3f0
[   18.865039]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.865091]  kthread+0x328/0x630
[   18.865860]  ret_from_fork+0x10/0x20
[   18.865907] 
[   18.865929] The buggy address belongs to the object at fff00000c78d5240
[   18.865929]  which belongs to the cache test_cache of size 123
[   18.865988] The buggy address is located 0 bytes inside of
[   18.865988]  freed 123-byte region [fff00000c78d5240, fff00000c78d52bb)
[   18.866316] 
[   18.866342] The buggy address belongs to the physical page:
[   18.866371] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1078d5
[   18.867046] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   18.867388] page_type: f5(slab)
[   18.867562] raw: 0bfffe0000000000 fff00000c3eaedc0 dead000000000122 0000000000000000
[   18.867612] raw: 0000000000000000 0000000080150015 00000000f5000000 0000000000000000
[   18.867652] page dumped because: kasan: bad access detected
[   18.867787] 
[   18.867859] Memory state around the buggy address:
[   18.867890]  fff00000c78d5100: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   18.868433]  fff00000c78d5180: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   18.868537] >fff00000c78d5200: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb
[   18.868712]                                            ^
[   18.868923]  fff00000c78d5280: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   18.868970]  fff00000c78d5300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.869007] ==================================================================
[   18.800218] ==================================================================
[   18.800354] BUG: KASAN: slab-use-after-free in mempool_uaf_helper+0x314/0x340
[   18.800967] Read of size 1 at addr fff00000c78c1b00 by task kunit_try_catch/227
[   18.801021] 
[   18.801917] CPU: 0 UID: 0 PID: 227 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT 
[   18.802496] Tainted: [B]=BAD_PAGE, [N]=TEST
[   18.802527] Hardware name: linux,dummy-virt (DT)
[   18.802876] Call trace:
[   18.802911]  show_stack+0x20/0x38 (C)
[   18.803084]  dump_stack_lvl+0x8c/0xd0
[   18.803250]  print_report+0x118/0x608
[   18.803601]  kasan_report+0xdc/0x128
[   18.803880]  __asan_report_load1_noabort+0x20/0x30
[   18.804287]  mempool_uaf_helper+0x314/0x340
[   18.804737]  mempool_kmalloc_uaf+0xc4/0x120
[   18.804923]  kunit_try_run_case+0x170/0x3f0
[   18.805253]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.805313]  kthread+0x328/0x630
[   18.805356]  ret_from_fork+0x10/0x20
[   18.805669] 
[   18.806151] Allocated by task 227:
[   18.806188]  kasan_save_stack+0x3c/0x68
[   18.806232]  kasan_save_track+0x20/0x40
[   18.806269]  kasan_save_alloc_info+0x40/0x58
[   18.806308]  __kasan_mempool_unpoison_object+0x11c/0x180
[   18.806570]  remove_element+0x130/0x1f8
[   18.806763]  mempool_alloc_preallocated+0x58/0xc0
[   18.807248]  mempool_uaf_helper+0xa4/0x340
[   18.807298]  mempool_kmalloc_uaf+0xc4/0x120
[   18.807517]  kunit_try_run_case+0x170/0x3f0
[   18.807557]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.808044]  kthread+0x328/0x630
[   18.808088]  ret_from_fork+0x10/0x20
[   18.808124] 
[   18.808578] Freed by task 227:
[   18.808617]  kasan_save_stack+0x3c/0x68
[   18.808978]  kasan_save_track+0x20/0x40
[   18.809023]  kasan_save_free_info+0x4c/0x78
[   18.809236]  __kasan_mempool_poison_object+0xc0/0x150
[   18.809743]  mempool_free+0x28c/0x328
[   18.809829]  mempool_uaf_helper+0x104/0x340
[   18.809876]  mempool_kmalloc_uaf+0xc4/0x120
[   18.809914]  kunit_try_run_case+0x170/0x3f0
[   18.810169]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.810280]  kthread+0x328/0x630
[   18.810459]  ret_from_fork+0x10/0x20
[   18.810796] 
[   18.810946] The buggy address belongs to the object at fff00000c78c1b00
[   18.810946]  which belongs to the cache kmalloc-128 of size 128
[   18.811211] The buggy address is located 0 bytes inside of
[   18.811211]  freed 128-byte region [fff00000c78c1b00, fff00000c78c1b80)
[   18.811438] 
[   18.811623] The buggy address belongs to the physical page:
[   18.811661] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1078c1
[   18.812005] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   18.812246] page_type: f5(slab)
[   18.812723] raw: 0bfffe0000000000 fff00000c0001a00 dead000000000122 0000000000000000
[   18.812780] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   18.812822] page dumped because: kasan: bad access detected
[   18.813087] 
[   18.813109] Memory state around the buggy address:
[   18.813359]  fff00000c78c1a00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   18.813406]  fff00000c78c1a80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.813751] >fff00000c78c1b00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   18.813809]                    ^
[   18.813838]  fff00000c78c1b80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.814154]  fff00000c78c1c00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   18.814261] ==================================================================

[   12.938768] ==================================================================
[   12.939281] BUG: KASAN: slab-use-after-free in mempool_uaf_helper+0x392/0x400
[   12.939678] Read of size 1 at addr ffff888103328f00 by task kunit_try_catch/245
[   12.939965] 
[   12.940130] CPU: 1 UID: 0 PID: 245 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT(voluntary) 
[   12.940194] Tainted: [B]=BAD_PAGE, [N]=TEST
[   12.940208] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   12.940230] Call Trace:
[   12.940243]  <TASK>
[   12.940260]  dump_stack_lvl+0x73/0xb0
[   12.940289]  print_report+0xd1/0x650
[   12.940331]  ? __virt_addr_valid+0x1db/0x2d0
[   12.940356]  ? mempool_uaf_helper+0x392/0x400
[   12.940389]  ? kasan_complete_mode_report_info+0x64/0x200
[   12.940411]  ? mempool_uaf_helper+0x392/0x400
[   12.940432]  kasan_report+0x141/0x180
[   12.940465]  ? mempool_uaf_helper+0x392/0x400
[   12.940491]  __asan_report_load1_noabort+0x18/0x20
[   12.940515]  mempool_uaf_helper+0x392/0x400
[   12.940536]  ? __pfx_mempool_uaf_helper+0x10/0x10
[   12.940562]  ? finish_task_switch.isra.0+0x153/0x700
[   12.940590]  mempool_kmalloc_uaf+0xef/0x140
[   12.940612]  ? __pfx_mempool_kmalloc_uaf+0x10/0x10
[   12.940637]  ? __pfx_mempool_kmalloc+0x10/0x10
[   12.940661]  ? __pfx_mempool_kfree+0x10/0x10
[   12.940686]  ? __pfx_read_tsc+0x10/0x10
[   12.940707]  ? ktime_get_ts64+0x86/0x230
[   12.940732]  kunit_try_run_case+0x1a5/0x480
[   12.940757]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.940789]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   12.940813]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   12.940836]  ? __kthread_parkme+0x82/0x180
[   12.940868]  ? preempt_count_sub+0x50/0x80
[   12.940891]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.940914]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.940936]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   12.940959]  kthread+0x337/0x6f0
[   12.940979]  ? trace_preempt_on+0x20/0xc0
[   12.941008]  ? __pfx_kthread+0x10/0x10
[   12.941029]  ? _raw_spin_unlock_irq+0x47/0x80
[   12.941050]  ? calculate_sigpending+0x7b/0xa0
[   12.941075]  ? __pfx_kthread+0x10/0x10
[   12.941097]  ret_from_fork+0x116/0x1d0
[   12.941123]  ? __pfx_kthread+0x10/0x10
[   12.941144]  ret_from_fork_asm+0x1a/0x30
[   12.941174]  </TASK>
[   12.941186] 
[   12.949004] Allocated by task 245:
[   12.949206]  kasan_save_stack+0x45/0x70
[   12.949433]  kasan_save_track+0x18/0x40
[   12.949621]  kasan_save_alloc_info+0x3b/0x50
[   12.949790]  __kasan_mempool_unpoison_object+0x1a9/0x200
[   12.950054]  remove_element+0x11e/0x190
[   12.950249]  mempool_alloc_preallocated+0x4d/0x90
[   12.950478]  mempool_uaf_helper+0x96/0x400
[   12.950669]  mempool_kmalloc_uaf+0xef/0x140
[   12.950895]  kunit_try_run_case+0x1a5/0x480
[   12.951118]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.951387]  kthread+0x337/0x6f0
[   12.951573]  ret_from_fork+0x116/0x1d0
[   12.951776]  ret_from_fork_asm+0x1a/0x30
[   12.951973] 
[   12.952065] Freed by task 245:
[   12.952217]  kasan_save_stack+0x45/0x70
[   12.952383]  kasan_save_track+0x18/0x40
[   12.952521]  kasan_save_free_info+0x3f/0x60
[   12.952670]  __kasan_mempool_poison_object+0x131/0x1d0
[   12.952904]  mempool_free+0x2ec/0x380
[   12.953118]  mempool_uaf_helper+0x11a/0x400
[   12.953340]  mempool_kmalloc_uaf+0xef/0x140
[   12.953551]  kunit_try_run_case+0x1a5/0x480
[   12.953719]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.953895]  kthread+0x337/0x6f0
[   12.954018]  ret_from_fork+0x116/0x1d0
[   12.954183]  ret_from_fork_asm+0x1a/0x30
[   12.954413] 
[   12.954531] The buggy address belongs to the object at ffff888103328f00
[   12.954531]  which belongs to the cache kmalloc-128 of size 128
[   12.955092] The buggy address is located 0 bytes inside of
[   12.955092]  freed 128-byte region [ffff888103328f00, ffff888103328f80)
[   12.955657] 
[   12.955743] The buggy address belongs to the physical page:
[   12.955992] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x103328
[   12.956344] flags: 0x200000000000000(node=0|zone=2)
[   12.956540] page_type: f5(slab)
[   12.956713] raw: 0200000000000000 ffff888100041a00 dead000000000122 0000000000000000
[   12.957012] raw: 0000000000000000 0000000000100010 00000000f5000000 0000000000000000
[   12.957429] page dumped because: kasan: bad access detected
[   12.957670] 
[   12.957777] Memory state around the buggy address:
[   12.957961]  ffff888103328e00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   12.958211]  ffff888103328e80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.958562] >ffff888103328f00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   12.958877]                    ^
[   12.959006]  ffff888103328f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.959358]  ffff888103329000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   12.959687] ==================================================================
[   12.994644] ==================================================================
[   12.995687] BUG: KASAN: slab-use-after-free in mempool_uaf_helper+0x392/0x400
[   12.995995] Read of size 1 at addr ffff88810334b240 by task kunit_try_catch/249
[   12.996256] 
[   12.996472] CPU: 1 UID: 0 PID: 249 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT(voluntary) 
[   12.996516] Tainted: [B]=BAD_PAGE, [N]=TEST
[   12.996529] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   12.996550] Call Trace:
[   12.996562]  <TASK>
[   12.996578]  dump_stack_lvl+0x73/0xb0
[   12.996609]  print_report+0xd1/0x650
[   12.996634]  ? __virt_addr_valid+0x1db/0x2d0
[   12.996658]  ? mempool_uaf_helper+0x392/0x400
[   12.996679]  ? kasan_complete_mode_report_info+0x64/0x200
[   12.996700]  ? mempool_uaf_helper+0x392/0x400
[   12.996722]  kasan_report+0x141/0x180
[   12.996743]  ? mempool_uaf_helper+0x392/0x400
[   12.996769]  __asan_report_load1_noabort+0x18/0x20
[   12.996793]  mempool_uaf_helper+0x392/0x400
[   12.996816]  ? __pfx_mempool_uaf_helper+0x10/0x10
[   12.996840]  ? __pfx_sched_clock_cpu+0x10/0x10
[   12.996863]  ? finish_task_switch.isra.0+0x153/0x700
[   12.996889]  mempool_slab_uaf+0xea/0x140
[   12.996912]  ? __pfx_mempool_slab_uaf+0x10/0x10
[   12.996936]  ? __pfx_mempool_alloc_slab+0x10/0x10
[   12.996956]  ? __pfx_mempool_free_slab+0x10/0x10
[   12.996978]  ? __pfx_read_tsc+0x10/0x10
[   12.997000]  ? ktime_get_ts64+0x86/0x230
[   12.997023]  kunit_try_run_case+0x1a5/0x480
[   12.997049]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.997071]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   12.997094]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   12.997129]  ? __kthread_parkme+0x82/0x180
[   12.997150]  ? preempt_count_sub+0x50/0x80
[   12.997207]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.997230]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.997252]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   12.997275]  kthread+0x337/0x6f0
[   12.997293]  ? trace_preempt_on+0x20/0xc0
[   12.997321]  ? __pfx_kthread+0x10/0x10
[   12.997342]  ? _raw_spin_unlock_irq+0x47/0x80
[   12.997362]  ? calculate_sigpending+0x7b/0xa0
[   12.997386]  ? __pfx_kthread+0x10/0x10
[   12.997407]  ret_from_fork+0x116/0x1d0
[   12.997424]  ? __pfx_kthread+0x10/0x10
[   12.997444]  ret_from_fork_asm+0x1a/0x30
[   12.997475]  </TASK>
[   12.997486] 
[   13.012840] Allocated by task 249:
[   13.013036]  kasan_save_stack+0x45/0x70
[   13.013330]  kasan_save_track+0x18/0x40
[   13.013740]  kasan_save_alloc_info+0x3b/0x50
[   13.014143]  __kasan_mempool_unpoison_object+0x1bb/0x200
[   13.014531]  remove_element+0x11e/0x190
[   13.014876]  mempool_alloc_preallocated+0x4d/0x90
[   13.015035]  mempool_uaf_helper+0x96/0x400
[   13.015307]  mempool_slab_uaf+0xea/0x140
[   13.015758]  kunit_try_run_case+0x1a5/0x480
[   13.016223]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.016757]  kthread+0x337/0x6f0
[   13.017071]  ret_from_fork+0x116/0x1d0
[   13.017340]  ret_from_fork_asm+0x1a/0x30
[   13.017483] 
[   13.017555] Freed by task 249:
[   13.017670]  kasan_save_stack+0x45/0x70
[   13.017807]  kasan_save_track+0x18/0x40
[   13.017944]  kasan_save_free_info+0x3f/0x60
[   13.018091]  __kasan_mempool_poison_object+0x131/0x1d0
[   13.018543]  mempool_free+0x2ec/0x380
[   13.018867]  mempool_uaf_helper+0x11a/0x400
[   13.019299]  mempool_slab_uaf+0xea/0x140
[   13.019743]  kunit_try_run_case+0x1a5/0x480
[   13.020140]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.020745]  kthread+0x337/0x6f0
[   13.021062]  ret_from_fork+0x116/0x1d0
[   13.021444]  ret_from_fork_asm+0x1a/0x30
[   13.021905] 
[   13.022143] The buggy address belongs to the object at ffff88810334b240
[   13.022143]  which belongs to the cache test_cache of size 123
[   13.023424] The buggy address is located 0 bytes inside of
[   13.023424]  freed 123-byte region [ffff88810334b240, ffff88810334b2bb)
[   13.024010] 
[   13.024088] The buggy address belongs to the physical page:
[   13.024552] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10334b
[   13.025533] flags: 0x200000000000000(node=0|zone=2)
[   13.025975] page_type: f5(slab)
[   13.026387] raw: 0200000000000000 ffff888101849a00 dead000000000122 0000000000000000
[   13.026935] raw: 0000000000000000 0000000080150015 00000000f5000000 0000000000000000
[   13.027277] page dumped because: kasan: bad access detected
[   13.027867] 
[   13.028081] Memory state around the buggy address:
[   13.028619]  ffff88810334b100: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   13.029326]  ffff88810334b180: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   13.029576] >ffff88810334b200: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb
[   13.029793]                                            ^
[   13.029963]  ffff88810334b280: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   13.030197]  ffff88810334b300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.030644] ==================================================================