================================================================== BUG: KASAN: use-after-free in __lock_acquire+0x3d86/0x54a0 kernel/locking/lockdep.c:4885 Read of size 8 at addr ffff888147d0c120 by task kworker/1:2/22105 CPU: 1 PID: 22105 Comm: kworker/1:2 Not tainted 5.15.0-rc5-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: events l2cap_chan_timeout 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 __lock_acquire+0x3d86/0x54a0 kernel/locking/lockdep.c:4885 lock_acquire kernel/locking/lockdep.c:5625 [inline] lock_acquire+0x1ab/0x510 kernel/locking/lockdep.c:5590 lock_sock_nested+0x2f/0xf0 net/core/sock.c:3203 l2cap_sock_teardown_cb+0xa1/0x660 net/bluetooth/l2cap_sock.c:1528 l2cap_chan_del+0xbc/0xa80 net/bluetooth/l2cap_core.c:622 l2cap_chan_close+0x1b9/0xaf0 net/bluetooth/l2cap_core.c:825 l2cap_chan_timeout+0x17e/0x2f0 net/bluetooth/l2cap_core.c:436 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 Allocated by task 26042: 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:591 [inline] kzalloc include/linux/slab.h:721 [inline] wakeup_source_device_create+0x46/0x2a0 drivers/base/power/wakeup_stats.c:142 wakeup_source_sysfs_add+0x1a/0x90 drivers/base/power/wakeup_stats.c:181 wakeup_source_register+0x99/0x130 drivers/base/power/wakeup.c:227 ep_create_wakeup_source+0x123/0x2b0 fs/eventpoll.c:1375 ep_insert fs/eventpoll.c:1497 [inline] do_epoll_ctl+0x1a2f/0x2f20 fs/eventpoll.c:2134 __do_sys_epoll_ctl fs/eventpoll.c:2185 [inline] __se_sys_epoll_ctl fs/eventpoll.c:2176 [inline] __x64_sys_epoll_ctl+0x13f/0x1c0 fs/eventpoll.c:2176 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 __call_rcu kernel/rcu/tree.c:2987 [inline] call_rcu+0xb1/0x750 kernel/rcu/tree.c:3067 netlink_release+0xdd4/0x1dd0 net/netlink/af_netlink.c:815 __sock_release+0xcd/0x280 net/socket.c:649 sock_close+0x18/0x20 net/socket.c:1314 __fput+0x288/0x9f0 fs/file_table.c:280 task_work_run+0xdd/0x1a0 kernel/task_work.c:164 exit_task_work include/linux/task_work.h:32 [inline] do_exit+0xbae/0x2a30 kernel/exit.c:825 do_group_exit+0x125/0x310 kernel/exit.c:922 __do_sys_exit_group kernel/exit.c:933 [inline] __se_sys_exit_group kernel/exit.c:931 [inline] __x64_sys_exit_group+0x3a/0x50 kernel/exit.c:931 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 Second to 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 __call_rcu kernel/rcu/tree.c:2987 [inline] call_rcu+0xb1/0x750 kernel/rcu/tree.c:3067 sk_destruct+0x8e/0xe0 net/core/sock.c:1974 __sk_free+0xef/0x3d0 net/core/sock.c:1987 sk_free+0x78/0xa0 net/core/sock.c:1998 sock_put include/net/sock.h:1848 [inline] xsk_release+0x669/0x7c0 net/xdp/xsk.c:830 __sock_release+0xcd/0x280 net/socket.c:649 sock_close+0x18/0x20 net/socket.c:1314 __fput+0x288/0x9f0 fs/file_table.c:280 task_work_run+0xdd/0x1a0 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+0x27e/0x290 kernel/entry/common.c:207 __syscall_exit_to_user_mode_work kernel/entry/common.c:289 [inline] syscall_exit_to_user_mode+0x19/0x60 kernel/entry/common.c:300 do_syscall_64+0x42/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x44/0xae The buggy address belongs to the object at ffff888147d0c000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 288 bytes inside of 2048-byte region [ffff888147d0c000, ffff888147d0c800) The buggy address belongs to the page: page:ffffea00051f4200 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888147d0c000 pfn:0x147d08 head:ffffea00051f4200 order:3 compound_mapcount:0 compound_pincount:0 flags: 0x57ff00000010200(slab|head|node=1|zone=2|lastcpupid=0x7ff) raw: 057ff00000010200 ffff888140000948 ffffea000511bc08 ffff888010c42000 raw: ffff888147d0c000 0000000000080007 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 1, ts 11234131632, free_ts 0 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_page_interleave+0x1e/0x200 mm/mempolicy.c:2042 alloc_pages+0x29f/0x300 mm/mempolicy.c:2192 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] slab_alloc mm/slub.c:3214 [inline] __kmalloc+0x305/0x320 mm/slub.c:4387 kmalloc include/linux/slab.h:596 [inline] kzalloc include/linux/slab.h:721 [inline] __register_sysctl_table+0x112/0x1090 fs/proc/proc_sysctl.c:1318 __devinet_sysctl_register+0x156/0x280 net/ipv4/devinet.c:2577 devinet_sysctl_register net/ipv4/devinet.c:2617 [inline] devinet_sysctl_register+0x160/0x230 net/ipv4/devinet.c:2607 inetdev_init+0x269/0x570 net/ipv4/devinet.c:276 inetdev_event+0xa87/0x15d0 net/ipv4/devinet.c:1530 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] register_netdevice+0x1075/0x1500 net/core/dev.c:10330 page_owner free stack trace missing Memory state around the buggy address: ffff888147d0c000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888147d0c080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888147d0c100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888147d0c180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888147d0c200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================