================================================================== BUG: KASAN: slab-use-after-free in __lock_acquire+0x7c/0xc70 kernel/locking/lockdep.c:5065 Read of size 8 at addr ffff88811321b020 by task syz.1.1186/7527 CPU: 0 UID: 0 PID: 7527 Comm: syz.1.1186 Not tainted 6.12.0-rc6-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x108/0x280 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:377 [inline] print_report+0x169/0x550 mm/kasan/report.c:488 kasan_report+0x143/0x180 mm/kasan/report.c:601 __lock_acquire+0x7c/0xc70 kernel/locking/lockdep.c:5065 lock_acquire+0x1a9/0x3a0 kernel/locking/lockdep.c:5825 __raw_spin_lock include/linux/spinlock_api_smp.h:133 [inline] _raw_spin_lock+0x2e/0x40 kernel/locking/spinlock.c:154 spin_lock include/linux/spinlock.h:351 [inline] sco_chan_add net/bluetooth/sco.c:292 [inline] sco_connect net/bluetooth/sco.c:345 [inline] sco_sock_connect+0x260/0x820 net/bluetooth/sco.c:645 __sys_connect_file net/socket.c:2073 [inline] __sys_connect+0x30d/0x380 net/socket.c:2090 __do_sys_connect net/socket.c:2100 [inline] __se_sys_connect net/socket.c:2097 [inline] __x64_sys_connect+0x75/0x90 net/socket.c:2097 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0x8d/0x190 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f680277e819 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f68034f9038 EFLAGS: 00000246 ORIG_RAX: 000000000000002a RAX: ffffffffffffffda RBX: 00007f6802935fa0 RCX: 00007f680277e819 RDX: 0000000000000008 RSI: 0000000020000000 RDI: 0000000000000005 RBP: 00007f68027f175e R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f6802935fa0 R15: 00007fff8059d288 Allocated by task 7513: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:377 [inline] __kasan_kmalloc+0x98/0xb0 mm/kasan/common.c:394 kasan_kmalloc include/linux/kasan.h:257 [inline] __kmalloc_cache_noprof+0x19e/0x360 mm/slub.c:4295 kmalloc_noprof include/linux/slab.h:878 [inline] kzalloc_noprof include/linux/slab.h:1014 [inline] sco_conn_add+0xce/0x320 net/bluetooth/sco.c:199 sco_connect net/bluetooth/sco.c:336 [inline] sco_sock_connect+0x242/0x820 net/bluetooth/sco.c:645 __sys_connect_file net/socket.c:2073 [inline] __sys_connect+0x30d/0x380 net/socket.c:2090 __do_sys_connect net/socket.c:2100 [inline] __se_sys_connect net/socket.c:2097 [inline] __x64_sys_connect+0x75/0x90 net/socket.c:2097 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0x8d/0x190 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 7527: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 kasan_save_free_info+0x40/0x50 mm/kasan/generic.c:579 poison_slab_object mm/kasan/common.c:247 [inline] __kasan_slab_free+0x59/0x70 mm/kasan/common.c:264 kasan_slab_free include/linux/kasan.h:230 [inline] slab_free_hook mm/slub.c:2342 [inline] slab_free mm/slub.c:4579 [inline] kfree+0x186/0x3e0 mm/slub.c:4727 sco_conn_add+0x96/0x320 net/bluetooth/sco.c:195 sco_connect net/bluetooth/sco.c:336 [inline] sco_sock_connect+0x242/0x820 net/bluetooth/sco.c:645 __sys_connect_file net/socket.c:2073 [inline] __sys_connect+0x30d/0x380 net/socket.c:2090 __do_sys_connect net/socket.c:2100 [inline] __se_sys_connect net/socket.c:2097 [inline] __x64_sys_connect+0x75/0x90 net/socket.c:2097 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0x8d/0x190 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff88811321b000 which belongs to the cache kmalloc-256 of size 256 The buggy address is located 32 bytes inside of freed 256-byte region [ffff88811321b000, ffff88811321b100) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x11321a head: order:1 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 anon flags: 0x100000000000040(head|node=0|zone=2) page_type: f5(slab) raw: 0100000000000040 ffff888100041b40 ffffea0005d3c080 dead000000000003 raw: 0000000000000000 0000000080100010 00000001f5000000 0000000000000000 head: 0100000000000040 ffff888100041b40 ffffea0005d3c080 dead000000000003 head: 0000000000000000 0000000080100010 00000001f5000000 0000000000000000 head: 0100000000000001 ffffea00044c8681 ffffffffffffffff 0000000000000000 head: 0000000000000002 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 1, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 1, tgid 1 (swapper/0), ts 6551002086, free_ts 4747367799 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x10f/0x130 mm/page_alloc.c:1537 prep_new_page mm/page_alloc.c:1545 [inline] get_page_from_freelist+0x42ac/0x4480 mm/page_alloc.c:3457 __alloc_pages_noprof+0x256/0x650 mm/page_alloc.c:4733 alloc_pages_mpol_noprof+0x289/0x4e0 mm/mempolicy.c:2265 alloc_slab_page+0x6a/0x140 mm/slub.c:2412 allocate_slab+0x5d/0x290 mm/slub.c:2578 new_slab mm/slub.c:2631 [inline] ___slab_alloc+0xa7f/0x11e0 mm/slub.c:3818 __slab_alloc mm/slub.c:3908 [inline] __slab_alloc_node mm/slub.c:3961 [inline] slab_alloc_node mm/slub.c:4122 [inline] __do_kmalloc_node mm/slub.c:4263 [inline] __kmalloc_noprof+0x25a/0x440 mm/slub.c:4276 kmalloc_noprof include/linux/slab.h:882 [inline] mpi_alloc_limb_space lib/crypto/mpi/mpiutil.c:64 [inline] mpi_alloc+0x6b/0x110 lib/crypto/mpi/mpiutil.c:39 mpi_read_raw_data+0xd8/0xa20 lib/crypto/mpi/mpicoder.c:57 rsa_set_pub_key+0x37f/0x5e0 crypto/rsa.c:287 crypto_akcipher_set_pub_key include/crypto/akcipher.h:407 [inline] pkcs1pad_set_pub_key+0xc1/0x1c0 crypto/rsa-pkcs1pad.c:138 public_key_verify_signature+0x41f/0x6f0 crypto/asymmetric_keys/public_key.c:443 x509_check_for_self_signed+0x2a5/0x370 crypto/asymmetric_keys/x509_public_key.c:125 x509_cert_parse+0x5d2/0x6f0 crypto/asymmetric_keys/x509_cert_parser.c:129 x509_key_preparse+0x60/0x630 crypto/asymmetric_keys/x509_public_key.c:157 page last free pid 43 tgid 43 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1108 [inline] free_unref_page+0xaa5/0xc80 mm/page_alloc.c:2638 vfree+0x10e/0x210 mm/vmalloc.c:3361 delayed_vfree_work+0x3c/0x70 mm/vmalloc.c:3282 process_one_work kernel/workqueue.c:3229 [inline] process_scheduled_works+0x8e8/0x1360 kernel/workqueue.c:3310 worker_thread+0x868/0xc70 kernel/workqueue.c:3391 kthread+0x268/0x2c0 kernel/kthread.c:389 ret_from_fork+0x32/0x60 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Memory state around the buggy address: ffff88811321af00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88811321af80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88811321b000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88811321b080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88811321b100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================