================================================================== BUG: KASAN: slab-out-of-bounds in __lock_acquire+0x41b9/0x5f30 kernel/locking/lockdep.c:4956 Read of size 8 at addr ffff888078eb5130 by task syz-executor.5/1311 CPU: 1 PID: 1311 Comm: syz-executor.5 Not tainted 6.4.0-rc4-syzkaller-00031-g8b817fded42d #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/25/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x150 lib/dump_stack.c:106 print_address_description.constprop.0+0x2c/0x3c0 mm/kasan/report.c:351 print_report mm/kasan/report.c:462 [inline] kasan_report+0x11c/0x130 mm/kasan/report.c:572 __lock_acquire+0x41b9/0x5f30 kernel/locking/lockdep.c:4956 lock_acquire kernel/locking/lockdep.c:5705 [inline] lock_acquire+0x1b1/0x520 kernel/locking/lockdep.c:5670 lock_sock_nested+0x3a/0xf0 net/core/sock.c:3469 lock_sock include/net/sock.h:1697 [inline] sco_conn_del+0x12c/0x2b0 net/bluetooth/sco.c:197 sco_disconn_cfm+0x75/0xb0 net/bluetooth/sco.c:1392 hci_disconn_cfm include/net/bluetooth/hci_core.h:1834 [inline] hci_conn_hash_flush+0x114/0x230 net/bluetooth/hci_conn.c:2484 hci_dev_close_sync+0x5fb/0x1200 net/bluetooth/hci_sync.c:4941 hci_dev_do_close+0x31/0x70 net/bluetooth/hci_core.c:554 hci_unregister_dev+0x1ce/0x580 net/bluetooth/hci_core.c:2703 vhci_release+0x80/0xf0 drivers/bluetooth/hci_vhci.c:669 __fput+0x27c/0xa90 fs/file_table.c:321 task_work_run+0x16f/0x270 kernel/task_work.c:179 exit_task_work include/linux/task_work.h:38 [inline] do_exit+0xad3/0x2960 kernel/exit.c:871 do_group_exit+0xd4/0x2a0 kernel/exit.c:1021 get_signal+0x2315/0x25b0 kernel/signal.c:2874 arch_do_signal_or_restart+0x79/0x5c0 arch/x86/kernel/signal.c:306 exit_to_user_mode_loop kernel/entry/common.c:168 [inline] exit_to_user_mode_prepare+0x11f/0x240 kernel/entry/common.c:204 __syscall_exit_to_user_mode_work kernel/entry/common.c:286 [inline] syscall_exit_to_user_mode+0x1d/0x50 kernel/entry/common.c:297 do_syscall_64+0x46/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f94476b0e91 Code: Unable to access opcode bytes at 0x7f94476b0e67. RSP: 002b:00007f94461fe0b0 EFLAGS: 00000293 ORIG_RAX: 00000000000000e6 RAX: fffffffffffffdfc RBX: 00007f94477ac050 RCX: 00007f94476b0e91 RDX: 00007f94461fe0f0 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 00007f94476e7ca1 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000293 R12: 0000000000000000 R13: 00007ffcc771677f R14: 00007f94461fe300 R15: 0000000000022000 Allocated by task 23903: kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:374 [inline] ____kasan_kmalloc mm/kasan/common.c:333 [inline] __kasan_kmalloc+0xa3/0xb0 mm/kasan/common.c:383 kasan_kmalloc include/linux/kasan.h:196 [inline] __do_kmalloc_node mm/slab_common.c:966 [inline] __kmalloc+0x5e/0x190 mm/slab_common.c:979 kmalloc include/linux/slab.h:563 [inline] kzalloc include/linux/slab.h:680 [inline] fib_create_info+0xdbf/0x4c00 net/ipv4/fib_semantics.c:1454 fib_table_insert+0x199/0x1be0 net/ipv4/fib_trie.c:1236 fib_magic+0x493/0x580 net/ipv4/fib_frontend.c:1104 fib_add_ifaddr+0x4bc/0x560 net/ipv4/fib_frontend.c:1148 fib_netdev_event+0x38c/0x6f0 net/ipv4/fib_frontend.c:1486 notifier_call_chain+0xb6/0x3c0 kernel/notifier.c:93 call_netdevice_notifiers_info+0xb9/0x130 net/core/dev.c:1935 call_netdevice_notifiers_extack net/core/dev.c:1973 [inline] call_netdevice_notifiers net/core/dev.c:1987 [inline] __dev_notify_flags+0x120/0x2d0 net/core/dev.c:8605 dev_change_flags+0x11b/0x170 net/core/dev.c:8643 do_setlink+0x9f4/0x3d30 net/core/rtnetlink.c:2836 __rtnl_newlink+0xd69/0x1840 net/core/rtnetlink.c:3626 rtnl_newlink+0x68/0xa0 net/core/rtnetlink.c:3673 rtnetlink_rcv_msg+0x43d/0xd50 net/core/rtnetlink.c:6395 netlink_rcv_skb+0x165/0x440 net/netlink/af_netlink.c:2546 netlink_unicast_kernel net/netlink/af_netlink.c:1339 [inline] netlink_unicast+0x547/0x7f0 net/netlink/af_netlink.c:1365 netlink_sendmsg+0x925/0xe30 net/netlink/af_netlink.c:1913 sock_sendmsg_nosec net/socket.c:724 [inline] sock_sendmsg+0xde/0x190 net/socket.c:747 __sys_sendto+0x23a/0x340 net/socket.c:2144 __do_sys_sendto net/socket.c:2156 [inline] __se_sys_sendto net/socket.c:2152 [inline] __x64_sys_sendto+0xe1/0x1b0 net/socket.c:2152 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Last potentially related work creation: kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 __kasan_record_aux_stack+0x7b/0x90 mm/kasan/generic.c:491 kvfree_call_rcu+0x70/0xad0 kernel/rcu/tree.c:3332 drop_sysctl_table+0x3c2/0x4e0 fs/proc/proc_sysctl.c:1695 unregister_sysctl_table.part.0+0x9c/0x1b0 fs/proc/proc_sysctl.c:1733 unregister_sysctl_table+0x35/0x40 fs/proc/proc_sysctl.c:1713 sysctl_route_net_exit+0x5c/0x90 net/ipv4/route.c:3635 ops_exit_list+0xb0/0x170 net/core/net_namespace.c:170 setup_net+0x7fb/0xc50 net/core/net_namespace.c:362 copy_net_ns+0x4ee/0x8e0 net/core/net_namespace.c:491 create_new_namespaces+0x3f6/0xb20 kernel/nsproxy.c:110 unshare_nsproxy_namespaces+0xc1/0x1f0 kernel/nsproxy.c:228 ksys_unshare+0x449/0x920 kernel/fork.c:3444 __do_sys_unshare kernel/fork.c:3515 [inline] __se_sys_unshare kernel/fork.c:3513 [inline] __x64_sys_unshare+0x31/0x40 kernel/fork.c:3513 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Second to last potentially related work creation: kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 __kasan_record_aux_stack+0x7b/0x90 mm/kasan/generic.c:491 kvfree_call_rcu+0x70/0xad0 kernel/rcu/tree.c:3332 drop_sysctl_table+0x3c2/0x4e0 fs/proc/proc_sysctl.c:1695 unregister_sysctl_table.part.0+0x9c/0x1b0 fs/proc/proc_sysctl.c:1733 unregister_sysctl_table+0x35/0x40 fs/proc/proc_sysctl.c:1713 mpls_dev_sysctl_unregister net/mpls/af_mpls.c:1445 [inline] mpls_dev_notify+0x672/0x9a0 net/mpls/af_mpls.c:1657 notifier_call_chain+0xb6/0x3c0 kernel/notifier.c:93 call_netdevice_notifiers_info+0xb9/0x130 net/core/dev.c:1935 call_netdevice_notifiers_extack net/core/dev.c:1973 [inline] call_netdevice_notifiers net/core/dev.c:1987 [inline] unregister_netdevice_many_notify+0x75f/0x18c0 net/core/dev.c:10882 unregister_netdevice_many net/core/dev.c:10938 [inline] unregister_netdevice_queue+0x2e5/0x3c0 net/core/dev.c:10818 unregister_netdevice include/linux/netdevice.h:3109 [inline] __tun_detach+0x10a3/0x1400 drivers/net/tun.c:684 tun_detach drivers/net/tun.c:700 [inline] tun_chr_close+0xc8/0x240 drivers/net/tun.c:3491 __fput+0x27c/0xa90 fs/file_table.c:321 task_work_run+0x16f/0x270 kernel/task_work.c:179 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] exit_to_user_mode_loop kernel/entry/common.c:171 [inline] exit_to_user_mode_prepare+0x210/0x240 kernel/entry/common.c:204 __syscall_exit_to_user_mode_work kernel/entry/common.c:286 [inline] syscall_exit_to_user_mode+0x1d/0x50 kernel/entry/common.c:297 do_syscall_64+0x46/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x63/0xcd The buggy address belongs to the object at ffff888078eb5000 which belongs to the cache kmalloc-256 of size 256 The buggy address is located 56 bytes to the right of allocated 248-byte region [ffff888078eb5000, ffff888078eb50f8) The buggy address belongs to the physical page: page:ffffea0001e3ad40 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x78eb5 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) page_type: 0x8() raw: 00fff00000000200 ffff888012440500 ffffea0000898150 ffffea00010a0ad0 raw: 0000000000000000 ffff888078eb5000 0000000100000008 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x3420c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_COMP|__GFP_HARDWALL|__GFP_THISNODE), pid 9261, tgid 9260 (syz-executor.0), ts 620640340535, free_ts 620276971739 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x2db/0x350 mm/page_alloc.c:1731 prep_new_page mm/page_alloc.c:1738 [inline] get_page_from_freelist+0xf41/0x2c00 mm/page_alloc.c:3502 __alloc_pages+0x1cb/0x4a0 mm/page_alloc.c:4768 __alloc_pages_node include/linux/gfp.h:237 [inline] kmem_getpages mm/slab.c:1360 [inline] cache_grow_begin+0x9b/0x3b0 mm/slab.c:2569 cache_alloc_refill+0x27f/0x380 mm/slab.c:2942 ____cache_alloc mm/slab.c:3018 [inline] ____cache_alloc mm/slab.c:3001 [inline] __do_cache_alloc mm/slab.c:3201 [inline] slab_alloc_node mm/slab.c:3249 [inline] __kmem_cache_alloc_node+0x360/0x3f0 mm/slab.c:3540 __do_kmalloc_node mm/slab_common.c:965 [inline] __kmalloc+0x4e/0x190 mm/slab_common.c:979 kmalloc_array include/linux/slab.h:596 [inline] kcalloc include/linux/slab.h:627 [inline] iter_file_splice_write+0x16c/0xc80 fs/splice.c:735 do_splice_from fs/splice.c:873 [inline] direct_splice_actor+0x114/0x180 fs/splice.c:1039 splice_direct_to_actor+0x335/0x8a0 fs/splice.c:994 do_splice_direct+0x1ab/0x280 fs/splice.c:1082 do_sendfile+0xb19/0x12c0 fs/read_write.c:1254 __do_sys_sendfile64 fs/read_write.c:1316 [inline] __se_sys_sendfile64 fs/read_write.c:1308 [inline] __x64_sys_sendfile64+0x14d/0x210 fs/read_write.c:1308 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1302 [inline] free_unref_page_prepare+0x62e/0xcb0 mm/page_alloc.c:2564 free_unref_page+0x33/0x370 mm/page_alloc.c:2659 vfree+0x180/0x7e0 mm/vmalloc.c:2798 delayed_vfree_work+0x57/0x70 mm/vmalloc.c:2719 process_one_work+0x99a/0x15e0 kernel/workqueue.c:2405 worker_thread+0x67d/0x10c0 kernel/workqueue.c:2552 kthread+0x344/0x440 kernel/kthread.c:379 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 Memory state around the buggy address: ffff888078eb5000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888078eb5080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc >ffff888078eb5100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff888078eb5180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888078eb5200: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================