loop4: detected capacity change from 0 to 4096 ================================================================== BUG: KASAN: use-after-free in instrument_atomic_read_write include/linux/instrumented.h:101 [inline] BUG: KASAN: use-after-free in atomic_fetch_add_relaxed include/linux/atomic/atomic-instrumented.h:111 [inline] BUG: KASAN: use-after-free in __refcount_add include/linux/refcount.h:193 [inline] BUG: KASAN: use-after-free in __refcount_inc include/linux/refcount.h:250 [inline] BUG: KASAN: use-after-free in refcount_inc include/linux/refcount.h:267 [inline] BUG: KASAN: use-after-free in sock_hold include/net/sock.h:702 [inline] BUG: KASAN: use-after-free in sco_conn_del+0xc5/0x2b0 net/bluetooth/sco.c:193 Write of size 4 at addr ffff888078de0080 by task syz-executor.4/19275 CPU: 1 PID: 19275 Comm: syz-executor.4 Not tainted 5.15.0-rc2-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+0xcd/0x134 lib/dump_stack.c:106 print_address_description.constprop.0.cold+0x6c/0x309 mm/kasan/report.c:256 __kasan_report mm/kasan/report.c:442 [inline] kasan_report.cold+0x83/0xdf mm/kasan/report.c:459 check_region_inline mm/kasan/generic.c:183 [inline] kasan_check_range+0x13d/0x180 mm/kasan/generic.c:189 instrument_atomic_read_write include/linux/instrumented.h:101 [inline] atomic_fetch_add_relaxed include/linux/atomic/atomic-instrumented.h:111 [inline] __refcount_add include/linux/refcount.h:193 [inline] __refcount_inc include/linux/refcount.h:250 [inline] refcount_inc include/linux/refcount.h:267 [inline] sock_hold include/net/sock.h:702 [inline] sco_conn_del+0xc5/0x2b0 net/bluetooth/sco.c:193 sco_disconn_cfm+0x71/0xb0 net/bluetooth/sco.c:1205 hci_disconn_cfm include/net/bluetooth/hci_core.h:1518 [inline] hci_conn_hash_flush+0x127/0x260 net/bluetooth/hci_conn.c:1608 hci_dev_do_close+0x57d/0x1130 net/bluetooth/hci_core.c:1793 hci_rfkill_set_block+0x19c/0x1d0 net/bluetooth/hci_core.c:2233 rfkill_set_block+0x1f9/0x540 net/rfkill/core.c:344 rfkill_fop_write+0x267/0x500 net/rfkill/core.c:1268 do_loop_readv_writev fs/read_write.c:753 [inline] do_loop_readv_writev fs/read_write.c:737 [inline] do_iter_write+0x4f8/0x710 fs/read_write.c:857 vfs_writev+0x1aa/0x630 fs/read_write.c:928 do_writev+0x27f/0x300 fs/read_write.c:971 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7f55e4913739 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 bc ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f55e1e69188 EFLAGS: 00000246 ORIG_RAX: 0000000000000014 RAX: ffffffffffffffda RBX: 00007f55e4a18038 RCX: 00007f55e4913739 RDX: 0000000000000001 RSI: 0000000020000000 RDI: 0000000000000008 RBP: 00007f55e496dcc4 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f55e4a18038 R13: 00007ffdede6a58f R14: 00007f55e1e69300 R15: 0000000000022000 Allocated by task 15856: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38 kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:434 [inline] ____kasan_kmalloc mm/kasan/common.c:513 [inline] ____kasan_kmalloc mm/kasan/common.c:472 [inline] __kasan_kmalloc+0xa4/0xd0 mm/kasan/common.c:522 kmalloc include/linux/slab.h:596 [inline] sk_prot_alloc+0x110/0x290 net/core/sock.c:1822 sk_alloc+0x30/0xa60 net/core/sock.c:1875 sco_sock_alloc.constprop.0+0x31/0x220 net/bluetooth/sco.c:491 sco_sock_create+0xd5/0x1b0 net/bluetooth/sco.c:526 bt_sock_create+0x17c/0x340 net/bluetooth/af_bluetooth.c:130 __sock_create+0x353/0x790 net/socket.c:1464 sock_create net/socket.c:1515 [inline] __sys_socket+0xef/0x200 net/socket.c:1557 __do_sys_socket net/socket.c:1566 [inline] __se_sys_socket net/socket.c:1564 [inline] __x64_sys_socket+0x6f/0xb0 net/socket.c:1564 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae Last potentially related work creation: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38 kasan_record_aux_stack+0xe9/0x110 mm/kasan/generic.c:348 kvfree_call_rcu+0x74/0x990 kernel/rcu/tree.c:3552 drop_sysctl_table+0x3c0/0x4e0 fs/proc/proc_sysctl.c:1647 unregister_sysctl_table fs/proc/proc_sysctl.c:1685 [inline] unregister_sysctl_table+0xc2/0x190 fs/proc/proc_sysctl.c:1660 __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+0xcac/0x15d0 net/ipv4/devinet.c:1598 notifier_call_chain+0xb5/0x200 kernel/notifier.c:83 call_netdevice_notifiers_info+0xb5/0x130 net/core/dev.c:1996 call_netdevice_notifiers_extack net/core/dev.c:2008 [inline] call_netdevice_notifiers net/core/dev.c:2022 [inline] unregister_netdevice_many+0x951/0x1790 net/core/dev.c:11039 default_device_exit_batch+0x2fa/0x3c0 net/core/dev.c:11569 ops_exit_list+0x10d/0x160 net/core/net_namespace.c:171 cleanup_net+0x4ea/0xb00 net/core/net_namespace.c:591 process_one_work+0x9bf/0x16b0 kernel/workqueue.c:2297 worker_thread+0x658/0x11f0 kernel/workqueue.c:2444 kthread+0x3e5/0x4d0 kernel/kthread.c:319 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 The buggy address belongs to the object at ffff888078de0000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 128 bytes inside of 2048-byte region [ffff888078de0000, ffff888078de0800) The buggy address belongs to the page: page:ffffea0001e37800 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888078de2000 pfn:0x78de0 head:ffffea0001e37800 order:3 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 ffffea0000e3ac08 ffffea0000971208 ffff888010c42000 raw: ffff888078de2000 0000000000080006 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 0xd28c0(GFP_NOWAIT|__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 19121, ts 687398749854, free_ts 686916754999 prep_new_page mm/page_alloc.c:2424 [inline] get_page_from_freelist+0xa72/0x2f80 mm/page_alloc.c:4153 __alloc_pages+0x1b2/0x500 mm/page_alloc.c:5375 alloc_pages+0x1a7/0x300 mm/mempolicy.c:2197 alloc_slab_page mm/slub.c:1763 [inline] allocate_slab mm/slub.c:1900 [inline] new_slab+0x319/0x490 mm/slub.c:1963 ___slab_alloc+0x921/0xfe0 mm/slub.c:2994 __slab_alloc.constprop.0+0x4d/0xa0 mm/slub.c:3081 slab_alloc_node mm/slub.c:3172 [inline] __kmalloc_node_track_caller+0x2d2/0x340 mm/slub.c:4936 kmalloc_reserve net/core/skbuff.c:355 [inline] pskb_expand_head+0x15e/0x1060 net/core/skbuff.c:1700 netlink_trim+0x1ea/0x240 net/netlink/af_netlink.c:1296 netlink_broadcast_filtered+0x65/0xdc0 net/netlink/af_netlink.c:1501 netlink_broadcast net/netlink/af_netlink.c:1546 [inline] nlmsg_multicast include/net/netlink.h:1033 [inline] nlmsg_notify+0x94/0x290 net/netlink/af_netlink.c:2547 rtnl_notify net/core/rtnetlink.c:730 [inline] rtmsg_ifinfo_send net/core/rtnetlink.c:3833 [inline] rtmsg_ifinfo_event net/core/rtnetlink.c:3848 [inline] rtmsg_ifinfo_event net/core/rtnetlink.c:3836 [inline] rtnetlink_event+0x193/0x1d0 net/core/rtnetlink.c:5623 notifier_call_chain+0xb5/0x200 kernel/notifier.c:83 call_netdevice_notifiers_info+0xb5/0x130 net/core/dev.c:1996 __netdev_upper_dev_link+0x3fd/0x7f0 net/core/dev.c:8103 netdev_upper_dev_link+0x8a/0xc0 net/core/dev.c:8144 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+0x2c5/0x780 mm/page_alloc.c:1389 free_unref_page_prepare mm/page_alloc.c:3315 [inline] free_unref_page+0x19/0x690 mm/page_alloc.c:3394 __unfreeze_partials+0x340/0x360 mm/slub.c:2495 qlink_free mm/kasan/quarantine.c:146 [inline] qlist_free_all+0x5a/0xc0 mm/kasan/quarantine.c:165 kasan_quarantine_reduce+0x180/0x200 mm/kasan/quarantine.c:272 __kasan_slab_alloc+0x95/0xb0 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:3206 [inline] slab_alloc mm/slub.c:3214 [inline] kmem_cache_alloc_trace+0x1f1/0x2b0 mm/slub.c:3231 kmalloc include/linux/slab.h:591 [inline] kzalloc include/linux/slab.h:721 [inline] call_usermodehelper_setup+0x97/0x340 kernel/umh.c:365 kobject_uevent_env+0xf73/0x1650 lib/kobject_uevent.c:614 rx_queue_add_kobject net/core/net-sysfs.c:1020 [inline] net_rx_queue_update_kobjects+0xf8/0x500 net/core/net-sysfs.c:1060 register_queue_kobjects net/core/net-sysfs.c:1711 [inline] netdev_register_kobject+0x275/0x430 net/core/net-sysfs.c:1959 register_netdevice+0xd33/0x1500 net/core/dev.c:10295 ip6gre_newlink_common.constprop.0+0x15a/0x380 net/ipv6/ip6_gre.c:1984 ip6gre_newlink+0x21f/0x7d0 net/ipv6/ip6_gre.c:2015 __rtnl_newlink+0x106d/0x1750 net/core/rtnetlink.c:3458 rtnl_newlink+0x64/0xa0 net/core/rtnetlink.c:3506 Memory state around the buggy address: ffff888078ddff80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888078de0000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888078de0080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888078de0100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888078de0180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================