================================================================== BUG: KASAN: use-after-free in __lock_acquire+0x79/0x1f60 kernel/locking/lockdep.c:4923 Read of size 8 at addr ffff888077d30130 by task syz-executor.4/24592 CPU: 1 PID: 24592 Comm: syz-executor.4 Not tainted 6.0.0-rc5-syzkaller-00007-g6504d82f4440 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/26/2022 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106 print_address_description+0x65/0x4b0 mm/kasan/report.c:317 print_report+0x108/0x220 mm/kasan/report.c:433 kasan_report+0xfb/0x130 mm/kasan/report.c:495 __lock_acquire+0x79/0x1f60 kernel/locking/lockdep.c:4923 lock_acquire+0x1a7/0x400 kernel/locking/lockdep.c:5666 lock_sock_nested+0x44/0xf0 net/core/sock.c:3393 lock_sock include/net/sock.h:1712 [inline] nr_recvmsg+0xea/0x530 net/netrom/af_netrom.c:1155 ____sys_recvmsg+0x285/0x530 ___sys_recvmsg net/socket.c:2743 [inline] do_recvmmsg+0x490/0xb20 net/socket.c:2837 __sys_recvmmsg net/socket.c:2916 [inline] __do_sys_recvmmsg net/socket.c:2939 [inline] __se_sys_recvmmsg net/socket.c:2932 [inline] __x64_sys_recvmmsg+0x195/0x240 net/socket.c:2932 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x2b/0x70 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f09928893c9 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:00007f0993a19168 EFLAGS: 00000246 ORIG_RAX: 000000000000012b RAX: ffffffffffffffda RBX: 00007f099299c1f0 RCX: 00007f09928893c9 RDX: 00000000000005dd RSI: 0000000020000540 RDI: 0000000000000004 RBP: 00007f09928e433f R08: 0000000000000000 R09: 0000000000000000 R10: 0000000040012062 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffccedfc92f R14: 00007f0993a19300 R15: 0000000000022000 Allocated by task 24500: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:45 [inline] set_alloc_info mm/kasan/common.c:437 [inline] ____kasan_kmalloc+0xdc/0x110 mm/kasan/common.c:516 kasan_kmalloc include/linux/kasan.h:234 [inline] __kmalloc+0x226/0x370 mm/slub.c:4424 kmalloc include/linux/slab.h:605 [inline] sk_prot_alloc+0xde/0x200 net/core/sock.c:1976 sk_alloc+0x36/0x340 net/core/sock.c:2029 nr_create+0x9d/0x500 net/netrom/af_netrom.c:433 __sock_create+0x3fd/0x850 net/socket.c:1515 sock_create net/socket.c:1566 [inline] __sys_socket_create net/socket.c:1603 [inline] __sys_socket+0x137/0x3a0 net/socket.c:1636 __do_sys_socket net/socket.c:1649 [inline] __se_sys_socket net/socket.c:1647 [inline] __x64_sys_socket+0x76/0x80 net/socket.c:1647 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x2b/0x70 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Freed by task 24517: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track+0x4c/0x70 mm/kasan/common.c:45 kasan_set_free_info+0x1f/0x40 mm/kasan/generic.c:370 ____kasan_slab_free+0xd8/0x120 mm/kasan/common.c:367 kasan_slab_free include/linux/kasan.h:200 [inline] slab_free_hook mm/slub.c:1754 [inline] slab_free_freelist_hook+0x12e/0x1a0 mm/slub.c:1780 slab_free mm/slub.c:3534 [inline] kfree+0xda/0x210 mm/slub.c:4562 sk_prot_free net/core/sock.c:2012 [inline] __sk_destruct+0x487/0x5d0 net/core/sock.c:2098 call_timer_fn+0xf5/0x210 kernel/time/timer.c:1474 expire_timers kernel/time/timer.c:1519 [inline] __run_timers+0x76a/0x980 kernel/time/timer.c:1790 run_timer_softirq+0x63/0xf0 kernel/time/timer.c:1803 __do_softirq+0x382/0x793 kernel/softirq.c:571 Last potentially related work creation: kasan_save_stack+0x3b/0x60 mm/kasan/common.c:38 __kasan_record_aux_stack+0xaf/0xc0 mm/kasan/generic.c:348 call_rcu+0x163/0x9c0 kernel/rcu/tree.c:2793 netlink_release+0x12fc/0x1720 net/netlink/af_netlink.c:815 __sock_release net/socket.c:650 [inline] sock_close+0xd7/0x260 net/socket.c:1365 __fput+0x3b9/0x820 fs/file_table.c:320 task_work_run+0x146/0x1c0 kernel/task_work.c:177 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] exit_to_user_mode_loop+0x134/0x160 kernel/entry/common.c:169 exit_to_user_mode_prepare+0xad/0x110 kernel/entry/common.c:201 __syscall_exit_to_user_mode_work kernel/entry/common.c:283 [inline] syscall_exit_to_user_mode+0x2e/0x60 kernel/entry/common.c:294 entry_SYSCALL_64_after_hwframe+0x63/0xcd Second to last potentially related work creation: kasan_save_stack+0x3b/0x60 mm/kasan/common.c:38 __kasan_record_aux_stack+0xaf/0xc0 mm/kasan/generic.c:348 call_rcu+0x163/0x9c0 kernel/rcu/tree.c:2793 netlink_release+0x12fc/0x1720 net/netlink/af_netlink.c:815 __sock_release net/socket.c:650 [inline] sock_close+0xd7/0x260 net/socket.c:1365 __fput+0x3b9/0x820 fs/file_table.c:320 task_work_run+0x146/0x1c0 kernel/task_work.c:177 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] exit_to_user_mode_loop+0x134/0x160 kernel/entry/common.c:169 exit_to_user_mode_prepare+0xad/0x110 kernel/entry/common.c:201 __syscall_exit_to_user_mode_work kernel/entry/common.c:283 [inline] syscall_exit_to_user_mode+0x2e/0x60 kernel/entry/common.c:294 entry_SYSCALL_64_after_hwframe+0x63/0xcd The buggy address belongs to the object at ffff888077d30000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 304 bytes inside of 2048-byte region [ffff888077d30000, ffff888077d30800) The buggy address belongs to the physical page: page:ffffea0001df4c00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x77d30 head:ffffea0001df4c00 order:3 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 0000000000000000 dead000000000001 ffff888012042000 raw: 0000000000000000 0000000000080008 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 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 18686, tgid 18685 (syz-executor.3), ts 1346461459254, free_ts 1346154997983 prep_new_page mm/page_alloc.c:2532 [inline] get_page_from_freelist+0x72b/0x7a0 mm/page_alloc.c:4283 __alloc_pages+0x259/0x560 mm/page_alloc.c:5515 alloc_slab_page+0x70/0xf0 mm/slub.c:1824 allocate_slab+0x5e/0x520 mm/slub.c:1969 new_slab mm/slub.c:2029 [inline] ___slab_alloc+0x42e/0xce0 mm/slub.c:3031 __slab_alloc mm/slub.c:3118 [inline] slab_alloc_node mm/slub.c:3209 [inline] __kmalloc_node_track_caller+0x2bd/0x3f0 mm/slub.c:4955 kmalloc_reserve net/core/skbuff.c:362 [inline] __alloc_skb+0x11d/0x620 net/core/skbuff.c:434 alloc_skb_fclone include/linux/skbuff.h:1307 [inline] tipc_buf_acquire+0x27/0xd0 net/tipc/msg.c:72 tipc_msg_build+0x99f/0x11e0 net/tipc/msg.c:449 tipc_sendmcast net/tipc/socket.c:881 [inline] __tipc_sendmsg+0x21a7/0x30a0 net/tipc/socket.c:1469 tipc_sendmsg+0x51/0x70 net/tipc/socket.c:1403 sock_sendmsg_nosec net/socket.c:714 [inline] sock_sendmsg net/socket.c:734 [inline] kernel_sendmsg+0xf5/0x130 net/socket.c:754 sock_no_sendpage+0x161/0x1d0 net/core/sock.c:3165 kernel_sendpage net/socket.c:3561 [inline] sock_sendpage+0x144/0x1a0 net/socket.c:1054 pipe_to_sendpage+0x258/0x340 fs/splice.c:361 splice_from_pipe_feed fs/splice.c:415 [inline] __splice_from_pipe+0x351/0x8b0 fs/splice.c:559 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1449 [inline] free_pcp_prepare+0x812/0x900 mm/page_alloc.c:1499 free_unref_page_prepare mm/page_alloc.c:3380 [inline] free_unref_page+0x7d/0x630 mm/page_alloc.c:3476 free_slab mm/slub.c:2068 [inline] discard_slab mm/slub.c:2074 [inline] __unfreeze_partials+0x1ab/0x200 mm/slub.c:2548 put_cpu_partial+0x116/0x180 mm/slub.c:2624 qlist_free_all+0x2b/0x70 mm/kasan/quarantine.c:187 kasan_quarantine_reduce+0x169/0x180 mm/kasan/quarantine.c:294 ____kasan_kmalloc+0x2f/0x110 mm/kasan/common.c:482 kasan_kmalloc include/linux/kasan.h:234 [inline] kmem_cache_alloc_trace+0x97/0x310 mm/slub.c:3284 kmalloc include/linux/slab.h:600 [inline] kzalloc include/linux/slab.h:733 [inline] io_rsrc_node_alloc io_uring/rsrc.c:253 [inline] io_rsrc_node_switch_start+0x7f/0x1c0 io_uring/rsrc.c:300 io_uring_create+0x575/0xc56 io_uring/io_uring.c:3321 io_uring_setup io_uring/io_uring.c:3407 [inline] __do_sys_io_uring_setup io_uring/io_uring.c:3413 [inline] __se_sys_io_uring_setup io_uring/io_uring.c:3410 [inline] __x64_sys_io_uring_setup+0x226/0x2a0 io_uring/io_uring.c:3410 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x2b/0x70 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Memory state around the buggy address: ffff888077d30000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888077d30080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888077d30100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888077d30180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888077d30200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================