Hay
Date
Nov. 28, 2024, 2:36 a.m.

Environment
qemu-arm64
qemu-x86_64

[   29.358462] ==================================================================
[   29.359563] BUG: KASAN: slab-out-of-bounds in kmalloc_oob_left+0x2ec/0x320
[   29.360328] Read of size 1 at addr fff00000c4005dff by task kunit_try_catch/126
[   29.360961] 
[   29.361380] CPU: 1 UID: 0 PID: 126 Comm: kunit_try_catch Tainted: G    B            N 6.12.0-next-20241128 #1
[   29.362801] Tainted: [B]=BAD_PAGE, [N]=TEST
[   29.363505] Hardware name: linux,dummy-virt (DT)
[   29.364261] Call trace:
[   29.364839]  show_stack+0x20/0x38 (C)
[   29.365586]  dump_stack_lvl+0x8c/0xd0
[   29.366362]  print_report+0x118/0x5e0
[   29.367065]  kasan_report+0xc8/0x118
[   29.367790]  __asan_report_load1_noabort+0x20/0x30
[   29.368596]  kmalloc_oob_left+0x2ec/0x320
[   29.369503]  kunit_try_run_case+0x14c/0x3d0
[   29.370267]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   29.371105]  kthread+0x24c/0x2d0
[   29.371580]  ret_from_fork+0x10/0x20
[   29.372072] 
[   29.372395] Allocated by task 28:
[   29.372842]  kasan_save_stack+0x3c/0x68
[   29.373944]  kasan_save_track+0x20/0x40
[   29.374662]  kasan_save_alloc_info+0x40/0x58
[   29.375409]  __kasan_kmalloc+0xd4/0xd8
[   29.376073]  __kmalloc_node_track_caller_noprof+0x184/0x4b8
[   29.376945]  kstrdup+0x54/0xc8
[   29.377638]  devtmpfs_work_loop+0x384/0x590
[   29.378191]  devtmpfsd+0x50/0x58
[   29.378633]  kthread+0x24c/0x2d0
[   29.379065]  ret_from_fork+0x10/0x20
[   29.380094] 
[   29.380683] Freed by task 28:
[   29.381807]  kasan_save_stack+0x3c/0x68
[   29.382272]  kasan_save_track+0x20/0x40
[   29.382849]  kasan_save_free_info+0x4c/0x78
[   29.383425]  __kasan_slab_free+0x6c/0x98
[   29.384022]  kfree+0x114/0x3c8
[   29.384693]  devtmpfs_work_loop+0x498/0x590
[   29.385421]  devtmpfsd+0x50/0x58
[   29.385922]  kthread+0x24c/0x2d0
[   29.386490]  ret_from_fork+0x10/0x20
[   29.387136] 
[   29.387485] The buggy address belongs to the object at fff00000c4005de0
[   29.387485]  which belongs to the cache kmalloc-16 of size 16
[   29.388750] The buggy address is located 15 bytes to the right of
[   29.388750]  allocated 16-byte region [fff00000c4005de0, fff00000c4005df0)
[   29.389987] 
[   29.390382] The buggy address belongs to the physical page:
[   29.391041] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x104005
[   29.391962] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   29.392718] page_type: f5(slab)
[   29.393287] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000
[   29.394139] raw: 0000000000000000 0000000080800080 00000001f5000000 0000000000000000
[   29.395142] page dumped because: kasan: bad access detected
[   29.395880] 
[   29.396292] Memory state around the buggy address:
[   29.396979]  fff00000c4005c80: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   29.397716]  fff00000c4005d00: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   29.398467] >fff00000c4005d80: 00 05 fc fc 00 05 fc fc fa fb fc fc fa fb fc fc
[   29.399208]                                                                 ^
[   29.400070]  fff00000c4005e00: 00 07 fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   29.400833]  fff00000c4005e80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   29.401669] ==================================================================

[   20.067401] ==================================================================
[   20.068407] BUG: KASAN: slab-out-of-bounds in kmalloc_oob_left+0x363/0x3c0
[   20.068988] Read of size 1 at addr ffff888101094f1f by task kunit_try_catch/146
[   20.069729] 
[   20.069991] CPU: 1 UID: 0 PID: 146 Comm: kunit_try_catch Tainted: G    B            N 6.12.0-next-20241128 #1
[   20.070924] Tainted: [B]=BAD_PAGE, [N]=TEST
[   20.071560] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   20.072328] Call Trace:
[   20.072607]  <TASK>
[   20.072831]  dump_stack_lvl+0x73/0xb0
[   20.073640]  print_report+0xd1/0x640
[   20.074069]  ? __virt_addr_valid+0x1db/0x2d0
[   20.074605]  ? kasan_complete_mode_report_info+0x64/0x200
[   20.075268]  kasan_report+0x102/0x140
[   20.075769]  ? kmalloc_oob_left+0x363/0x3c0
[   20.076293]  ? kmalloc_oob_left+0x363/0x3c0
[   20.076662]  __asan_report_load1_noabort+0x18/0x20
[   20.077309]  kmalloc_oob_left+0x363/0x3c0
[   20.077768]  ? __pfx_kmalloc_oob_left+0x10/0x10
[   20.078507]  ? __schedule+0xc3e/0x2790
[   20.078894]  ? __pfx_read_tsc+0x10/0x10
[   20.079361]  ? ktime_get_ts64+0x84/0x230
[   20.079727]  kunit_try_run_case+0x1b3/0x490
[   20.080303]  ? __pfx_kunit_try_run_case+0x10/0x10
[   20.080848]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   20.081322]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   20.081862]  ? __kthread_parkme+0x82/0x160
[   20.082495]  ? preempt_count_sub+0x50/0x80
[   20.082838]  ? __pfx_kunit_try_run_case+0x10/0x10
[   20.083507]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   20.084019]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   20.084447]  kthread+0x257/0x310
[   20.084778]  ? __pfx_kthread+0x10/0x10
[   20.085236]  ret_from_fork+0x41/0x80
[   20.085855]  ? __pfx_kthread+0x10/0x10
[   20.086392]  ret_from_fork_asm+0x1a/0x30
[   20.086836]  </TASK>
[   20.087025] 
[   20.087438] Allocated by task 1:
[   20.087859]  kasan_save_stack+0x3d/0x60
[   20.088496]  kasan_save_track+0x18/0x40
[   20.088807]  kasan_save_alloc_info+0x3b/0x50
[   20.089421]  __kasan_kmalloc+0xb7/0xc0
[   20.089751]  __kmalloc_node_track_caller_noprof+0x1c6/0x500
[   20.090536]  kvasprintf+0xc6/0x150
[   20.090871]  __kthread_create_on_node+0x18c/0x3a0
[   20.091487]  kthread_create_on_node+0xa8/0xe0
[   20.091961]  cryptomgr_notify+0x704/0x9f0
[   20.092595]  notifier_call_chain+0xcb/0x250
[   20.092950]  blocking_notifier_call_chain+0x64/0x90
[   20.093631]  crypto_alg_mod_lookup+0x214/0x420
[   20.093951]  crypto_alloc_tfm_node+0xc5/0x1f0
[   20.094585]  crypto_alloc_sig+0x23/0x30
[   20.095005]  public_key_verify_signature+0x1b1/0x990
[   20.096111]  x509_check_for_self_signed+0x2cb/0x480
[   20.096725]  x509_cert_parse+0x59c/0x830
[   20.097600]  x509_key_preparse+0x68/0x8a0
[   20.097950]  asymmetric_key_preparse+0xb1/0x160
[   20.098915]  __key_create_or_update+0x407/0xc90
[   20.099506]  key_create_or_update+0x17/0x20
[   20.099797]  x509_load_certificate_list+0x174/0x200
[   20.100471]  regulatory_init_db+0xee/0x3a0
[   20.100740]  do_one_initcall+0xb5/0x370
[   20.100992]  kernel_init_freeable+0x425/0x6f0
[   20.102328]  kernel_init+0x23/0x1e0
[   20.103007]  ret_from_fork+0x41/0x80
[   20.103409]  ret_from_fork_asm+0x1a/0x30
[   20.104109] 
[   20.104749] Freed by task 0:
[   20.105296]  kasan_save_stack+0x3d/0x60
[   20.106292]  kasan_save_track+0x18/0x40
[   20.106562]  kasan_save_free_info+0x3f/0x60
[   20.106828]  __kasan_slab_free+0x56/0x70
[   20.107111]  kfree+0x123/0x3f0
[   20.108175]  free_kthread_struct+0xeb/0x150
[   20.108909]  free_task+0xf3/0x130
[   20.109696]  __put_task_struct+0x1c8/0x480
[   20.110198]  delayed_put_task_struct+0x10a/0x150
[   20.110548]  rcu_core+0x680/0x1d70
[   20.110987]  rcu_core_si+0x12/0x20
[   20.111622]  handle_softirqs+0x209/0x720
[   20.112140]  __irq_exit_rcu+0xc9/0x110
[   20.112893]  irq_exit_rcu+0x12/0x20
[   20.114140]  sysvec_apic_timer_interrupt+0x81/0x90
[   20.114932]  asm_sysvec_apic_timer_interrupt+0x1f/0x30
[   20.115813] 
[   20.116435] The buggy address belongs to the object at ffff888101094f00
[   20.116435]  which belongs to the cache kmalloc-16 of size 16
[   20.117995] The buggy address is located 15 bytes to the right of
[   20.117995]  allocated 16-byte region [ffff888101094f00, ffff888101094f10)
[   20.119887] 
[   20.120285] The buggy address belongs to the physical page:
[   20.121045] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x101094
[   20.122067] flags: 0x200000000000000(node=0|zone=2)
[   20.122657] page_type: f5(slab)
[   20.123333] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000
[   20.124216] raw: 0000000000000000 0000000080800080 00000001f5000000 0000000000000000
[   20.124917] page dumped because: kasan: bad access detected
[   20.125441] 
[   20.125789] Memory state around the buggy address:
[   20.126353]  ffff888101094e00: fa fb fc fc 00 02 fc fc 00 02 fc fc fa fb fc fc
[   20.127298]  ffff888101094e80: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   20.128221] >ffff888101094f00: fa fb fc fc 00 07 fc fc fc fc fc fc fc fc fc fc
[   20.129157]                             ^
[   20.129939]  ffff888101094f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   20.130529]  ffff888101095000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   20.131412] ==================================================================