Hay
Date
April 20, 2025, 11:09 p.m.

Environment
x15
x86

[   56.415374] ==================================================================
[   56.425994] BUG: KASAN: slab-use-after-free in kmalloc_uaf_memset+0x1fc/0x3b0
[   56.433166] Write of size 33 at addr cc22bf00 by task kunit_try_catch/242
[   56.440002] 
[   56.441528] CPU: 1 UID: 0 PID: 242 Comm: kunit_try_catch Tainted: G    B   W        N  6.15.0-rc3 #1 NONE 
[   56.441558] Tainted: [B]=BAD_PAGE, [W]=WARN, [N]=TEST
[   56.441558] Hardware name: Generic DRA74X (Flattened Device Tree)
[   56.441558] Call trace: 
[   56.441558]  unwind_backtrace from show_stack+0x18/0x1c
[   56.441589]  show_stack from dump_stack_lvl+0x70/0x90
[   56.441619]  dump_stack_lvl from print_report+0x158/0x528
[   56.441650]  print_report from kasan_report+0xdc/0x118
[   56.441680]  kasan_report from kasan_check_range+0x14c/0x198
[   56.441680]  kasan_check_range from __asan_memset+0x20/0x3c
[   56.441711]  __asan_memset from kmalloc_uaf_memset+0x1fc/0x3b0
[   56.441741]  kmalloc_uaf_memset from kunit_try_run_case+0x22c/0x5a8
[   56.441772]  kunit_try_run_case from kunit_generic_run_threadfn_adapter+0xc4/0x128
[   56.441772]  kunit_generic_run_threadfn_adapter from kthread+0x464/0x810
[   56.441802]  kthread from ret_from_fork+0x14/0x20
[   56.441833] Exception stack(0xf24abfb0 to 0xf24abff8)
[   56.441833] bfa0:                                     00000000 00000000 00000000 00000000
[   56.441864] bfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[   56.441894] bfe0: 00000000 00000000 00000000 00000000 00000013 00000000
[   56.441894] 
[   56.558319] Allocated by task 242:
[   56.561737]  kasan_save_track+0x30/0x5c
[   56.565612]  __kasan_kmalloc+0x8c/0x94
[   56.569396]  kmalloc_uaf_memset+0xcc/0x3b0
[   56.573516]  kunit_try_run_case+0x22c/0x5a8
[   56.577728]  kunit_generic_run_threadfn_adapter+0xc4/0x128
[   56.583251]  kthread+0x464/0x810
[   56.586517]  ret_from_fork+0x14/0x20
[   56.590118] 
[   56.591613] Freed by task 242:
[   56.594696]  kasan_save_track+0x30/0x5c
[   56.598571]  kasan_save_free_info+0x3c/0x48
[   56.602783]  __kasan_slab_free+0x40/0x50
[   56.606750]  kfree+0xe8/0x384
[   56.609741]  kmalloc_uaf_memset+0x174/0x3b0
[   56.613952]  kunit_try_run_case+0x22c/0x5a8
[   56.618164]  kunit_generic_run_threadfn_adapter+0xc4/0x128
[   56.623687]  kthread+0x464/0x810
[   56.626953]  ret_from_fork+0x14/0x20
[   56.630554] 
[   56.632049] The buggy address belongs to the object at cc22bf00
[   56.632049]  which belongs to the cache kmalloc-64 of size 64
[   56.643768] The buggy address is located 0 bytes inside of
[   56.643768]  freed 64-byte region [cc22bf00, cc22bf40)
[   56.654449] 
[   56.655975] The buggy address belongs to the physical page:
[   56.661560] page: refcount:0 mapcount:0 mapping:00000000 index:0x0 pfn:0x8c22b
[   56.668853] flags: 0x0(zone=0)
[   56.671905] page_type: f5(slab)
[   56.675079] raw: 00000000 c7001300 00000122 00000000 00000000 80200020 f5000000 00000000
[   56.683227] raw: 00000000
[   56.685882] page dumped because: kasan: bad access detected
[   56.691467] 
[   56.692993] Memory state around the buggy address:
[   56.697814]  cc22be00: 00 04 fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   56.704376]  cc22be80: 00 04 fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   56.710937] >cc22bf00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   56.717529]            ^
[   56.720062]  cc22bf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   56.726654]  cc22c000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   56.733215] ==================================================================

[   27.442029] ==================================================================
[   27.452582] BUG: KASAN: slab-use-after-free in kmalloc_uaf_memset+0x1a3/0x360
[   27.459761] Write of size 33 at addr ffff888107f06400 by task kunit_try_catch/229
[   27.467244] 
[   27.468765] CPU: 1 UID: 0 PID: 229 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-rc3 #1 PREEMPT(voluntary) 
[   27.468773] Tainted: [B]=BAD_PAGE, [N]=TEST
[   27.468775] Hardware name: Supermicro SYS-5019S-ML/X11SSH-F, BIOS 2.7 12/07/2021
[   27.468779] Call Trace:
[   27.468780]  <TASK>
[   27.468782]  dump_stack_lvl+0x73/0xb0
[   27.468786]  print_report+0xd1/0x650
[   27.468790]  ? __virt_addr_valid+0x1db/0x2d0
[   27.468794]  ? kmalloc_uaf_memset+0x1a3/0x360
[   27.468798]  ? kasan_complete_mode_report_info+0x64/0x200
[   27.468802]  ? kmalloc_uaf_memset+0x1a3/0x360
[   27.468807]  kasan_report+0x141/0x180
[   27.468811]  ? kmalloc_uaf_memset+0x1a3/0x360
[   27.468816]  kasan_check_range+0x10c/0x1c0
[   27.468820]  __asan_memset+0x27/0x50
[   27.468824]  kmalloc_uaf_memset+0x1a3/0x360
[   27.468828]  ? __pfx_kmalloc_uaf_memset+0x10/0x10
[   27.468832]  ? __schedule+0x10cc/0x2b30
[   27.468837]  ? ktime_get_ts64+0x83/0x230
[   27.468841]  kunit_try_run_case+0x1a2/0x480
[   27.468846]  ? __pfx_kunit_try_run_case+0x10/0x10
[   27.468850]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   27.468855]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   27.468859]  ? __kthread_parkme+0x82/0x180
[   27.468863]  ? preempt_count_sub+0x50/0x80
[   27.468868]  ? __pfx_kunit_try_run_case+0x10/0x10
[   27.468872]  kunit_generic_run_threadfn_adapter+0x82/0xf0
[   27.468876]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   27.468880]  kthread+0x334/0x6f0
[   27.468884]  ? trace_preempt_on+0x20/0xc0
[   27.468888]  ? __pfx_kthread+0x10/0x10
[   27.468893]  ? _raw_spin_unlock_irq+0x47/0x80
[   27.468897]  ? calculate_sigpending+0x7b/0xa0
[   27.468901]  ? __pfx_kthread+0x10/0x10
[   27.468905]  ret_from_fork+0x3e/0x80
[   27.468909]  ? __pfx_kthread+0x10/0x10
[   27.468913]  ret_from_fork_asm+0x1a/0x30
[   27.468919]  </TASK>
[   27.468920] 
[   27.635125] Allocated by task 229:
[   27.638533]  kasan_save_stack+0x45/0x70
[   27.642373]  kasan_save_track+0x18/0x40
[   27.646212]  kasan_save_alloc_info+0x3b/0x50
[   27.650482]  __kasan_kmalloc+0xb7/0xc0
[   27.654236]  __kmalloc_cache_noprof+0x189/0x420
[   27.658770]  kmalloc_uaf_memset+0xa9/0x360
[   27.662877]  kunit_try_run_case+0x1a2/0x480
[   27.667063]  kunit_generic_run_threadfn_adapter+0x82/0xf0
[   27.672471]  kthread+0x334/0x6f0
[   27.675701]  ret_from_fork+0x3e/0x80
[   27.679325]  ret_from_fork_asm+0x1a/0x30
[   27.683250] 
[   27.684757] Freed by task 229:
[   27.687819]  kasan_save_stack+0x45/0x70
[   27.691656]  kasan_save_track+0x18/0x40
[   27.695530]  kasan_save_free_info+0x3f/0x60
[   27.699754]  __kasan_slab_free+0x56/0x70
[   27.703705]  kfree+0x222/0x3f0
[   27.706813]  kmalloc_uaf_memset+0x12b/0x360
[   27.710999]  kunit_try_run_case+0x1a2/0x480
[   27.715187]  kunit_generic_run_threadfn_adapter+0x82/0xf0
[   27.720585]  kthread+0x334/0x6f0
[   27.723818]  ret_from_fork+0x3e/0x80
[   27.727397]  ret_from_fork_asm+0x1a/0x30
[   27.731322] 
[   27.732820] The buggy address belongs to the object at ffff888107f06400
[   27.732820]  which belongs to the cache kmalloc-64 of size 64
[   27.745153] The buggy address is located 0 bytes inside of
[   27.745153]  freed 64-byte region [ffff888107f06400, ffff888107f06440)
[   27.757147] 
[   27.758648] The buggy address belongs to the physical page:
[   27.764220] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x107f06
[   27.772229] flags: 0x200000000000000(node=0|zone=2)
[   27.777105] page_type: f5(slab)
[   27.780253] raw: 0200000000000000 ffff8881000428c0 dead000000000122 0000000000000000
[   27.788002] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   27.795760] page dumped because: kasan: bad access detected
[   27.801338] 
[   27.802836] Memory state around the buggy address:
[   27.807630]  ffff888107f06300: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   27.814850]  ffff888107f06380: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   27.822076] >ffff888107f06400: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   27.829293]                    ^
[   27.832527]  ffff888107f06480: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   27.839763]  ffff888107f06500: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   27.846981] ==================================================================