Hay
Date
Dec. 6, 2024, 3:11 p.m.

Environment
qemu-arm64
qemu-x86_64

[   34.249714] ==================================================================
[   34.250982] BUG: KASAN: slab-use-after-free in strlen+0xa8/0xb0
[   34.251738] Read of size 1 at addr fff00000c69e4d10 by task kunit_try_catch/248
[   34.252505] 
[   34.253459] CPU: 0 UID: 0 PID: 248 Comm: kunit_try_catch Tainted: G    B            N 6.13.0-rc1-next-20241206 #1
[   34.254641] Tainted: [B]=BAD_PAGE, [N]=TEST
[   34.255128] Hardware name: linux,dummy-virt (DT)
[   34.255758] Call trace:
[   34.256227]  show_stack+0x20/0x38 (C)
[   34.256895]  dump_stack_lvl+0x8c/0xd0
[   34.257556]  print_report+0x118/0x5e0
[   34.258158]  kasan_report+0xc8/0x118
[   34.259127]  __asan_report_load1_noabort+0x20/0x30
[   34.259889]  strlen+0xa8/0xb0
[   34.260257]  kasan_strings+0x304/0x8d8
[   34.260924]  kunit_try_run_case+0x14c/0x3d0
[   34.261569]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   34.262624]  kthread+0x24c/0x2d0
[   34.263394]  ret_from_fork+0x10/0x20
[   34.264010] 
[   34.264367] Allocated by task 248:
[   34.264825]  kasan_save_stack+0x3c/0x68
[   34.265466]  kasan_save_track+0x20/0x40
[   34.266007]  kasan_save_alloc_info+0x40/0x58
[   34.266911]  __kasan_kmalloc+0xd4/0xd8
[   34.267874]  __kmalloc_cache_noprof+0x15c/0x3c0
[   34.268844]  kasan_strings+0xb0/0x8d8
[   34.269722]  kunit_try_run_case+0x14c/0x3d0
[   34.270142]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   34.271185]  kthread+0x24c/0x2d0
[   34.271764]  ret_from_fork+0x10/0x20
[   34.272269] 
[   34.272641] Freed by task 248:
[   34.273165]  kasan_save_stack+0x3c/0x68
[   34.273822]  kasan_save_track+0x20/0x40
[   34.274767]  kasan_save_free_info+0x4c/0x78
[   34.275410]  __kasan_slab_free+0x6c/0x98
[   34.275967]  kfree+0x114/0x3c8
[   34.276548]  kasan_strings+0x124/0x8d8
[   34.277165]  kunit_try_run_case+0x14c/0x3d0
[   34.277842]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   34.278492]  kthread+0x24c/0x2d0
[   34.279101]  ret_from_fork+0x10/0x20
[   34.279731] 
[   34.280101] The buggy address belongs to the object at fff00000c69e4d00
[   34.280101]  which belongs to the cache kmalloc-32 of size 32
[   34.281472] The buggy address is located 16 bytes inside of
[   34.281472]  freed 32-byte region [fff00000c69e4d00, fff00000c69e4d20)
[   34.283010] 
[   34.283385] The buggy address belongs to the physical page:
[   34.284034] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1069e4
[   34.285176] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   34.286006] page_type: f5(slab)
[   34.287173] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   34.288677] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   34.289549] page dumped because: kasan: bad access detected
[   34.290227] 
[   34.290590] Memory state around the buggy address:
[   34.291289]  fff00000c69e4c00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   34.292390]  fff00000c69e4c80: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   34.293224] >fff00000c69e4d00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   34.294501]                          ^
[   34.295108]  fff00000c69e4d80: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   34.296014]  fff00000c69e4e00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   34.296943] ==================================================================

[   27.210483] ==================================================================
[   27.212244] BUG: KASAN: slab-use-after-free in strlen+0x8f/0xb0
[   27.212843] Read of size 1 at addr ffff888102481690 by task kunit_try_catch/267
[   27.214544] 
[   27.214711] CPU: 1 UID: 0 PID: 267 Comm: kunit_try_catch Tainted: G    B            N 6.13.0-rc1-next-20241206 #1
[   27.215506] Tainted: [B]=BAD_PAGE, [N]=TEST
[   27.216271] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   27.216990] Call Trace:
[   27.217963]  <TASK>
[   27.218672]  dump_stack_lvl+0x73/0xb0
[   27.219860]  print_report+0xd1/0x640
[   27.220901]  ? __virt_addr_valid+0x1db/0x2d0
[   27.221742]  ? kasan_complete_mode_report_info+0x64/0x200
[   27.222136]  kasan_report+0x102/0x140
[   27.223365]  ? strlen+0x8f/0xb0
[   27.223881]  ? strlen+0x8f/0xb0
[   27.224221]  __asan_report_load1_noabort+0x18/0x20
[   27.224646]  strlen+0x8f/0xb0
[   27.225022]  kasan_strings+0x425/0xb60
[   27.226210]  ? __pfx_kasan_strings+0x10/0x10
[   27.226589]  ? __schedule+0xc70/0x27e0
[   27.226910]  ? __pfx_read_tsc+0x10/0x10
[   27.227404]  ? ktime_get_ts64+0x86/0x230
[   27.228556]  kunit_try_run_case+0x1b3/0x490
[   27.229027]  ? __pfx_kunit_try_run_case+0x10/0x10
[   27.229625]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   27.230145]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   27.232070]  ? __kthread_parkme+0x82/0x160
[   27.232534]  ? preempt_count_sub+0x50/0x80
[   27.233157]  ? __pfx_kunit_try_run_case+0x10/0x10
[   27.233969]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   27.235276]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   27.236430]  kthread+0x257/0x310
[   27.236696]  ? __pfx_kthread+0x10/0x10
[   27.237902]  ret_from_fork+0x41/0x80
[   27.238375]  ? __pfx_kthread+0x10/0x10
[   27.238759]  ret_from_fork_asm+0x1a/0x30
[   27.239218]  </TASK>
[   27.239515] 
[   27.239698] Allocated by task 267:
[   27.241489]  kasan_save_stack+0x3d/0x60
[   27.241886]  kasan_save_track+0x18/0x40
[   27.242825]  kasan_save_alloc_info+0x3b/0x50
[   27.243367]  __kasan_kmalloc+0xb7/0xc0
[   27.244442]  __kmalloc_cache_noprof+0x184/0x410
[   27.245687]  kasan_strings+0xb9/0xb60
[   27.246271]  kunit_try_run_case+0x1b3/0x490
[   27.247390]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   27.248210]  kthread+0x257/0x310
[   27.248577]  ret_from_fork+0x41/0x80
[   27.248810]  ret_from_fork_asm+0x1a/0x30
[   27.249078] 
[   27.249423] Freed by task 267:
[   27.251182]  kasan_save_stack+0x3d/0x60
[   27.251555]  kasan_save_track+0x18/0x40
[   27.252332]  kasan_save_free_info+0x3f/0x60
[   27.252619]  __kasan_slab_free+0x56/0x70
[   27.253107]  kfree+0x123/0x3f0
[   27.253639]  kasan_strings+0x13c/0xb60
[   27.254013]  kunit_try_run_case+0x1b3/0x490
[   27.254521]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   27.255362]  kthread+0x257/0x310
[   27.256622]  ret_from_fork+0x41/0x80
[   27.257150]  ret_from_fork_asm+0x1a/0x30
[   27.258224] 
[   27.258488] The buggy address belongs to the object at ffff888102481680
[   27.258488]  which belongs to the cache kmalloc-32 of size 32
[   27.259196] The buggy address is located 16 bytes inside of
[   27.259196]  freed 32-byte region [ffff888102481680, ffff8881024816a0)
[   27.262208] 
[   27.262435] The buggy address belongs to the physical page:
[   27.262789] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102481
[   27.264723] flags: 0x200000000000000(node=0|zone=2)
[   27.265215] page_type: f5(slab)
[   27.266466] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   27.267561] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   27.268081] page dumped because: kasan: bad access detected
[   27.269368] 
[   27.270149] Memory state around the buggy address:
[   27.271167]  ffff888102481580: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   27.272153]  ffff888102481600: 00 00 00 fc fc fc fc fc 00 00 07 fc fc fc fc fc
[   27.273972] >ffff888102481680: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   27.275046]                          ^
[   27.275564]  ffff888102481700: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   27.277060]  ffff888102481780: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   27.277796] ==================================================================