================================================================== BUG: KASAN: slab-use-after-free in __lock_acquire+0x78/0x2100 kernel/locking/lockdep.c:5089 Read of size 8 at addr ffff8880249282f0 by task kworker/0:4/6240 CPU: 0 UID: 0 PID: 6240 Comm: kworker/0:4 Not tainted 6.13.0-rc2-syzkaller-gfac04efc5c79 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Workqueue: events l2cap_chan_timeout Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0x169/0x550 mm/kasan/report.c:489 kasan_report+0x143/0x180 mm/kasan/report.c:602 __lock_acquire+0x78/0x2100 kernel/locking/lockdep.c:5089 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5849 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0xd5/0x120 kernel/locking/spinlock.c:162 __mutex_lock_common kernel/locking/mutex.c:599 [inline] __mutex_lock+0x440/0xee0 kernel/locking/mutex.c:735 l2cap_chan_timeout+0x63/0x360 net/bluetooth/l2cap_core.c:421 process_one_work kernel/workqueue.c:3229 [inline] process_scheduled_works+0xa66/0x1840 kernel/workqueue.c:3310 worker_thread+0x870/0xd30 kernel/workqueue.c:3391 kthread+0x2f0/0x390 kernel/kthread.c:389 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Allocated by task 17820: 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:260 [inline] __kmalloc_cache_noprof+0x243/0x390 mm/slub.c:4314 kmalloc_noprof include/linux/slab.h:901 [inline] kzalloc_noprof include/linux/slab.h:1037 [inline] l2cap_conn_add+0xa9/0x8e0 net/bluetooth/l2cap_core.c:6860 l2cap_chan_connect+0x623/0xeb0 net/bluetooth/l2cap_core.c:7051 l2cap_sock_connect+0x5c9/0x800 net/bluetooth/l2cap_sock.c:256 __sys_connect_file net/socket.c:2055 [inline] __sys_connect+0x288/0x2d0 net/socket.c:2074 __do_sys_connect net/socket.c:2080 [inline] __se_sys_connect net/socket.c:2077 [inline] __x64_sys_connect+0x7a/0x90 net/socket.c:2077 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 17818: 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:582 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:233 [inline] slab_free_hook mm/slub.c:2338 [inline] slab_free mm/slub.c:4598 [inline] kfree+0x196/0x430 mm/slub.c:4746 l2cap_sock_shutdown+0xa8a/0x1020 net/bluetooth/l2cap_sock.c:1375 l2cap_sock_release+0x79/0x1d0 net/bluetooth/l2cap_sock.c:1414 __sock_release net/socket.c:640 [inline] sock_close+0xbc/0x240 net/socket.c:1408 __fput+0x23c/0xa50 fs/file_table.c:450 __do_sys_close fs/open.c:1554 [inline] __se_sys_close fs/open.c:1539 [inline] __x64_sys_close+0x7f/0x110 fs/open.c:1539 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff888024928000 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 752 bytes inside of freed 1024-byte region [ffff888024928000, ffff888024928400) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x24928 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000040 ffff88801ac41dc0 ffffea0001453c00 dead000000000002 raw: 0000000000000000 0000000000100010 00000001f5000000 0000000000000000 head: 00fff00000000040 ffff88801ac41dc0 ffffea0001453c00 dead000000000002 head: 0000000000000000 0000000000100010 00000001f5000000 0000000000000000 head: 00fff00000000003 ffffea0000924a01 ffffffffffffffff 0000000000000000 head: 0000000000000008 0000000000000000 00000000ffffffff 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 0xd2820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 12, tgid 12 (kworker/u8:1), ts 88744741819, free_ts 88613879080 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1f3/0x230 mm/page_alloc.c:1556 prep_new_page mm/page_alloc.c:1564 [inline] get_page_from_freelist+0x3651/0x37a0 mm/page_alloc.c:3474 __alloc_pages_noprof+0x292/0x710 mm/page_alloc.c:4751 alloc_pages_mpol_noprof+0x3e8/0x680 mm/mempolicy.c:2269 alloc_slab_page+0x6a/0x110 mm/slub.c:2408 allocate_slab+0x5a/0x2b0 mm/slub.c:2574 new_slab mm/slub.c:2627 [inline] ___slab_alloc+0xc27/0x14a0 mm/slub.c:3815 __slab_alloc+0x58/0xa0 mm/slub.c:3905 __slab_alloc_node mm/slub.c:3980 [inline] slab_alloc_node mm/slub.c:4141 [inline] __do_kmalloc_node mm/slub.c:4282 [inline] __kmalloc_node_track_caller_noprof+0x2e9/0x4c0 mm/slub.c:4302 kmalloc_reserve+0x111/0x2a0 net/core/skbuff.c:609 __alloc_skb+0x1f3/0x440 net/core/skbuff.c:678 alloc_skb include/linux/skbuff.h:1323 [inline] nlmsg_new include/net/netlink.h:1018 [inline] inet6_rt_notify+0xba/0x240 net/ipv6/route.c:6195 fib6_add_rt2node net/ipv6/ip6_fib.c:1259 [inline] fib6_add+0x1e33/0x4420 net/ipv6/ip6_fib.c:1488 __ip6_ins_rt net/ipv6/route.c:1317 [inline] ip6_ins_rt+0x106/0x170 net/ipv6/route.c:1327 __ipv6_ifa_notify+0x5d2/0x1230 net/ipv6/addrconf.c:6282 ipv6_ifa_notify net/ipv6/addrconf.c:6321 [inline] addrconf_dad_completed+0x181/0xcd0 net/ipv6/addrconf.c:4341 page last free pid 6133 tgid 6133 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1127 [inline] free_unref_page+0xd2c/0x1000 mm/page_alloc.c:2657 discard_slab mm/slub.c:2673 [inline] __put_partials+0x160/0x1c0 mm/slub.c:3142 put_cpu_partial+0x17c/0x250 mm/slub.c:3217 __slab_free+0x290/0x380 mm/slub.c:4468 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x9a/0x140 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x14f/0x170 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x23/0x80 mm/kasan/common.c:329 kasan_slab_alloc include/linux/kasan.h:250 [inline] slab_post_alloc_hook mm/slub.c:4104 [inline] slab_alloc_node mm/slub.c:4153 [inline] __kmalloc_cache_noprof+0x1d9/0x390 mm/slub.c:4309 kmalloc_noprof include/linux/slab.h:901 [inline] netdevice_queue_work drivers/infiniband/core/roce_gid_mgmt.c:664 [inline] netdevice_event+0x37d/0x950 drivers/infiniband/core/roce_gid_mgmt.c:823 notifier_call_chain+0x1a5/0x3f0 kernel/notifier.c:85 __dev_notify_flags+0x207/0x400 dev_change_flags+0xf0/0x1a0 net/core/dev.c:9026 do_setlink+0xc90/0x4210 net/core/rtnetlink.c:3109 rtnl_changelink net/core/rtnetlink.c:3723 [inline] __rtnl_newlink net/core/rtnetlink.c:3874 [inline] rtnl_newlink+0x1a81/0x20e0 net/core/rtnetlink.c:4009 rtnetlink_rcv_msg+0x791/0xcf0 net/core/rtnetlink.c:6919 netlink_rcv_skb+0x1e3/0x430 net/netlink/af_netlink.c:2542 Memory state around the buggy address: ffff888024928180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888024928200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888024928280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888024928300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888024928380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================