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

Environment
qemu-arm64
qemu-x86_64
rk3399-rock-pi-4b

[   23.501340] ==================================================================
[   23.501455] BUG: KASAN: slab-use-after-free in kmalloc_uaf_memset+0x170/0x310
[   23.501578] Write of size 33 at addr fff00000c6819f00 by task kunit_try_catch/188
[   23.501847] 
[   23.501979] CPU: 0 UID: 0 PID: 188 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-rc3 #1 PREEMPT 
[   23.502279] Tainted: [B]=BAD_PAGE, [N]=TEST
[   23.502674] Hardware name: linux,dummy-virt (DT)
[   23.502779] Call trace:
[   23.503056]  show_stack+0x20/0x38 (C)
[   23.503207]  dump_stack_lvl+0x8c/0xd0
[   23.503496]  print_report+0x118/0x608
[   23.503917]  kasan_report+0xdc/0x128
[   23.504054]  kasan_check_range+0x100/0x1a8
[   23.504317]  __asan_memset+0x34/0x78
[   23.505115]  kmalloc_uaf_memset+0x170/0x310
[   23.505673]  kunit_try_run_case+0x170/0x3f0
[   23.505827]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   23.506000]  kthread+0x328/0x630
[   23.506250]  ret_from_fork+0x10/0x20
[   23.506565] 
[   23.506642] Allocated by task 188:
[   23.506780]  kasan_save_stack+0x3c/0x68
[   23.507025]  kasan_save_track+0x20/0x40
[   23.507209]  kasan_save_alloc_info+0x40/0x58
[   23.507330]  __kasan_kmalloc+0xd4/0xd8
[   23.507563]  __kmalloc_cache_noprof+0x15c/0x3c0
[   23.507893]  kmalloc_uaf_memset+0xb8/0x310
[   23.508095]  kunit_try_run_case+0x170/0x3f0
[   23.508219]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   23.508452]  kthread+0x328/0x630
[   23.509051]  ret_from_fork+0x10/0x20
[   23.509452] 
[   23.509612] Freed by task 188:
[   23.509831]  kasan_save_stack+0x3c/0x68
[   23.509953]  kasan_save_track+0x20/0x40
[   23.510053]  kasan_save_free_info+0x4c/0x78
[   23.510888]  __kasan_slab_free+0x6c/0x98
[   23.511202]  kfree+0x214/0x3c8
[   23.511290]  kmalloc_uaf_memset+0x11c/0x310
[   23.511381]  kunit_try_run_case+0x170/0x3f0
[   23.512655]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   23.513868]  kthread+0x328/0x630
[   23.514263]  ret_from_fork+0x10/0x20
[   23.514408] 
[   23.514455] The buggy address belongs to the object at fff00000c6819f00
[   23.514455]  which belongs to the cache kmalloc-64 of size 64
[   23.515723] The buggy address is located 0 bytes inside of
[   23.515723]  freed 64-byte region [fff00000c6819f00, fff00000c6819f40)
[   23.516311] 
[   23.516364] The buggy address belongs to the physical page:
[   23.516437] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x106819
[   23.517270] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   23.517399] page_type: f5(slab)
[   23.517510] raw: 0bfffe0000000000 fff00000c00018c0 dead000000000122 0000000000000000
[   23.517636] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   23.517736] page dumped because: kasan: bad access detected
[   23.517812] 
[   23.517859] Memory state around the buggy address:
[   23.517951]  fff00000c6819e00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   23.518055]  fff00000c6819e80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   23.518156] >fff00000c6819f00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   23.518251]                    ^
[   23.518322]  fff00000c6819f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   23.518421]  fff00000c681a000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   23.518654] ==================================================================

[   11.763859] ==================================================================
[   11.764285] BUG: KASAN: slab-use-after-free in kmalloc_uaf_memset+0x1a3/0x360
[   11.764750] Write of size 33 at addr ffff888102b3f480 by task kunit_try_catch/206
[   11.765212] 
[   11.765355] CPU: 1 UID: 0 PID: 206 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-rc3 #1 PREEMPT(voluntary) 
[   11.765401] Tainted: [B]=BAD_PAGE, [N]=TEST
[   11.765412] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   11.765433] Call Trace:
[   11.765445]  <TASK>
[   11.765461]  dump_stack_lvl+0x73/0xb0
[   11.765487]  print_report+0xd1/0x650
[   11.765510]  ? __virt_addr_valid+0x1db/0x2d0
[   11.765531]  ? kmalloc_uaf_memset+0x1a3/0x360
[   11.765552]  ? kasan_complete_mode_report_info+0x64/0x200
[   11.765574]  ? kmalloc_uaf_memset+0x1a3/0x360
[   11.765596]  kasan_report+0x141/0x180
[   11.765618]  ? kmalloc_uaf_memset+0x1a3/0x360
[   11.765645]  kasan_check_range+0x10c/0x1c0
[   11.765669]  __asan_memset+0x27/0x50
[   11.765689]  kmalloc_uaf_memset+0x1a3/0x360
[   11.765710]  ? __pfx_kmalloc_uaf_memset+0x10/0x10
[   11.765732]  ? __schedule+0x10cc/0x2b30
[   11.765756]  ? __pfx_read_tsc+0x10/0x10
[   11.765781]  ? ktime_get_ts64+0x86/0x230
[   11.765806]  kunit_try_run_case+0x1a5/0x480
[   11.765829]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.765850]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   11.765873]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   11.765896]  ? __kthread_parkme+0x82/0x180
[   11.765918]  ? preempt_count_sub+0x50/0x80
[   11.765942]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.765964]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.765986]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   11.766008]  kthread+0x337/0x6f0
[   11.766028]  ? trace_preempt_on+0x20/0xc0
[   11.766052]  ? __pfx_kthread+0x10/0x10
[   11.766074]  ? _raw_spin_unlock_irq+0x47/0x80
[   11.766095]  ? calculate_sigpending+0x7b/0xa0
[   11.766116]  ? __pfx_kthread+0x10/0x10
[   11.766138]  ret_from_fork+0x41/0x80
[   11.766158]  ? __pfx_kthread+0x10/0x10
[   11.766180]  ret_from_fork_asm+0x1a/0x30
[   11.766229]  </TASK>
[   11.766240] 
[   11.772850] Allocated by task 206:
[   11.772974]  kasan_save_stack+0x45/0x70
[   11.773236]  kasan_save_track+0x18/0x40
[   11.773438]  kasan_save_alloc_info+0x3b/0x50
[   11.773641]  __kasan_kmalloc+0xb7/0xc0
[   11.773831]  __kmalloc_cache_noprof+0x189/0x420
[   11.774049]  kmalloc_uaf_memset+0xa9/0x360
[   11.774255]  kunit_try_run_case+0x1a5/0x480
[   11.774453]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.774664]  kthread+0x337/0x6f0
[   11.774834]  ret_from_fork+0x41/0x80
[   11.774974]  ret_from_fork_asm+0x1a/0x30
[   11.775119] 
[   11.775227] Freed by task 206:
[   11.775394]  kasan_save_stack+0x45/0x70
[   11.775584]  kasan_save_track+0x18/0x40
[   11.775737]  kasan_save_free_info+0x3f/0x60
[   11.775893]  __kasan_slab_free+0x56/0x70
[   11.776085]  kfree+0x222/0x3f0
[   11.776370]  kmalloc_uaf_memset+0x12b/0x360
[   11.776555]  kunit_try_run_case+0x1a5/0x480
[   11.776732]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.776952]  kthread+0x337/0x6f0
[   11.777109]  ret_from_fork+0x41/0x80
[   11.777297]  ret_from_fork_asm+0x1a/0x30
[   11.777447] 
[   11.777515] The buggy address belongs to the object at ffff888102b3f480
[   11.777515]  which belongs to the cache kmalloc-64 of size 64
[   11.777870] The buggy address is located 0 bytes inside of
[   11.777870]  freed 64-byte region [ffff888102b3f480, ffff888102b3f4c0)
[   11.778260] 
[   11.778360] The buggy address belongs to the physical page:
[   11.778611] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102b3f
[   11.780793] flags: 0x200000000000000(node=0|zone=2)
[   11.781035] page_type: f5(slab)
[   11.781202] raw: 0200000000000000 ffff8881000418c0 dead000000000122 0000000000000000
[   11.782607] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   11.785404] page dumped because: kasan: bad access detected
[   11.785627] 
[   11.785721] Memory state around the buggy address:
[   11.785928]  ffff888102b3f380: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   11.786482]  ffff888102b3f400: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   11.787571] >ffff888102b3f480: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   11.788581]                    ^
[   11.789091]  ffff888102b3f500: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.790157]  ffff888102b3f580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.792396] ==================================================================

[   21.668439] ==================================================================
[   21.669451] BUG: KASAN: slab-use-after-free in kmalloc_uaf_memset+0x170/0x310
[   21.670133] Write of size 33 at addr ffff00000ff06800 by task kunit_try_catch/240
[   21.670827] 
[   21.670992] CPU: 1 UID: 0 PID: 240 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-rc3 #1 PREEMPT 
[   21.671042] Tainted: [B]=BAD_PAGE, [N]=TEST
[   21.671056] Hardware name: Radxa ROCK Pi 4B (DT)
[   21.671074] Call trace:
[   21.671086]  show_stack+0x20/0x38 (C)
[   21.671121]  dump_stack_lvl+0x8c/0xd0
[   21.671152]  print_report+0x118/0x608
[   21.671181]  kasan_report+0xdc/0x128
[   21.671209]  kasan_check_range+0x100/0x1a8
[   21.671241]  __asan_memset+0x34/0x78
[   21.671272]  kmalloc_uaf_memset+0x170/0x310
[   21.671305]  kunit_try_run_case+0x170/0x3f0
[   21.671341]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   21.671381]  kthread+0x328/0x630
[   21.671415]  ret_from_fork+0x10/0x20
[   21.671448] 
[   21.677313] Allocated by task 240:
[   21.677651]  kasan_save_stack+0x3c/0x68
[   21.678037]  kasan_save_track+0x20/0x40
[   21.678419]  kasan_save_alloc_info+0x40/0x58
[   21.678844]  __kasan_kmalloc+0xd4/0xd8
[   21.679217]  __kmalloc_cache_noprof+0x15c/0x3c0
[   21.679670]  kmalloc_uaf_memset+0xb8/0x310
[   21.680081]  kunit_try_run_case+0x170/0x3f0
[   21.680498]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   21.681036]  kthread+0x328/0x630
[   21.681370]  ret_from_fork+0x10/0x20
[   21.681731] 
[   21.681889] Freed by task 240:
[   21.682192]  kasan_save_stack+0x3c/0x68
[   21.682574]  kasan_save_track+0x20/0x40
[   21.682955]  kasan_save_free_info+0x4c/0x78
[   21.683368]  __kasan_slab_free+0x6c/0x98
[   21.683758]  kfree+0x214/0x3c8
[   21.684075]  kmalloc_uaf_memset+0x11c/0x310
[   21.684494]  kunit_try_run_case+0x170/0x3f0
[   21.684911]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   21.685447]  kthread+0x328/0x630
[   21.685779]  ret_from_fork+0x10/0x20
[   21.686140] 
[   21.686299] The buggy address belongs to the object at ffff00000ff06800
[   21.686299]  which belongs to the cache kmalloc-64 of size 64
[   21.687429] The buggy address is located 0 bytes inside of
[   21.687429]  freed 64-byte region [ffff00000ff06800, ffff00000ff06840)
[   21.688530] 
[   21.688689] The buggy address belongs to the physical page:
[   21.689214] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0xff06
[   21.689951] flags: 0x3fffe0000000000(node=0|zone=0|lastcpupid=0x1ffff)
[   21.690573] page_type: f5(slab)
[   21.690895] raw: 03fffe0000000000 ffff0000004028c0 dead000000000122 0000000000000000
[   21.691623] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   21.692340] page dumped because: kasan: bad access detected
[   21.692862] 
[   21.693022] Memory state around the buggy address:
[   21.693477]  ffff00000ff06700: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   21.694153]  ffff00000ff06780: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   21.694829] >ffff00000ff06800: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   21.695501]                    ^
[   21.695818]  ffff00000ff06880: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   21.696494]  ffff00000ff06900: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   21.697165] ==================================================================