================================================================== BUG: KASAN: slab-use-after-free in hci_send_acl+0x9f8/0xac0 net/bluetooth/hci_core.c:3234 Read of size 8 at addr ffff8880197ff718 by task kworker/1:13/6266 CPU: 1 PID: 6266 Comm: kworker/1:13 Not tainted 6.7.0-rc4-syzkaller-00867-g68c84289bcc0 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/10/2023 Workqueue: events l2cap_info_timeout Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:364 [inline] print_report+0xc4/0x620 mm/kasan/report.c:475 kasan_report+0xda/0x110 mm/kasan/report.c:588 hci_send_acl+0x9f8/0xac0 net/bluetooth/hci_core.c:3234 l2cap_send_cmd+0x6dd/0x920 net/bluetooth/l2cap_core.c:977 l2cap_send_conn_req+0x1e5/0x260 net/bluetooth/l2cap_core.c:1286 l2cap_start_connection+0x11e/0x420 net/bluetooth/l2cap_core.c:1514 l2cap_conn_start+0x7ae/0xa40 net/bluetooth/l2cap_core.c:1661 process_one_work+0x886/0x15d0 kernel/workqueue.c:2627 process_scheduled_works kernel/workqueue.c:2700 [inline] worker_thread+0x8b9/0x1290 kernel/workqueue.c:2781 kthread+0x2c6/0x3a0 kernel/kthread.c:388 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:242 Allocated by task 31271: kasan_save_stack+0x33/0x50 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+0xa2/0xb0 mm/kasan/common.c:383 kmalloc include/linux/slab.h:600 [inline] kzalloc include/linux/slab.h:721 [inline] hci_chan_create+0xa6/0x3d0 net/bluetooth/hci_conn.c:2770 l2cap_conn_add.part.0+0x1a/0xdf0 net/bluetooth/l2cap_core.c:7841 l2cap_conn_add include/net/bluetooth/hci_core.h:1545 [inline] l2cap_chan_connect+0x15de/0x2170 net/bluetooth/l2cap_core.c:8053 l2cap_sock_connect+0x33f/0x720 net/bluetooth/l2cap_sock.c:256 kernel_connect+0x103/0x170 net/socket.c:3625 rfcomm_session_create net/bluetooth/rfcomm/core.c:811 [inline] __rfcomm_dlc_open net/bluetooth/rfcomm/core.c:388 [inline] rfcomm_dlc_open+0x81f/0xaa0 net/bluetooth/rfcomm/core.c:431 rfcomm_sock_connect+0x430/0x640 net/bluetooth/rfcomm/sock.c:409 __sys_connect_file+0x15b/0x1a0 net/socket.c:2046 __sys_connect+0x145/0x170 net/socket.c:2063 __do_sys_connect net/socket.c:2073 [inline] __se_sys_connect net/socket.c:2070 [inline] __x64_sys_connect+0x72/0xb0 net/socket.c:2070 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0x40/0x110 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x63/0x6b Freed by task 5105: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 kasan_save_free_info+0x2b/0x40 mm/kasan/generic.c:522 ____kasan_slab_free mm/kasan/common.c:236 [inline] ____kasan_slab_free+0x15b/0x1b0 mm/kasan/common.c:200 kasan_slab_free include/linux/kasan.h:164 [inline] slab_free_hook mm/slub.c:1800 [inline] slab_free_freelist_hook+0x114/0x1e0 mm/slub.c:1826 slab_free mm/slub.c:3809 [inline] __kmem_cache_free+0xc0/0x180 mm/slub.c:3822 hci_chan_list_flush+0x81/0xf0 net/bluetooth/hci_conn.c:2810 hci_conn_cleanup net/bluetooth/hci_conn.c:152 [inline] hci_conn_del+0x209/0xe10 net/bluetooth/hci_conn.c:1182 hci_abort_conn_sync+0x758/0xb50 net/bluetooth/hci_sync.c:5424 abort_conn_sync+0x187/0x390 net/bluetooth/hci_conn.c:2957 hci_cmd_sync_work+0x1a4/0x410 net/bluetooth/hci_sync.c:306 process_one_work+0x886/0x15d0 kernel/workqueue.c:2627 process_scheduled_works kernel/workqueue.c:2700 [inline] worker_thread+0x8b9/0x1290 kernel/workqueue.c:2781 kthread+0x2c6/0x3a0 kernel/kthread.c:388 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:242 Last potentially related work creation: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 __kasan_record_aux_stack+0xbc/0xd0 mm/kasan/generic.c:492 kvfree_call_rcu+0x70/0xbe0 kernel/rcu/tree.c:3400 __hw_addr_del_entry+0x211/0x390 net/core/dev_addr_lists.c:161 __hw_addr_del_ex+0x1cc/0x230 net/core/dev_addr_lists.c:200 __dev_mc_del net/core/dev_addr_lists.c:908 [inline] dev_mc_del+0xba/0x100 net/core/dev_addr_lists.c:926 igmp6_group_dropped+0x337/0xe40 net/ipv6/mcast.c:715 ipv6_mc_down+0xb2/0x4f0 net/ipv6/mcast.c:2716 addrconf_ifdown.isra.0+0x1815/0x1c60 net/ipv6/addrconf.c:3949 addrconf_notify+0x223/0x19c0 net/ipv6/addrconf.c:3727 notifier_call_chain+0xb6/0x3b0 kernel/notifier.c:93 call_netdevice_notifiers_info+0xbe/0x130 net/core/dev.c:1966 call_netdevice_notifiers_extack net/core/dev.c:2004 [inline] call_netdevice_notifiers net/core/dev.c:2018 [inline] __dev_notify_flags+0x1f5/0x2e0 net/core/dev.c:8683 dev_change_flags+0x10c/0x160 net/core/dev.c:8719 do_setlink+0x1a73/0x4090 net/core/rtnetlink.c:2916 rtnl_group_changelink net/core/rtnetlink.c:3458 [inline] __rtnl_newlink+0xe04/0x1940 net/core/rtnetlink.c:3717 rtnl_newlink+0x67/0xa0 net/core/rtnetlink.c:3754 rtnetlink_rcv_msg+0x3c7/0xe00 net/core/rtnetlink.c:6566 netlink_rcv_skb+0x16b/0x440 net/netlink/af_netlink.c:2544 netlink_unicast_kernel net/netlink/af_netlink.c:1341 [inline] netlink_unicast+0x53b/0x810 net/netlink/af_netlink.c:1367 netlink_sendmsg+0x8b7/0xd70 net/netlink/af_netlink.c:1909 sock_sendmsg_nosec net/socket.c:730 [inline] __sock_sendmsg+0xd5/0x180 net/socket.c:745 ____sys_sendmsg+0x6ac/0x940 net/socket.c:2584 ___sys_sendmsg+0x135/0x1d0 net/socket.c:2638 __sys_sendmsg+0x117/0x1e0 net/socket.c:2667 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0x40/0x110 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x63/0x6b Second to last potentially related work creation: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 __kasan_record_aux_stack+0xbc/0xd0 mm/kasan/generic.c:492 kvfree_call_rcu+0x70/0xbe0 kernel/rcu/tree.c:3400 kernfs_unlink_open_file+0x3b6/0x4b0 fs/kernfs/file.c:584 kernfs_fop_release+0xec/0x1e0 fs/kernfs/file.c:756 __fput+0x270/0xbb0 fs/file_table.c:394 __fput_sync+0x47/0x50 fs/file_table.c:475 __do_sys_close fs/open.c:1590 [inline] __se_sys_close fs/open.c:1575 [inline] __x64_sys_close+0x87/0xf0 fs/open.c:1575 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0x40/0x110 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x63/0x6b The buggy address belongs to the object at ffff8880197ff700 which belongs to the cache kmalloc-128 of size 128 The buggy address is located 24 bytes inside of freed 128-byte region [ffff8880197ff700, ffff8880197ff780) The buggy address belongs to the physical page: page:ffffea000065ffc0 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x197ff anon flags: 0xfff00000000800(slab|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000000800 ffff8880130418c0 0000000000000000 dead000000000001 raw: 0000000000000000 0000000000100010 00000001ffffffff 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 0x112cc0(GFP_USER|__GFP_NOWARN|__GFP_NORETRY), pid 4515, tgid 4515 (udevd), ts 176719662041, free_ts 176712494450 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x2d0/0x350 mm/page_alloc.c:1544 prep_new_page mm/page_alloc.c:1551 [inline] get_page_from_freelist+0xa28/0x3730 mm/page_alloc.c:3319 __alloc_pages+0x22e/0x2420 mm/page_alloc.c:4575 alloc_pages_mpol+0x258/0x5f0 mm/mempolicy.c:2133 alloc_slab_page mm/slub.c:1870 [inline] allocate_slab mm/slub.c:2017 [inline] new_slab+0x283/0x3c0 mm/slub.c:2070 ___slab_alloc+0x979/0x1500 mm/slub.c:3223 __slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3322 __slab_alloc_node mm/slub.c:3375 [inline] slab_alloc_node mm/slub.c:3468 [inline] __kmem_cache_alloc_node+0x131/0x310 mm/slub.c:3517 kmalloc_trace+0x25/0x60 mm/slab_common.c:1098 kmalloc include/linux/slab.h:600 [inline] kzalloc include/linux/slab.h:721 [inline] kernfs_get_open_node fs/kernfs/file.c:523 [inline] kernfs_fop_open+0xa17/0xd30 fs/kernfs/file.c:691 do_dentry_open+0x8d6/0x18c0 fs/open.c:948 do_open fs/namei.c:3622 [inline] path_openat+0x1e5a/0x2c50 fs/namei.c:3779 do_filp_open+0x1de/0x430 fs/namei.c:3809 do_sys_openat2+0x176/0x1e0 fs/open.c:1440 do_sys_open fs/open.c:1455 [inline] __do_sys_openat fs/open.c:1471 [inline] __se_sys_openat fs/open.c:1466 [inline] __x64_sys_openat+0x175/0x210 fs/open.c:1466 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0x40/0x110 arch/x86/entry/common.c:83 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1144 [inline] free_unref_page_prepare+0x53c/0xb80 mm/page_alloc.c:2354 free_unref_page+0x33/0x3b0 mm/page_alloc.c:2494 qlink_free mm/kasan/quarantine.c:168 [inline] qlist_free_all+0x6a/0x170 mm/kasan/quarantine.c:187 kasan_quarantine_reduce+0x18e/0x1d0 mm/kasan/quarantine.c:294 __kasan_slab_alloc+0x65/0x90 mm/kasan/common.c:305 kasan_slab_alloc include/linux/kasan.h:188 [inline] slab_post_alloc_hook mm/slab.h:763 [inline] slab_alloc_node mm/slub.c:3478 [inline] kmem_cache_alloc_node+0x180/0x330 mm/slub.c:3523 __alloc_skb+0x287/0x330 net/core/skbuff.c:641 alloc_skb_fclone include/linux/skbuff.h:1348 [inline] tcp_stream_alloc_skb+0x34/0x560 net/ipv4/tcp.c:871 tcp_sendmsg_locked+0xea9/0x3440 net/ipv4/tcp.c:1153 tcp_sendmsg+0x2e/0x40 net/ipv4/tcp.c:1340 inet_sendmsg+0x9d/0xe0 net/ipv4/af_inet.c:847 sock_sendmsg_nosec net/socket.c:730 [inline] __sock_sendmsg+0xd5/0x180 net/socket.c:745 sock_write_iter+0x29b/0x3d0 net/socket.c:1158 call_write_iter include/linux/fs.h:2020 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x64f/0xdf0 fs/read_write.c:584 ksys_write+0x1f0/0x250 fs/read_write.c:637 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0x40/0x110 arch/x86/entry/common.c:83 Memory state around the buggy address: ffff8880197ff600: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8880197ff680: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8880197ff700: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880197ff780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8880197ff800: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================