Hay
Date
May 29, 2025, 7:10 a.m.

Environment
qemu-arm64
qemu-x86_64

[   24.169725] ==================================================================
[   24.170018] BUG: KASAN: slab-use-after-free in mempool_uaf_helper+0x314/0x340
[   24.170649] Read of size 1 at addr fff00000c66ad300 by task kunit_try_catch/227
[   24.170759] 
[   24.170858] CPU: 0 UID: 0 PID: 227 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-next-20250529 #1 PREEMPT 
[   24.171072] Tainted: [B]=BAD_PAGE, [N]=TEST
[   24.171147] Hardware name: linux,dummy-virt (DT)
[   24.171233] Call trace:
[   24.171346]  show_stack+0x20/0x38 (C)
[   24.172017]  dump_stack_lvl+0x8c/0xd0
[   24.172535]  print_report+0x118/0x608
[   24.172741]  kasan_report+0xdc/0x128
[   24.172987]  __asan_report_load1_noabort+0x20/0x30
[   24.173610]  mempool_uaf_helper+0x314/0x340
[   24.173781]  mempool_kmalloc_uaf+0xc4/0x120
[   24.174004]  kunit_try_run_case+0x170/0x3f0
[   24.174206]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   24.174348]  kthread+0x328/0x630
[   24.174928]  ret_from_fork+0x10/0x20
[   24.175175] 
[   24.175255] Allocated by task 227:
[   24.175435]  kasan_save_stack+0x3c/0x68
[   24.175735]  kasan_save_track+0x20/0x40
[   24.175823]  kasan_save_alloc_info+0x40/0x58
[   24.175908]  __kasan_mempool_unpoison_object+0x11c/0x180
[   24.176014]  remove_element+0x130/0x1f8
[   24.176474]  mempool_alloc_preallocated+0x58/0xc0
[   24.176675]  mempool_uaf_helper+0xa4/0x340
[   24.176913]  mempool_kmalloc_uaf+0xc4/0x120
[   24.177026]  kunit_try_run_case+0x170/0x3f0
[   24.177126]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   24.177727]  kthread+0x328/0x630
[   24.177854]  ret_from_fork+0x10/0x20
[   24.178039] 
[   24.178114] Freed by task 227:
[   24.178371]  kasan_save_stack+0x3c/0x68
[   24.178762]  kasan_save_track+0x20/0x40
[   24.178910]  kasan_save_free_info+0x4c/0x78
[   24.179009]  __kasan_mempool_poison_object+0xc0/0x150
[   24.179104]  mempool_free+0x28c/0x328
[   24.179170]  mempool_uaf_helper+0x104/0x340
[   24.179240]  mempool_kmalloc_uaf+0xc4/0x120
[   24.180944]  kunit_try_run_case+0x170/0x3f0
[   24.183435]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   24.183690]  kthread+0x328/0x630
[   24.183753]  ret_from_fork+0x10/0x20
[   24.183834] 
[   24.183867] The buggy address belongs to the object at fff00000c66ad300
[   24.183867]  which belongs to the cache kmalloc-128 of size 128
[   24.183943] The buggy address is located 0 bytes inside of
[   24.183943]  freed 128-byte region [fff00000c66ad300, fff00000c66ad380)
[   24.184059] 
[   24.184087] The buggy address belongs to the physical page:
[   24.184126] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1066ad
[   24.184191] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   24.184252] page_type: f5(slab)
[   24.184302] raw: 0bfffe0000000000 fff00000c0001a00 dead000000000122 0000000000000000
[   24.184360] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   24.184426] page dumped because: kasan: bad access detected
[   24.184465] 
[   24.184486] Memory state around the buggy address:
[   24.184524]  fff00000c66ad200: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   24.184573]  fff00000c66ad280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   24.184620] >fff00000c66ad300: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   24.184662]                    ^
[   24.184695]  fff00000c66ad380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   24.184741]  fff00000c66ad400: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   24.184784] ==================================================================
[   24.244827] ==================================================================
[   24.245031] BUG: KASAN: slab-use-after-free in mempool_uaf_helper+0x314/0x340
[   24.245182] Read of size 1 at addr fff00000c63de240 by task kunit_try_catch/231
[   24.245293] 
[   24.245382] CPU: 0 UID: 0 PID: 231 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-next-20250529 #1 PREEMPT 
[   24.245822] Tainted: [B]=BAD_PAGE, [N]=TEST
[   24.246005] Hardware name: linux,dummy-virt (DT)
[   24.246094] Call trace:
[   24.246194]  show_stack+0x20/0x38 (C)
[   24.246382]  dump_stack_lvl+0x8c/0xd0
[   24.246477]  print_report+0x118/0x608
[   24.246538]  kasan_report+0xdc/0x128
[   24.246619]  __asan_report_load1_noabort+0x20/0x30
[   24.246678]  mempool_uaf_helper+0x314/0x340
[   24.246729]  mempool_slab_uaf+0xc0/0x118
[   24.246781]  kunit_try_run_case+0x170/0x3f0
[   24.246863]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   24.246925]  kthread+0x328/0x630
[   24.246975]  ret_from_fork+0x10/0x20
[   24.247034] 
[   24.247059] Allocated by task 231:
[   24.247095]  kasan_save_stack+0x3c/0x68
[   24.247148]  kasan_save_track+0x20/0x40
[   24.247191]  kasan_save_alloc_info+0x40/0x58
[   24.247233]  __kasan_mempool_unpoison_object+0xbc/0x180
[   24.247281]  remove_element+0x16c/0x1f8
[   24.247324]  mempool_alloc_preallocated+0x58/0xc0
[   24.247368]  mempool_uaf_helper+0xa4/0x340
[   24.247446]  mempool_slab_uaf+0xc0/0x118
[   24.247550]  kunit_try_run_case+0x170/0x3f0
[   24.247630]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   24.247714]  kthread+0x328/0x630
[   24.247788]  ret_from_fork+0x10/0x20
[   24.247871] 
[   24.247932] Freed by task 231:
[   24.248024]  kasan_save_stack+0x3c/0x68
[   24.248174]  kasan_save_track+0x20/0x40
[   24.248311]  kasan_save_free_info+0x4c/0x78
[   24.248427]  __kasan_mempool_poison_object+0xc0/0x150
[   24.248538]  mempool_free+0x28c/0x328
[   24.248637]  mempool_uaf_helper+0x104/0x340
[   24.248771]  mempool_slab_uaf+0xc0/0x118
[   24.248883]  kunit_try_run_case+0x170/0x3f0
[   24.249002]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   24.249153]  kthread+0x328/0x630
[   24.249247]  ret_from_fork+0x10/0x20
[   24.249351] 
[   24.249423] The buggy address belongs to the object at fff00000c63de240
[   24.249423]  which belongs to the cache test_cache of size 123
[   24.249561] The buggy address is located 0 bytes inside of
[   24.249561]  freed 123-byte region [fff00000c63de240, fff00000c63de2bb)
[   24.249720] 
[   24.249773] The buggy address belongs to the physical page:
[   24.250437] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1063de
[   24.251124] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   24.251303] page_type: f5(slab)
[   24.251416] raw: 0bfffe0000000000 fff00000c63dc000 dead000000000122 0000000000000000
[   24.251760] raw: 0000000000000000 0000000080150015 00000000f5000000 0000000000000000
[   24.251845] page dumped because: kasan: bad access detected
[   24.251918] 
[   24.251960] Memory state around the buggy address:
[   24.252040]  fff00000c63de100: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   24.252176]  fff00000c63de180: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   24.252277] >fff00000c63de200: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb
[   24.252752]                                            ^
[   24.252885]  fff00000c63de280: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   24.253006]  fff00000c63de300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   24.253115] ==================================================================


[   12.425457] ==================================================================
[   12.426331] BUG: KASAN: slab-use-after-free in mempool_uaf_helper+0x392/0x400
[   12.426582] Read of size 1 at addr ffff8881028b4240 by task kunit_try_catch/248
[   12.426837] 
[   12.427056] CPU: 1 UID: 0 PID: 248 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-next-20250529 #1 PREEMPT(voluntary) 
[   12.427107] Tainted: [B]=BAD_PAGE, [N]=TEST
[   12.427120] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   12.427143] Call Trace:
[   12.427154]  <TASK>
[   12.427170]  dump_stack_lvl+0x73/0xb0
[   12.427198]  print_report+0xd1/0x650
[   12.427220]  ? __virt_addr_valid+0x1db/0x2d0
[   12.427243]  ? mempool_uaf_helper+0x392/0x400
[   12.427266]  ? kasan_complete_mode_report_info+0x64/0x200
[   12.427289]  ? mempool_uaf_helper+0x392/0x400
[   12.427313]  kasan_report+0x141/0x180
[   12.427335]  ? mempool_uaf_helper+0x392/0x400
[   12.427363]  __asan_report_load1_noabort+0x18/0x20
[   12.427384]  mempool_uaf_helper+0x392/0x400
[   12.427407]  ? __pfx_mempool_uaf_helper+0x10/0x10
[   12.427433]  ? __pfx_sched_clock_cpu+0x10/0x10
[   12.427455]  ? finish_task_switch.isra.0+0x153/0x700
[   12.427482]  mempool_slab_uaf+0xea/0x140
[   12.427501]  ? __pfx_mempool_slab_uaf+0x10/0x10
[   12.427523]  ? __pfx_mempool_alloc_slab+0x10/0x10
[   12.427543]  ? __pfx_mempool_free_slab+0x10/0x10
[   12.427565]  ? __pfx_read_tsc+0x10/0x10
[   12.427587]  ? ktime_get_ts64+0x86/0x230
[   12.427623]  kunit_try_run_case+0x1a5/0x480
[   12.427645]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.427664]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   12.427689]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   12.427713]  ? __kthread_parkme+0x82/0x180
[   12.427734]  ? preempt_count_sub+0x50/0x80
[   12.427805]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.427828]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.427853]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   12.427878]  kthread+0x337/0x6f0
[   12.427898]  ? trace_preempt_on+0x20/0xc0
[   12.427920]  ? __pfx_kthread+0x10/0x10
[   12.427941]  ? _raw_spin_unlock_irq+0x47/0x80
[   12.428161]  ? calculate_sigpending+0x7b/0xa0
[   12.428194]  ? __pfx_kthread+0x10/0x10
[   12.428216]  ret_from_fork+0x116/0x1d0
[   12.428235]  ? __pfx_kthread+0x10/0x10
[   12.428256]  ret_from_fork_asm+0x1a/0x30
[   12.428287]  </TASK>
[   12.428298] 
[   12.443951] Allocated by task 248:
[   12.444295]  kasan_save_stack+0x45/0x70
[   12.444701]  kasan_save_track+0x18/0x40
[   12.445170]  kasan_save_alloc_info+0x3b/0x50
[   12.445480]  __kasan_mempool_unpoison_object+0x1bb/0x200
[   12.445680]  remove_element+0x11e/0x190
[   12.446032]  mempool_alloc_preallocated+0x4d/0x90
[   12.446485]  mempool_uaf_helper+0x96/0x400
[   12.446892]  mempool_slab_uaf+0xea/0x140
[   12.447352]  kunit_try_run_case+0x1a5/0x480
[   12.447917]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.448123]  kthread+0x337/0x6f0
[   12.448250]  ret_from_fork+0x116/0x1d0
[   12.448387]  ret_from_fork_asm+0x1a/0x30
[   12.448531] 
[   12.448603] Freed by task 248:
[   12.448739]  kasan_save_stack+0x45/0x70
[   12.448894]  kasan_save_track+0x18/0x40
[   12.449136]  kasan_save_free_info+0x3f/0x60
[   12.449335]  __kasan_mempool_poison_object+0x131/0x1d0
[   12.449553]  mempool_free+0x2ec/0x380
[   12.449758]  mempool_uaf_helper+0x11a/0x400
[   12.449997]  mempool_slab_uaf+0xea/0x140
[   12.450195]  kunit_try_run_case+0x1a5/0x480
[   12.450344]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.450590]  kthread+0x337/0x6f0
[   12.450836]  ret_from_fork+0x116/0x1d0
[   12.451318]  ret_from_fork_asm+0x1a/0x30
[   12.451509] 
[   12.451629] The buggy address belongs to the object at ffff8881028b4240
[   12.451629]  which belongs to the cache test_cache of size 123
[   12.452476] The buggy address is located 0 bytes inside of
[   12.452476]  freed 123-byte region [ffff8881028b4240, ffff8881028b42bb)
[   12.452999] 
[   12.453248] The buggy address belongs to the physical page:
[   12.453499] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1028b4
[   12.454091] flags: 0x200000000000000(node=0|zone=2)
[   12.454423] page_type: f5(slab)
[   12.454561] raw: 0200000000000000 ffff8881028a7500 dead000000000122 0000000000000000
[   12.455154] raw: 0000000000000000 0000000080150015 00000000f5000000 0000000000000000
[   12.455645] page dumped because: kasan: bad access detected
[   12.456102] 
[   12.456209] Memory state around the buggy address:
[   12.456625]  ffff8881028b4100: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   12.457241]  ffff8881028b4180: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   12.457564] >ffff8881028b4200: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb
[   12.458085]                                            ^
[   12.458398]  ffff8881028b4280: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   12.458832]  ffff8881028b4300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.459411] ==================================================================
[   12.355807] ==================================================================
[   12.356482] BUG: KASAN: slab-use-after-free in mempool_uaf_helper+0x392/0x400
[   12.356745] Read of size 1 at addr ffff8881028b1000 by task kunit_try_catch/244
[   12.357426] 
[   12.357861] CPU: 1 UID: 0 PID: 244 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-next-20250529 #1 PREEMPT(voluntary) 
[   12.357915] Tainted: [B]=BAD_PAGE, [N]=TEST
[   12.357929] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   12.357951] Call Trace:
[   12.357964]  <TASK>
[   12.357980]  dump_stack_lvl+0x73/0xb0
[   12.358010]  print_report+0xd1/0x650
[   12.358033]  ? __virt_addr_valid+0x1db/0x2d0
[   12.358057]  ? mempool_uaf_helper+0x392/0x400
[   12.358079]  ? kasan_complete_mode_report_info+0x64/0x200
[   12.358330]  ? mempool_uaf_helper+0x392/0x400
[   12.358356]  kasan_report+0x141/0x180
[   12.358380]  ? mempool_uaf_helper+0x392/0x400
[   12.358408]  __asan_report_load1_noabort+0x18/0x20
[   12.358429]  mempool_uaf_helper+0x392/0x400
[   12.358461]  ? __pfx_mempool_uaf_helper+0x10/0x10
[   12.358485]  ? __kasan_check_write+0x18/0x20
[   12.358506]  ? __pfx_sched_clock_cpu+0x10/0x10
[   12.358531]  ? finish_task_switch.isra.0+0x153/0x700
[   12.358566]  mempool_kmalloc_uaf+0xef/0x140
[   12.358592]  ? __pfx_mempool_kmalloc_uaf+0x10/0x10
[   12.358628]  ? __pfx_mempool_kmalloc+0x10/0x10
[   12.358648]  ? __pfx_mempool_kfree+0x10/0x10
[   12.358672]  ? __pfx_read_tsc+0x10/0x10
[   12.358694]  ? ktime_get_ts64+0x86/0x230
[   12.358722]  kunit_try_run_case+0x1a5/0x480
[   12.358747]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.358796]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   12.358838]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   12.358874]  ? __kthread_parkme+0x82/0x180
[   12.358895]  ? preempt_count_sub+0x50/0x80
[   12.358917]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.358939]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.358964]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   12.358989]  kthread+0x337/0x6f0
[   12.359009]  ? trace_preempt_on+0x20/0xc0
[   12.359033]  ? __pfx_kthread+0x10/0x10
[   12.359053]  ? _raw_spin_unlock_irq+0x47/0x80
[   12.359075]  ? calculate_sigpending+0x7b/0xa0
[   12.359100]  ? __pfx_kthread+0x10/0x10
[   12.359121]  ret_from_fork+0x116/0x1d0
[   12.359139]  ? __pfx_kthread+0x10/0x10
[   12.359160]  ret_from_fork_asm+0x1a/0x30
[   12.359191]  </TASK>
[   12.359202] 
[   12.374406] Allocated by task 244:
[   12.374574]  kasan_save_stack+0x45/0x70
[   12.374776]  kasan_save_track+0x18/0x40
[   12.374917]  kasan_save_alloc_info+0x3b/0x50
[   12.375099]  __kasan_mempool_unpoison_object+0x1a9/0x200
[   12.375394]  remove_element+0x11e/0x190
[   12.375592]  mempool_alloc_preallocated+0x4d/0x90
[   12.375783]  mempool_uaf_helper+0x96/0x400
[   12.375977]  mempool_kmalloc_uaf+0xef/0x140
[   12.376123]  kunit_try_run_case+0x1a5/0x480
[   12.376307]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.376557]  kthread+0x337/0x6f0
[   12.376731]  ret_from_fork+0x116/0x1d0
[   12.377181]  ret_from_fork_asm+0x1a/0x30
[   12.377426] 
[   12.377523] Freed by task 244:
[   12.377698]  kasan_save_stack+0x45/0x70
[   12.378005]  kasan_save_track+0x18/0x40
[   12.378165]  kasan_save_free_info+0x3f/0x60
[   12.378313]  __kasan_mempool_poison_object+0x131/0x1d0
[   12.378569]  mempool_free+0x2ec/0x380
[   12.378766]  mempool_uaf_helper+0x11a/0x400
[   12.379123]  mempool_kmalloc_uaf+0xef/0x140
[   12.379351]  kunit_try_run_case+0x1a5/0x480
[   12.379546]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.379842]  kthread+0x337/0x6f0
[   12.380013]  ret_from_fork+0x116/0x1d0
[   12.380227]  ret_from_fork_asm+0x1a/0x30
[   12.380427] 
[   12.380502] The buggy address belongs to the object at ffff8881028b1000
[   12.380502]  which belongs to the cache kmalloc-128 of size 128
[   12.381297] The buggy address is located 0 bytes inside of
[   12.381297]  freed 128-byte region [ffff8881028b1000, ffff8881028b1080)
[   12.381919] 
[   12.381999] The buggy address belongs to the physical page:
[   12.382312] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1028b1
[   12.382686] flags: 0x200000000000000(node=0|zone=2)
[   12.383108] page_type: f5(slab)
[   12.383236] raw: 0200000000000000 ffff888100041a00 dead000000000122 0000000000000000
[   12.383660] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   12.384251] page dumped because: kasan: bad access detected
[   12.384510] 
[   12.384616] Memory state around the buggy address:
[   12.385049]  ffff8881028b0f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.385372]  ffff8881028b0f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.385711] >ffff8881028b1000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   12.385992]                    ^
[   12.386111]  ffff8881028b1080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.386420]  ffff8881028b1100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   12.386856] ==================================================================