================================================================== BUG: KASAN: use-after-free in sctp_epaddr_lookup_transport+0xacb/0xb20 net/sctp/input.c:1029 Read of size 8 at addr ffff8881d8c30c70 by task syz-executor2/14811 CPU: 0 PID: 14811 Comm: syz-executor2 Not tainted 4.20.0-rc2+ #298 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+0x244/0x39d lib/dump_stack.c:113 print_address_description.cold.7+0x9/0x1ff mm/kasan/report.c:256 kasan_report_error mm/kasan/report.c:354 [inline] kasan_report.cold.8+0x242/0x309 mm/kasan/report.c:412 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:433 sctp_epaddr_lookup_transport+0xacb/0xb20 net/sctp/input.c:1029 sctp_endpoint_lookup_assoc+0xe0/0x290 net/sctp/endpointola.c:338 sctp_addr_id2transport+0x1f8/0x370 net/sctp/socket.c:279 sctp_getsockopt_peer_addr_params+0x17c/0x1260 net/sctp/socket.c:5613 sctp_getsockopt+0x44f9/0x7d32 net/sctp/socket.c:7462 sock_common_getsockopt+0x9a/0xe0 net/core/sock.c:2941 __sys_getsockopt+0x1ad/0x390 net/socket.c:1939 __do_sys_getsockopt net/socket.c:1950 [inline] __se_sys_getsockopt net/socket.c:1947 [inline] __x64_sys_getsockopt+0xbe/0x150 net/socket.c:1947 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x457569 Code: fd b3 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 cb b3 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007f8db8e31c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000037 RAX: ffffffffffffffda RBX: 0000000000000005 RCX: 0000000000457569 RDX: 0000000000000009 RSI: 0000000000000084 RDI: 0000000000000006 RBP: 000000000072c180 R08: 000000002044fffc R09: 0000000000000000 R10: 0000000020a68000 R11: 0000000000000246 R12: 00007f8db8e326d4 R13: 00000000004c8318 R14: 00000000004ce200 R15: 00000000ffffffff Allocated by task 14766: save_stack+0x43/0xd0 mm/kasan/kasan.c:448 set_track mm/kasan/kasan.c:460 [inline] kasan_kmalloc+0xc7/0xe0 mm/kasan/kasan.c:553 kmem_cache_alloc_trace+0x152/0x750 mm/slab.c:3620 kmalloc include/linux/slab.h:546 [inline] kzalloc include/linux/slab.h:741 [inline] sctp_association_new+0x14e/0x2290 net/sctp/associola.c:311 sctp_sendmsg_new_asoc+0x39c/0x11f0 net/sctp/socket.c:1723 sctp_sendmsg+0x18a5/0x1da0 net/sctp/socket.c:2086 inet_sendmsg+0x1a1/0x690 net/ipv4/af_inet.c:798 sock_sendmsg_nosec net/socket.c:621 [inline] sock_sendmsg+0xd5/0x120 net/socket.c:631 __sys_sendto+0x3d7/0x670 net/socket.c:1788 __do_sys_sendto net/socket.c:1800 [inline] __se_sys_sendto net/socket.c:1796 [inline] __x64_sys_sendto+0xe1/0x1a0 net/socket.c:1796 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 14804: save_stack+0x43/0xd0 mm/kasan/kasan.c:448 set_track mm/kasan/kasan.c:460 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/kasan.c:521 kasan_slab_free+0xe/0x10 mm/kasan/kasan.c:528 __cache_free mm/slab.c:3498 [inline] kfree+0xcf/0x230 mm/slab.c:3817 sctp_association_destroy net/sctp/associola.c:437 [inline] sctp_association_put+0x264/0x350 net/sctp/associola.c:889 sctp_association_free+0x6c9/0x972 net/sctp/associola.c:415 sctp_cmd_delete_tcb net/sctp/sm_sideeffect.c:939 [inline] sctp_cmd_interpreter net/sctp/sm_sideeffect.c:1353 [inline] sctp_side_effects net/sctp/sm_sideeffect.c:1220 [inline] sctp_do_sm+0x4a3b/0x7190 net/sctp/sm_sideeffect.c:1191 sctp_primitive_SHUTDOWN+0xa0/0xd0 net/sctp/primitive.c:104 sctp_close+0x464/0xad0 net/sctp/socket.c:1542 inet_release+0x104/0x1f0 net/ipv4/af_inet.c:428 __sock_release+0xd7/0x250 net/socket.c:579 sock_close+0x19/0x20 net/socket.c:1141 __fput+0x385/0xa30 fs/file_table.c:278 ____fput+0x15/0x20 fs/file_table.c:309 task_work_run+0x1e8/0x2a0 kernel/task_work.c:113 get_signal+0x1558/0x1980 kernel/signal.c:2347 do_signal+0x9c/0x21c0 arch/x86/kernel/signal.c:816 exit_to_usermode_loop+0x2e5/0x380 arch/x86/entry/common.c:162 prepare_exit_to_usermode arch/x86/entry/common.c:197 [inline] syscall_return_slowpath arch/x86/entry/common.c:268 [inline] do_syscall_64+0x6be/0x820 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff8881d8c30bc0 which belongs to the cache kmalloc-4k of size 4096 The buggy address is located 176 bytes inside of 4096-byte region [ffff8881d8c30bc0, ffff8881d8c31bc0) The buggy address belongs to the page: page:ffffea0007630c00 count:1 mapcount:0 mapping:ffff8881da800dc0 index:0x0 compound_mapcount: 0 flags: 0x2fffc0000010200(slab|head) raw: 02fffc0000010200 ffffea000638dc08 ffffea000631b788 ffff8881da800dc0 raw: 0000000000000000 ffff8881d8c30bc0 0000000100000001 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8881d8c30b00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8881d8c30b80: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb >ffff8881d8c30c00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8881d8c30c80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8881d8c30d00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================