================================================================== BUG: KASAN: use-after-free in sock_net include/net/sock.h:2454 [inline] BUG: KASAN: use-after-free in sctp_hash_cmp+0x1d4/0x220 net/sctp/input.c:879 Read of size 8 at addr ffff8880a7dcedb0 by task syz-executor.3/3340 CPU: 0 PID: 3340 Comm: syz-executor.3 Not tainted 5.3.0-rc3+ #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+0x113/0x167 lib/dump_stack.c:113 print_address_description.cold.8+0x9/0x318 mm/kasan/report.c:351 __kasan_report.cold.9+0x1b/0x3f mm/kasan/report.c:482 kasan_report+0x12/0x17 mm/kasan/common.c:612 __asan_report_load8_noabort+0x14/0x20 mm/kasan/generic_report.c:132 sock_net include/net/sock.h:2454 [inline] sctp_hash_cmp+0x1d4/0x220 net/sctp/input.c:879 __rhashtable_lookup include/linux/rhashtable.h:608 [inline] rhltable_lookup include/linux/rhashtable.h:695 [inline] sctp_hash_transport+0x407/0x1790 net/sctp/input.c:939 sctp_assoc_add_peer+0x886/0xe40 net/sctp/associola.c:710 sctp_connect_new_asoc+0x145/0x4b0 net/sctp/socket.c:1079 __sctp_connect+0x36a/0xaf0 net/sctp/socket.c:1177 sctp_connect net/sctp/socket.c:4742 [inline] sctp_inet_connect+0x109/0x170 net/sctp/socket.c:4757 __sys_connect+0x20d/0x2d0 net/socket.c:1828 __do_sys_connect net/socket.c:1839 [inline] __se_sys_connect net/socket.c:1836 [inline] __ia32_sys_connect+0x6d/0xb0 net/socket.c:1836 do_syscall_32_irqs_on arch/x86/entry/common.c:332 [inline] do_fast_syscall_32+0x235/0xb3b arch/x86/entry/common.c:403 entry_SYSENTER_compat+0x70/0x7f arch/x86/entry/entry_64_compat.S:139 RIP: 0023:0xf7f42a09 Code: 96 98 00 eb ce 8b 04 24 c3 8b 1c 24 c3 8b 34 24 c3 8b 3c 24 c3 90 90 90 90 90 90 90 90 90 90 90 90 51 52 55 89 e5 0f 34 cd 80 <5d> 5a 59 c3 90 90 90 90 eb 0d 90 90 90 90 90 90 90 90 90 90 90 90 RSP: 002b:00000000f7f3e0cc EFLAGS: 00000296 ORIG_RAX: 000000000000016a RAX: ffffffffffffffda RBX: 0000000000000004 RCX: 0000000020001200 RDX: 0000000000000010 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 3339: save_stack+0x21/0x90 mm/kasan/common.c:69 set_track mm/kasan/common.c:77 [inline] __kasan_kmalloc.constprop.9+0xc7/0xd0 mm/kasan/common.c:487 kasan_slab_alloc+0x12/0x20 mm/kasan/common.c:495 slab_post_alloc_hook mm/slab.h:520 [inline] slab_alloc mm/slab.c:3319 [inline] kmem_cache_alloc+0x121/0x750 mm/slab.c:3483 sk_prot_alloc+0x5d/0x250 net/core/sock.c:1597 sk_alloc+0x30/0xc70 net/core/sock.c:1657 inet6_create+0x268/0xde0 net/ipv6/af_inet6.c:180 __sock_create+0x262/0x540 net/socket.c:1418 sock_create net/socket.c:1469 [inline] __sys_socket+0xd7/0x1c0 net/socket.c:1511 __do_sys_socket net/socket.c:1520 [inline] __se_sys_socket net/socket.c:1518 [inline] __ia32_sys_socket+0x6e/0xb0 net/socket.c:1518 do_syscall_32_irqs_on arch/x86/entry/common.c:332 [inline] do_fast_syscall_32+0x235/0xb3b arch/x86/entry/common.c:403 entry_SYSENTER_compat+0x70/0x7f arch/x86/entry/entry_64_compat.S:139 Freed by task 3335: save_stack+0x21/0x90 mm/kasan/common.c:69 set_track mm/kasan/common.c:77 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/common.c:449 kasan_slab_free+0xe/0x10 mm/kasan/common.c:457 __cache_free mm/slab.c:3425 [inline] kmem_cache_free+0x83/0x320 mm/slab.c:3693 sk_prot_free net/core/sock.c:1638 [inline] __sk_destruct+0x3c9/0x580 net/core/sock.c:1726 sk_destruct+0x5a/0x70 net/core/sock.c:1734 __sk_free+0xc7/0x2a0 net/core/sock.c:1745 sk_free+0x23/0x30 net/core/sock.c:1756 sock_put include/net/sock.h:1725 [inline] sctp_close+0x457/0x760 net/sctp/socket.c:1543 inet_release+0xc1/0x1c0 net/ipv4/af_inet.c:427 inet6_release+0x46/0x60 net/ipv6/af_inet6.c:470 __sock_release+0xc2/0x270 net/socket.c:590 sock_close+0x13/0x20 net/socket.c:1268 __fput+0x25a/0x770 fs/file_table.c:280 ____fput+0x9/0x10 fs/file_table.c:313 task_work_run+0x108/0x180 kernel/task_work.c:113 tracehook_notify_resume include/linux/tracehook.h:188 [inline] exit_to_usermode_loop+0x24e/0x2e0 arch/x86/entry/common.c:163 prepare_exit_to_usermode arch/x86/entry/common.c:194 [inline] syscall_return_slowpath arch/x86/entry/common.c:274 [inline] do_syscall_32_irqs_on arch/x86/entry/common.c:347 [inline] do_fast_syscall_32+0x90e/0xb3b arch/x86/entry/common.c:403 entry_SYSENTER_compat+0x70/0x7f arch/x86/entry/entry_64_compat.S:139 The buggy address belongs to the object at ffff8880a7dced80 which belongs to the cache SCTPv6(49:syz1) of size 1952 The buggy address is located 48 bytes inside of 1952-byte region [ffff8880a7dced80, ffff8880a7dcf520) The buggy address belongs to the page: page:ffffea00029f7380 refcount:1 mapcount:0 mapping:ffff888091c5ce00 index:0x0 compound_mapcount: 0 flags: 0x1fffc0000010200(slab|head) raw: 01fffc0000010200 ffffea000242a108 ffffea0002a09a88 ffff888091c5ce00 raw: 0000000000000000 ffff8880a7dce540 0000000100000003 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880a7dcec80: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc ffff8880a7dced00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8880a7dced80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880a7dcee00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880a7dcee80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================