================================================================== BUG: KASAN: use-after-free in __lock_acquire+0xda/0x2b00 kernel/locking/lockdep.c:4885 Read of size 8 at addr ffff888078acf120 by task syz-executor.5/17406 CPU: 0 PID: 17406 Comm: syz-executor.5 Not tainted 5.15.0-rc6-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1dc/0x2d8 lib/dump_stack.c:106 print_address_description+0x66/0x3e0 mm/kasan/report.c:256 __kasan_report mm/kasan/report.c:442 [inline] kasan_report+0x19a/0x1f0 mm/kasan/report.c:459 __lock_acquire+0xda/0x2b00 kernel/locking/lockdep.c:4885 lock_acquire+0x19f/0x4d0 kernel/locking/lockdep.c:5625 lock_sock_nested+0x4a/0x100 net/core/sock.c:3203 l2cap_sock_teardown_cb+0x76/0x360 net/bluetooth/l2cap_sock.c:1528 l2cap_chan_del+0xaf/0x610 net/bluetooth/l2cap_core.c:622 l2cap_conn_del+0x406/0x650 net/bluetooth/l2cap_core.c:1898 hci_disconn_cfm include/net/bluetooth/hci_core.h:1518 [inline] hci_conn_hash_flush+0x112/0x240 net/bluetooth/hci_conn.c:1608 hci_dev_do_close+0x93e/0xeb0 net/bluetooth/hci_core.c:1793 hci_unregister_dev+0x2a2/0x510 net/bluetooth/hci_core.c:4029 vhci_release+0x73/0xc0 drivers/bluetooth/hci_vhci.c:340 __fput+0x3fe/0x870 fs/file_table.c:280 task_work_run+0x146/0x1c0 kernel/task_work.c:164 exit_task_work include/linux/task_work.h:32 [inline] do_exit+0x6ff/0x24e0 kernel/exit.c:825 do_group_exit+0x168/0x2d0 kernel/exit.c:922 get_signal+0x16e0/0x20c0 kernel/signal.c:2868 arch_do_signal_or_restart+0x9c/0x730 arch/x86/kernel/signal.c:865 handle_signal_work kernel/entry/common.c:148 [inline] exit_to_user_mode_loop kernel/entry/common.c:172 [inline] exit_to_user_mode_prepare+0x191/0x220 kernel/entry/common.c:207 __syscall_exit_to_user_mode_work kernel/entry/common.c:289 [inline] syscall_exit_to_user_mode+0x2e/0x70 kernel/entry/common.c:300 do_syscall_64+0x53/0xd0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7fb88bca0a39 Code: Unable to access opcode bytes at RIP 0x7fb88bca0a0f. RSP: 002b:00007fb889216188 EFLAGS: 00000246 ORIG_RAX: 000000000000010f RAX: fffffffffffffdfe RBX: 00007fb88bda3f60 RCX: 00007fb88bca0a39 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 00007fb88bcfac5f R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fff8a99a16f R14: 00007fb889216300 R15: 0000000000022000 Allocated by task 23848: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:434 [inline] ____kasan_kmalloc+0xdc/0x110 mm/kasan/common.c:513 kasan_kmalloc include/linux/kasan.h:264 [inline] __kmalloc+0x24d/0x370 mm/slub.c:4400 kmalloc include/linux/slab.h:596 [inline] sk_prot_alloc+0xf4/0x230 net/core/sock.c:1839 sk_alloc+0x35/0x300 net/core/sock.c:1892 l2cap_sock_alloc+0x34/0x1d0 net/bluetooth/l2cap_sock.c:1813 l2cap_sock_create+0x113/0x1d0 net/bluetooth/l2cap_sock.c:1859 bt_sock_create+0x15b/0x220 net/bluetooth/af_bluetooth.c:130 __sock_create+0x580/0x8d0 net/socket.c:1464 sock_create net/socket.c:1515 [inline] __sys_socket+0x133/0x380 net/socket.c:1557 __do_sys_socket net/socket.c:1566 [inline] __se_sys_socket net/socket.c:1564 [inline] __x64_sys_socket+0x76/0x80 net/socket.c:1564 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae Freed by task 23848: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track+0x4c/0x80 mm/kasan/common.c:46 kasan_set_free_info+0x1f/0x40 mm/kasan/generic.c:360 ____kasan_slab_free+0x10d/0x150 mm/kasan/common.c:366 kasan_slab_free include/linux/kasan.h:230 [inline] slab_free_hook mm/slub.c:1700 [inline] slab_free_freelist_hook+0x12e/0x1a0 mm/slub.c:1726 slab_free mm/slub.c:3492 [inline] kfree+0xe1/0x310 mm/slub.c:4552 sk_prot_free net/core/sock.c:1875 [inline] __sk_destruct+0x575/0x820 net/core/sock.c:1961 l2cap_sock_release+0x149/0x1c0 net/bluetooth/l2cap_sock.c:1397 __sock_release net/socket.c:649 [inline] sock_close+0xd8/0x260 net/socket.c:1314 __fput+0x3fe/0x870 fs/file_table.c:280 task_work_run+0x146/0x1c0 kernel/task_work.c:164 get_signal+0x2014/0x20c0 kernel/signal.c:2641 arch_do_signal_or_restart+0x9c/0x730 arch/x86/kernel/signal.c:865 handle_signal_work kernel/entry/common.c:148 [inline] exit_to_user_mode_loop kernel/entry/common.c:172 [inline] exit_to_user_mode_prepare+0x191/0x220 kernel/entry/common.c:207 __syscall_exit_to_user_mode_work kernel/entry/common.c:289 [inline] syscall_exit_to_user_mode+0x2e/0x70 kernel/entry/common.c:300 do_syscall_64+0x53/0xd0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x44/0xae Last potentially related work creation: kasan_save_stack+0x36/0x60 mm/kasan/common.c:38 kasan_record_aux_stack+0xf1/0x130 mm/kasan/generic.c:348 kvfree_call_rcu+0x11b/0x880 kernel/rcu/tree.c:3552 drop_sysctl_table+0x2cd/0x400 fs/proc/proc_sysctl.c:1647 unregister_sysctl_table+0x88/0x130 fs/proc/proc_sysctl.c:1685 __devinet_sysctl_unregister net/ipv4/devinet.c:2600 [inline] devinet_sysctl_unregister net/ipv4/devinet.c:2628 [inline] inetdev_destroy net/ipv4/devinet.c:324 [inline] inetdev_event+0x71d/0x1410 net/ipv4/devinet.c:1598 notifier_call_chain kernel/notifier.c:83 [inline] raw_notifier_call_chain+0xe7/0x170 kernel/notifier.c:391 call_netdevice_notifiers_info net/core/dev.c:1996 [inline] call_netdevice_notifiers_extack net/core/dev.c:2008 [inline] call_netdevice_notifiers net/core/dev.c:2022 [inline] unregister_netdevice_many+0xfae/0x19e0 net/core/dev.c:11043 vti6_exit_batch_net+0x402/0x450 net/ipv6/ip6_vti.c:1188 ops_exit_list net/core/net_namespace.c:171 [inline] cleanup_net+0x7ec/0xc50 net/core/net_namespace.c:591 process_one_work+0x853/0x1140 kernel/workqueue.c:2297 worker_thread+0xac1/0x1320 kernel/workqueue.c:2444 kthread+0x453/0x480 kernel/kthread.c:319 ret_from_fork+0x1f/0x30 Second to last potentially related work creation: kasan_save_stack+0x36/0x60 mm/kasan/common.c:38 kasan_record_aux_stack+0xf1/0x130 mm/kasan/generic.c:348 __call_rcu kernel/rcu/tree.c:2987 [inline] call_rcu+0x1c4/0xa80 kernel/rcu/tree.c:3067 netlink_release+0x132d/0x1790 net/netlink/af_netlink.c:815 __sock_release net/socket.c:649 [inline] sock_close+0xd8/0x260 net/socket.c:1314 __fput+0x3fe/0x870 fs/file_table.c:280 task_work_run+0x146/0x1c0 kernel/task_work.c:164 tracehook_notify_resume include/linux/tracehook.h:189 [inline] exit_to_user_mode_loop kernel/entry/common.c:175 [inline] exit_to_user_mode_prepare+0x209/0x220 kernel/entry/common.c:207 __syscall_exit_to_user_mode_work kernel/entry/common.c:289 [inline] syscall_exit_to_user_mode+0x2e/0x70 kernel/entry/common.c:300 do_syscall_64+0x53/0xd0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x44/0xae The buggy address belongs to the object at ffff888078acf000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 288 bytes inside of 2048-byte region [ffff888078acf000, ffff888078acf800) The buggy address belongs to the page: page:ffffea0001e2b200 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x78ac8 head:ffffea0001e2b200 order:3 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 dead000000000100 dead000000000122 ffff888011042000 raw: 0000000000000000 0000000000080008 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 2969, ts 100795616371, free_ts 100784982898 prep_new_page mm/page_alloc.c:2424 [inline] get_page_from_freelist+0x779/0xa30 mm/page_alloc.c:4153 __alloc_pages+0x255/0x580 mm/page_alloc.c:5375 alloc_slab_page mm/slub.c:1770 [inline] allocate_slab+0xcc/0x4d0 mm/slub.c:1907 new_slab mm/slub.c:1970 [inline] ___slab_alloc+0x41e/0xc40 mm/slub.c:3001 __slab_alloc mm/slub.c:3088 [inline] slab_alloc_node mm/slub.c:3179 [inline] slab_alloc mm/slub.c:3221 [inline] __kmalloc+0x2e9/0x370 mm/slub.c:4396 kmalloc include/linux/slab.h:596 [inline] sk_prot_alloc+0xf4/0x230 net/core/sock.c:1839 sk_alloc+0x35/0x300 net/core/sock.c:1892 __netlink_create+0x68/0x230 net/netlink/af_netlink.c:643 netlink_create+0x368/0x4f0 net/netlink/af_netlink.c:706 __sock_create+0x580/0x8d0 net/socket.c:1464 sock_create net/socket.c:1515 [inline] __sys_socket+0x133/0x380 net/socket.c:1557 __do_sys_socket net/socket.c:1566 [inline] __se_sys_socket net/socket.c:1564 [inline] __x64_sys_socket+0x76/0x80 net/socket.c:1564 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1338 [inline] free_pcp_prepare+0xc29/0xd20 mm/page_alloc.c:1389 free_unref_page_prepare mm/page_alloc.c:3315 [inline] free_unref_page+0x7d/0x580 mm/page_alloc.c:3394 free_slab mm/slub.c:2010 [inline] discard_slab mm/slub.c:2016 [inline] __unfreeze_partials+0x1ab/0x200 mm/slub.c:2502 put_cpu_partial+0x132/0x1a0 mm/slub.c:2582 do_slab_free mm/slub.c:3480 [inline] ___cache_free+0xe6/0x120 mm/slub.c:3499 qlist_free_all mm/kasan/quarantine.c:165 [inline] kasan_quarantine_reduce+0x151/0x1c0 mm/kasan/quarantine.c:272 __kasan_slab_alloc+0x2f/0xe0 mm/kasan/common.c:444 kasan_slab_alloc include/linux/kasan.h:254 [inline] slab_post_alloc_hook mm/slab.h:519 [inline] slab_alloc_node mm/slub.c:3213 [inline] slab_alloc mm/slub.c:3221 [inline] kmem_cache_alloc_trace+0x205/0x310 mm/slub.c:3238 kmalloc include/linux/slab.h:591 [inline] tomoyo_print_header security/tomoyo/audit.c:156 [inline] tomoyo_init_log+0x1ab/0x1ee0 security/tomoyo/audit.c:255 tomoyo_supervisor+0x3c8/0x1300 security/tomoyo/common.c:2097 tomoyo_audit_path_number_log security/tomoyo/file.c:235 [inline] tomoyo_path_number_perm+0x563/0x7c0 security/tomoyo/file.c:734 security_file_ioctl+0x55/0xb0 security/security.c:1540 __do_sys_ioctl fs/ioctl.c:868 [inline] __se_sys_ioctl+0x48/0x170 fs/ioctl.c:860 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae Memory state around the buggy address: ffff888078acf000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888078acf080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888078acf100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888078acf180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888078acf200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================