================================================================== BUG: KASAN: use-after-free in __lock_acquire+0x3ab9/0x5660 kernel/locking/lockdep.c:4923 Read of size 8 at addr ffff88801da08130 by task syz-executor.2/4076 CPU: 0 PID: 4076 Comm: syz-executor.2 Not tainted 5.18.0-syzkaller-11793-g8eca6b0a647a #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.14.0-2 04/01/2014 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+0xeb/0x467 mm/kasan/report.c:313 print_report mm/kasan/report.c:429 [inline] kasan_report.cold+0xf4/0x1c6 mm/kasan/report.c:491 __lock_acquire+0x3ab9/0x5660 kernel/locking/lockdep.c:4923 lock_acquire kernel/locking/lockdep.c:5665 [inline] lock_acquire+0x1ab/0x570 kernel/locking/lockdep.c:5630 lock_sock_nested+0x36/0xf0 net/core/sock.c:3389 lock_sock include/net/sock.h:1691 [inline] nr_accept+0x36f/0x640 net/netrom/af_netrom.c:805 do_accept+0x37c/0x510 net/socket.c:1856 __sys_accept4_file+0x7e/0xe0 net/socket.c:1899 __sys_accept4+0xb0/0x100 net/socket.c:1929 __do_sys_accept net/socket.c:1947 [inline] __se_sys_accept net/socket.c:1944 [inline] __x64_sys_accept+0x71/0xb0 net/socket.c:1944 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+0x46/0xb0 RIP: 0033:0x7f5a04a89109 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 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f5a05b7b168 EFLAGS: 00000246 ORIG_RAX: 000000000000002b RAX: ffffffffffffffda RBX: 00007f5a04b9c100 RCX: 00007f5a04a89109 RDX: 0000000000000000 RSI: 0000000020000180 RDI: 0000000000000004 RBP: 00007f5a04ae308d R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffeba353a4f R14: 00007f5a05b7b300 R15: 0000000000022000 Allocated by task 4064: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 kasan_set_track mm/kasan/common.c:45 [inline] set_alloc_info mm/kasan/common.c:436 [inline] ____kasan_kmalloc mm/kasan/common.c:515 [inline] ____kasan_kmalloc mm/kasan/common.c:474 [inline] __kasan_kmalloc+0xa6/0xd0 mm/kasan/common.c:524 kasan_kmalloc include/linux/kasan.h:234 [inline] __do_kmalloc mm/slab.c:3696 [inline] __kmalloc+0x209/0x4d0 mm/slab.c:3705 kmalloc include/linux/slab.h:605 [inline] sk_prot_alloc+0x110/0x290 net/core/sock.c:1975 sk_alloc+0x36/0x770 net/core/sock.c:2028 nr_create+0xb2/0x5f0 net/netrom/af_netrom.c:433 __sock_create+0x353/0x790 net/socket.c:1515 sock_create net/socket.c:1566 [inline] __sys_socket_create net/socket.c:1603 [inline] __sys_socket_create net/socket.c:1588 [inline] __sys_socket+0x12f/0x240 net/socket.c:1636 __do_sys_socket net/socket.c:1649 [inline] __se_sys_socket net/socket.c:1647 [inline] __x64_sys_socket+0x6f/0xb0 net/socket.c:1647 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+0x46/0xb0 Freed by task 4061: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 kasan_set_track+0x21/0x30 mm/kasan/common.c:45 kasan_set_free_info+0x20/0x30 mm/kasan/generic.c:370 ____kasan_slab_free mm/kasan/common.c:366 [inline] ____kasan_slab_free+0x13d/0x180 mm/kasan/common.c:328 kasan_slab_free include/linux/kasan.h:200 [inline] __cache_free mm/slab.c:3425 [inline] kfree+0x113/0x310 mm/slab.c:3796 sk_prot_free net/core/sock.c:2011 [inline] __sk_destruct+0x5e5/0x710 net/core/sock.c:2097 sk_destruct net/core/sock.c:2112 [inline] __sk_free+0x1a4/0x4a0 net/core/sock.c:2123 sk_free+0x78/0xa0 net/core/sock.c:2134 sock_put include/net/sock.h:1941 [inline] nr_release+0x39a/0x450 net/netrom/af_netrom.c:554 __sock_release+0xcd/0x280 net/socket.c:650 sock_close+0x18/0x20 net/socket.c:1365 __fput+0x277/0x9d0 fs/file_table.c:317 task_work_run+0xdd/0x1a0 kernel/task_work.c:177 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] exit_to_user_mode_loop kernel/entry/common.c:169 [inline] exit_to_user_mode_prepare+0x23c/0x250 kernel/entry/common.c:201 __syscall_exit_to_user_mode_work kernel/entry/common.c:283 [inline] syscall_exit_to_user_mode+0x19/0x50 kernel/entry/common.c:294 do_syscall_64+0x42/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x46/0xb0 Last potentially related work creation: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 __kasan_record_aux_stack+0x7e/0x90 mm/kasan/generic.c:348 call_rcu+0x99/0x790 kernel/rcu/tree.c:3126 netlink_release+0xf08/0x1db0 net/netlink/af_netlink.c:815 __sock_release+0xcd/0x280 net/socket.c:650 sock_close+0x18/0x20 net/socket.c:1365 __fput+0x277/0x9d0 fs/file_table.c:317 task_work_run+0xdd/0x1a0 kernel/task_work.c:177 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] exit_to_user_mode_loop kernel/entry/common.c:169 [inline] exit_to_user_mode_prepare+0x23c/0x250 kernel/entry/common.c:201 __syscall_exit_to_user_mode_work kernel/entry/common.c:283 [inline] syscall_exit_to_user_mode+0x19/0x50 kernel/entry/common.c:294 do_syscall_64+0x42/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x46/0xb0 The buggy address belongs to the object at ffff88801da08000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 304 bytes inside of 2048-byte region [ffff88801da08000, ffff88801da08800) The buggy address belongs to the physical page: page:ffffea0000768200 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1da08 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffffea000078b108 ffffea00007adec8 ffff888010c40800 raw: 0000000000000000 ffff88801da08000 0000000100000001 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 0x2d2220(__GFP_HIGH|__GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_THISNODE), pid 3724, tgid 3724 (syz-executor.3), ts 254998021872, free_ts 252445945340 prep_new_page mm/page_alloc.c:2456 [inline] get_page_from_freelist+0x1290/0x3b70 mm/page_alloc.c:4198 __alloc_pages_slowpath.constprop.0+0x2e9/0x2160 mm/page_alloc.c:4973 __alloc_pages+0x436/0x510 mm/page_alloc.c:5439 __alloc_pages_node include/linux/gfp.h:587 [inline] kmem_getpages mm/slab.c:1363 [inline] cache_grow_begin+0x75/0x350 mm/slab.c:2569 cache_alloc_refill+0x27f/0x380 mm/slab.c:2942 ____cache_alloc mm/slab.c:3024 [inline] ____cache_alloc mm/slab.c:3007 [inline] slab_alloc_node mm/slab.c:3227 [inline] kmem_cache_alloc_node_trace+0x518/0x5b0 mm/slab.c:3611 __do_kmalloc_node mm/slab.c:3633 [inline] __kmalloc_node_track_caller+0x38/0x60 mm/slab.c:3648 kmalloc_reserve net/core/skbuff.c:354 [inline] pskb_expand_head+0x15e/0x1070 net/core/skbuff.c:1695 netlink_trim+0x1ea/0x240 net/netlink/af_netlink.c:1301 netlink_broadcast+0x5b/0xd60 net/netlink/af_netlink.c:1497 nlmsg_multicast include/net/netlink.h:1033 [inline] nlmsg_notify+0x8f/0x280 net/netlink/af_netlink.c:2544 rtnl_notify net/core/rtnetlink.c:767 [inline] rtmsg_ifinfo_send net/core/rtnetlink.c:3928 [inline] rtmsg_ifinfo_event net/core/rtnetlink.c:3943 [inline] rtmsg_ifinfo_event net/core/rtnetlink.c:3931 [inline] rtmsg_ifinfo+0xf0/0x120 net/core/rtnetlink.c:3949 __dev_notify_flags+0x226/0x2b0 net/core/dev.c:8565 dev_change_flags+0x112/0x170 net/core/dev.c:8607 do_setlink+0x961/0x3bb0 net/core/rtnetlink.c:2780 __rtnl_newlink+0xd6a/0x17e0 net/core/rtnetlink.c:3546 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1371 [inline] free_pcp_prepare+0x549/0xd20 mm/page_alloc.c:1421 free_unref_page_prepare mm/page_alloc.c:3343 [inline] free_unref_page+0x19/0x6a0 mm/page_alloc.c:3438 slab_destroy mm/slab.c:1615 [inline] slabs_destroy+0x89/0xc0 mm/slab.c:1635 cache_flusharray mm/slab.c:3397 [inline] ___cache_free+0x34e/0x670 mm/slab.c:3460 qlink_free mm/kasan/quarantine.c:168 [inline] qlist_free_all+0x4f/0x1b0 mm/kasan/quarantine.c:187 kasan_quarantine_reduce+0x180/0x200 mm/kasan/quarantine.c:294 __kasan_slab_alloc+0x97/0xb0 mm/kasan/common.c:446 kasan_slab_alloc include/linux/kasan.h:224 [inline] slab_post_alloc_hook mm/slab.h:750 [inline] slab_alloc mm/slab.c:3302 [inline] kmem_cache_alloc_trace+0x258/0x4a0 mm/slab.c:3567 kmalloc include/linux/slab.h:600 [inline] kzalloc include/linux/slab.h:733 [inline] ref_tracker_alloc+0x152/0x560 lib/ref_tracker.c:85 __netdev_tracker_alloc include/linux/netdevice.h:3960 [inline] dev_hold_track include/linux/netdevice.h:3989 [inline] dev_hold_track include/linux/netdevice.h:3984 [inline] netdev_queue_add_kobject net/core/net-sysfs.c:1662 [inline] netdev_queue_update_kobjects+0x1a7/0x4e0 net/core/net-sysfs.c:1717 register_queue_kobjects net/core/net-sysfs.c:1778 [inline] netdev_register_kobject+0x330/0x400 net/core/net-sysfs.c:2018 register_netdevice+0xd9d/0x15b0 net/core/dev.c:10045 veth_newlink+0x4d6/0x9a0 drivers/net/veth.c:1795 rtnl_newlink_create net/core/rtnetlink.c:3363 [inline] __rtnl_newlink+0x1087/0x17e0 net/core/rtnetlink.c:3580 rtnl_newlink+0x64/0xa0 net/core/rtnetlink.c:3593 rtnetlink_rcv_msg+0x43a/0xc90 net/core/rtnetlink.c:6089 Memory state around the buggy address: ffff88801da08000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88801da08080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88801da08100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88801da08180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88801da08200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================