Hay
Date
July 3, 2025, 10:10 a.m.

Environment
dragonboard-845c
qemu-arm64
qemu-x86_64

[   41.523261] ==================================================================
[   41.533949] BUG: KASAN: slab-use-after-free in kmalloc_uaf_memset+0x170/0x310
[   41.541182] Write of size 33 at addr ffff000081814780 by task kunit_try_catch/295
[   41.548770] 
[   41.550305] CPU: 3 UID: 0 PID: 295 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4-next-20250703 #1 PREEMPT 
[   41.550337] Tainted: [B]=BAD_PAGE, [N]=TEST
[   41.550346] Hardware name: Thundercomm Dragonboard 845c (DT)
[   41.550360] Call trace:
[   41.550367]  show_stack+0x20/0x38 (C)
[   41.550385]  dump_stack_lvl+0x8c/0xd0
[   41.550409]  print_report+0x118/0x608
[   41.550427]  kasan_report+0xdc/0x128
[   41.550447]  kasan_check_range+0x100/0x1a8
[   41.550467]  __asan_memset+0x34/0x78
[   41.550485]  kmalloc_uaf_memset+0x170/0x310
[   41.550503]  kunit_try_run_case+0x170/0x3f0
[   41.550522]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   41.550544]  kthread+0x328/0x630
[   41.550558]  ret_from_fork+0x10/0x20
[   41.550576] 
[   41.619207] Allocated by task 295:
[   41.622673]  kasan_save_stack+0x3c/0x68
[   41.626581]  kasan_save_track+0x20/0x40
[   41.630486]  kasan_save_alloc_info+0x40/0x58
[   41.634831]  __kasan_kmalloc+0xd4/0xd8
[   41.638650]  __kmalloc_cache_noprof+0x16c/0x3c0
[   41.643256]  kmalloc_uaf_memset+0xb8/0x310
[   41.647419]  kunit_try_run_case+0x170/0x3f0
[   41.651680]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   41.657249]  kthread+0x328/0x630
[   41.660536]  ret_from_fork+0x10/0x20
[   41.664181] 
[   41.665711] Freed by task 295:
[   41.668820]  kasan_save_stack+0x3c/0x68
[   41.672726]  kasan_save_track+0x20/0x40
[   41.676632]  kasan_save_free_info+0x4c/0x78
[   41.680890]  __kasan_slab_free+0x6c/0x98
[   41.684883]  kfree+0x214/0x3c8
[   41.687997]  kmalloc_uaf_memset+0x11c/0x310
[   41.692256]  kunit_try_run_case+0x170/0x3f0
[   41.696518]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   41.702087]  kthread+0x328/0x630
[   41.705374]  ret_from_fork+0x10/0x20
[   41.709018] 
[   41.710549] The buggy address belongs to the object at ffff000081814780
[   41.710549]  which belongs to the cache kmalloc-64 of size 64
[   41.723037] The buggy address is located 0 bytes inside of
[   41.723037]  freed 64-byte region [ffff000081814780, ffff0000818147c0)
[   41.735173] 
[   41.736705] The buggy address belongs to the physical page:
[   41.742352] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x101814
[   41.750457] ksm flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   41.757428] page_type: f5(slab)
[   41.760628] raw: 0bfffe0000000000 ffff0000800028c0 fffffdffc20ea340 0000000000000007
[   41.768476] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   41.776318] page dumped because: kasan: bad access detected
[   41.781966] 
[   41.783496] Memory state around the buggy address:
[   41.788354]  ffff000081814680: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   41.795669]  ffff000081814700: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   41.802984] >ffff000081814780: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   41.810298]                    ^
[   41.813583]  ffff000081814800: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   41.820899]  ffff000081814880: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   41.828212] ==================================================================

[   31.217876] ==================================================================
[   31.218185] BUG: KASAN: slab-use-after-free in kmalloc_uaf_memset+0x170/0x310
[   31.218483] Write of size 33 at addr fff00000c9b4c180 by task kunit_try_catch/218
[   31.218810] 
[   31.218886] CPU: 0 UID: 0 PID: 218 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4-next-20250703 #1 PREEMPT 
[   31.219102] Tainted: [B]=BAD_PAGE, [N]=TEST
[   31.219129] Hardware name: linux,dummy-virt (DT)
[   31.219382] Call trace:
[   31.219417]  show_stack+0x20/0x38 (C)
[   31.219726]  dump_stack_lvl+0x8c/0xd0
[   31.219798]  print_report+0x118/0x608
[   31.220143]  kasan_report+0xdc/0x128
[   31.220216]  kasan_check_range+0x100/0x1a8
[   31.220330]  __asan_memset+0x34/0x78
[   31.220383]  kmalloc_uaf_memset+0x170/0x310
[   31.220569]  kunit_try_run_case+0x170/0x3f0
[   31.220638]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   31.220716]  kthread+0x328/0x630
[   31.221043]  ret_from_fork+0x10/0x20
[   31.221292] 
[   31.221508] Allocated by task 218:
[   31.221702]  kasan_save_stack+0x3c/0x68
[   31.221782]  kasan_save_track+0x20/0x40
[   31.222183]  kasan_save_alloc_info+0x40/0x58
[   31.222340]  __kasan_kmalloc+0xd4/0xd8
[   31.222406]  __kmalloc_cache_noprof+0x16c/0x3c0
[   31.222457]  kmalloc_uaf_memset+0xb8/0x310
[   31.222611]  kunit_try_run_case+0x170/0x3f0
[   31.222922]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   31.223097]  kthread+0x328/0x630
[   31.223136]  ret_from_fork+0x10/0x20
[   31.223370] 
[   31.223398] Freed by task 218:
[   31.223429]  kasan_save_stack+0x3c/0x68
[   31.223474]  kasan_save_track+0x20/0x40
[   31.223516]  kasan_save_free_info+0x4c/0x78
[   31.223553]  __kasan_slab_free+0x6c/0x98
[   31.223653]  kfree+0x214/0x3c8
[   31.223689]  kmalloc_uaf_memset+0x11c/0x310
[   31.223728]  kunit_try_run_case+0x170/0x3f0
[   31.223768]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   31.223813]  kthread+0x328/0x630
[   31.223866]  ret_from_fork+0x10/0x20
[   31.223904] 
[   31.223923] The buggy address belongs to the object at fff00000c9b4c180
[   31.223923]  which belongs to the cache kmalloc-64 of size 64
[   31.223983] The buggy address is located 0 bytes inside of
[   31.223983]  freed 64-byte region [fff00000c9b4c180, fff00000c9b4c1c0)
[   31.224046] 
[   31.224074] The buggy address belongs to the physical page:
[   31.224122] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x109b4c
[   31.224180] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   31.224230] page_type: f5(slab)
[   31.224273] raw: 0bfffe0000000000 fff00000c00018c0 dead000000000122 0000000000000000
[   31.224324] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   31.224625] page dumped because: kasan: bad access detected
[   31.225250] 
[   31.225305] Memory state around the buggy address:
[   31.225385]  fff00000c9b4c080: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   31.225513]  fff00000c9b4c100: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   31.225642] >fff00000c9b4c180: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   31.225709]                    ^
[   31.226359]  fff00000c9b4c200: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   31.226536]  fff00000c9b4c280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   31.226663] ==================================================================

[   23.407755] ==================================================================
[   23.408234] BUG: KASAN: slab-use-after-free in kmalloc_uaf_memset+0x1a3/0x360
[   23.408568] Write of size 33 at addr ffff888104bb9980 by task kunit_try_catch/235
[   23.409053] 
[   23.409468] CPU: 1 UID: 0 PID: 235 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4-next-20250703 #1 PREEMPT(voluntary) 
[   23.409521] Tainted: [B]=BAD_PAGE, [N]=TEST
[   23.409535] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   23.409555] Call Trace:
[   23.409567]  <TASK>
[   23.409583]  dump_stack_lvl+0x73/0xb0
[   23.409613]  print_report+0xd1/0x650
[   23.409635]  ? __virt_addr_valid+0x1db/0x2d0
[   23.409658]  ? kmalloc_uaf_memset+0x1a3/0x360
[   23.409678]  ? kasan_complete_mode_report_info+0x64/0x200
[   23.409703]  ? kmalloc_uaf_memset+0x1a3/0x360
[   23.409724]  kasan_report+0x141/0x180
[   23.409745]  ? kmalloc_uaf_memset+0x1a3/0x360
[   23.409770]  kasan_check_range+0x10c/0x1c0
[   23.409792]  __asan_memset+0x27/0x50
[   23.409815]  kmalloc_uaf_memset+0x1a3/0x360
[   23.409835]  ? __pfx_kmalloc_uaf_memset+0x10/0x10
[   23.409862]  ? __schedule+0x10cc/0x2b60
[   23.409887]  ? __pfx_read_tsc+0x10/0x10
[   23.409907]  ? ktime_get_ts64+0x86/0x230
[   23.409931]  kunit_try_run_case+0x1a5/0x480
[   23.409956]  ? __pfx_kunit_try_run_case+0x10/0x10
[   23.409979]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   23.410000]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   23.410024]  ? __kthread_parkme+0x82/0x180
[   23.410045]  ? preempt_count_sub+0x50/0x80
[   23.410068]  ? __pfx_kunit_try_run_case+0x10/0x10
[   23.410092]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   23.410115]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   23.410138]  kthread+0x337/0x6f0
[   23.410380]  ? trace_preempt_on+0x20/0xc0
[   23.410403]  ? __pfx_kthread+0x10/0x10
[   23.410424]  ? _raw_spin_unlock_irq+0x47/0x80
[   23.410447]  ? calculate_sigpending+0x7b/0xa0
[   23.410483]  ? __pfx_kthread+0x10/0x10
[   23.410504]  ret_from_fork+0x116/0x1d0
[   23.410523]  ? __pfx_kthread+0x10/0x10
[   23.410543]  ret_from_fork_asm+0x1a/0x30
[   23.410574]  </TASK>
[   23.410585] 
[   23.418060] Allocated by task 235:
[   23.418348]  kasan_save_stack+0x45/0x70
[   23.418538]  kasan_save_track+0x18/0x40
[   23.418671]  kasan_save_alloc_info+0x3b/0x50
[   23.418811]  __kasan_kmalloc+0xb7/0xc0
[   23.418996]  __kmalloc_cache_noprof+0x189/0x420
[   23.419403]  kmalloc_uaf_memset+0xa9/0x360
[   23.419637]  kunit_try_run_case+0x1a5/0x480
[   23.419864]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   23.420107]  kthread+0x337/0x6f0
[   23.420324]  ret_from_fork+0x116/0x1d0
[   23.420450]  ret_from_fork_asm+0x1a/0x30
[   23.420592] 
[   23.420664] Freed by task 235:
[   23.421018]  kasan_save_stack+0x45/0x70
[   23.421211]  kasan_save_track+0x18/0x40
[   23.421512]  kasan_save_free_info+0x3f/0x60
[   23.421664]  __kasan_slab_free+0x56/0x70
[   23.421814]  kfree+0x222/0x3f0
[   23.421981]  kmalloc_uaf_memset+0x12b/0x360
[   23.422255]  kunit_try_run_case+0x1a5/0x480
[   23.422448]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   23.422628]  kthread+0x337/0x6f0
[   23.422741]  ret_from_fork+0x116/0x1d0
[   23.422865]  ret_from_fork_asm+0x1a/0x30
[   23.423073] 
[   23.423161] The buggy address belongs to the object at ffff888104bb9980
[   23.423161]  which belongs to the cache kmalloc-64 of size 64
[   23.423680] The buggy address is located 0 bytes inside of
[   23.423680]  freed 64-byte region [ffff888104bb9980, ffff888104bb99c0)
[   23.424379] 
[   23.424451] The buggy address belongs to the physical page:
[   23.424629] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x104bb9
[   23.424895] flags: 0x200000000000000(node=0|zone=2)
[   23.425121] page_type: f5(slab)
[   23.425432] raw: 0200000000000000 ffff8881000418c0 dead000000000122 0000000000000000
[   23.425778] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   23.426452] page dumped because: kasan: bad access detected
[   23.426677] 
[   23.426757] Memory state around the buggy address:
[   23.426994]  ffff888104bb9880: 00 00 00 00 00 fc fc fc fc fc fc fc fc fc fc fc
[   23.427380]  ffff888104bb9900: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   23.427682] >ffff888104bb9980: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   23.427953]                    ^
[   23.428097]  ffff888104bb9a00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   23.428398]  ffff888104bb9a80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   23.428809] ==================================================================