================================================================== BUG: KASAN: use-after-free in reuseport_alloc+0x2dc/0x2f0 net/core/sock_reuseport.c:78 Write of size 8 at addr ffff88805a2c39d8 by task syz-executor.0/23470 CPU: 0 PID: 23470 Comm: syz-executor.0 Not tainted 5.9.0-rc3-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x198/0x1fd lib/dump_stack.c:118 print_address_description.constprop.0.cold+0xae/0x497 mm/kasan/report.c:383 __kasan_report mm/kasan/report.c:513 [inline] kasan_report.cold+0x1f/0x37 mm/kasan/report.c:530 reuseport_alloc+0x2dc/0x2f0 net/core/sock_reuseport.c:78 reuseport_add_sock+0x708/0x8d0 net/core/sock_reuseport.c:145 __sctp_hash_endpoint net/sctp/input.c:750 [inline] sctp_hash_endpoint+0x4fe/0x5f0 net/sctp/input.c:778 sctp_listen_start net/sctp/socket.c:8274 [inline] sctp_inet_listen+0x714/0x920 net/sctp/socket.c:8329 __sys_listen+0x17d/0x250 net/socket.c:1690 __do_sys_listen net/socket.c:1699 [inline] __se_sys_listen net/socket.c:1697 [inline] __x64_sys_listen+0x50/0x70 net/socket.c:1697 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x45d5f9 Code: 5d b4 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 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 0f 83 2b b4 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007fb6b1163c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000032 RAX: ffffffffffffffda RBX: 0000000000020480 RCX: 000000000045d5f9 RDX: 0000000000000000 RSI: 0000000000000050 RDI: 0000000000000004 RBP: 000000000118cf78 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000118cf4c R13: 00007ffea27ba56f R14: 00007fb6b11649c0 R15: 000000000118cf4c Allocated by task 23470: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:48 kasan_set_track mm/kasan/common.c:56 [inline] __kasan_kmalloc.constprop.0+0xbf/0xd0 mm/kasan/common.c:461 slab_post_alloc_hook mm/slab.h:518 [inline] slab_alloc mm/slab.c:3312 [inline] kmem_cache_alloc+0x13a/0x3f0 mm/slab.c:3482 sk_prot_alloc+0x5f/0x300 net/core/sock.c:1665 sk_alloc+0x32/0xbd0 net/core/sock.c:1725 inet6_create net/ipv6/af_inet6.c:183 [inline] inet6_create+0x3a4/0x1010 net/ipv6/af_inet6.c:110 __sock_create+0x3de/0x780 net/socket.c:1427 sock_create net/socket.c:1478 [inline] __sys_socket+0xef/0x200 net/socket.c:1520 __do_sys_socket net/socket.c:1529 [inline] __se_sys_socket net/socket.c:1527 [inline] __x64_sys_socket+0x6f/0xb0 net/socket.c:1527 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Freed by task 23469: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:48 kasan_set_track+0x1c/0x30 mm/kasan/common.c:56 kasan_set_free_info+0x1b/0x30 mm/kasan/generic.c:355 __kasan_slab_free+0xd8/0x120 mm/kasan/common.c:422 __cache_free mm/slab.c:3418 [inline] kmem_cache_free.part.0+0x74/0x1e0 mm/slab.c:3693 sk_prot_free net/core/sock.c:1706 [inline] __sk_destruct+0x550/0x860 net/core/sock.c:1793 sk_destruct+0xbd/0xe0 net/core/sock.c:1808 __sk_free+0xef/0x3d0 net/core/sock.c:1819 sk_free+0x78/0xa0 net/core/sock.c:1830 sock_put include/net/sock.h:1779 [inline] sctp_close+0x738/0x8b0 net/sctp/socket.c:1538 inet_release+0x12e/0x280 net/ipv4/af_inet.c:431 inet6_release+0x4c/0x70 net/ipv6/af_inet6.c:475 __sock_release+0xcd/0x280 net/socket.c:596 sock_close+0x18/0x20 net/socket.c:1277 __fput+0x285/0x920 fs/file_table.c:281 task_work_run+0xdd/0x190 kernel/task_work.c:141 tracehook_notify_resume include/linux/tracehook.h:188 [inline] exit_to_user_mode_loop kernel/entry/common.c:140 [inline] exit_to_user_mode_prepare+0x1e1/0x200 kernel/entry/common.c:167 syscall_exit_to_user_mode+0x7e/0x2e0 kernel/entry/common.c:242 entry_SYSCALL_64_after_hwframe+0x44/0xa9 The buggy address belongs to the object at ffff88805a2c3540 which belongs to the cache SCTPv6 of size 2032 The buggy address is located 1176 bytes inside of 2032-byte region [ffff88805a2c3540, ffff88805a2c3d30) The buggy address belongs to the page: page:00000000861bf188 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x5a2c2 head:00000000861bf188 order:1 compound_mapcount:0 flags: 0xfffe0000010200(slab|head) raw: 00fffe0000010200 ffffea0001cf4388 ffffea0001313288 ffff88821480df00 raw: 0000000000000000 ffff88805a2c2440 0000000100000003 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88805a2c3880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88805a2c3900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88805a2c3980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88805a2c3a00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88805a2c3a80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================