================================================================== BUG: KASAN: double-free or invalid-free in sctp_stream_free+0xfa/0x190 net/sctp/stream.c:187 CPU: 0 PID: 9528 Comm: syz-executor.5 Not tainted 5.0.0-rc5-next-20190211 #32 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+0x172/0x1f0 lib/dump_stack.c:113 print_address_description.cold+0x7c/0x20d mm/kasan/report.c:187 kasan_report_invalid_free+0x65/0xa0 mm/kasan/report.c:278 __kasan_slab_free+0x13a/0x150 mm/kasan/common.c:439 kasan_slab_free+0xe/0x10 mm/kasan/common.c:468 __cache_free mm/slab.c:3491 [inline] kfree+0xcf/0x230 mm/slab.c:3816 sctp_stream_free+0xfa/0x190 net/sctp/stream.c:187 sctp_association_free+0x235/0x79a net/sctp/associola.c:373 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+0x3c4e/0x5380 net/sctp/sm_sideeffect.c:1191 sctp_assoc_bh_rcv+0x343/0x660 net/sctp/associola.c:1074 sctp_inq_push+0x1ea/0x290 net/sctp/inqueue.c:95 sctp_backlog_rcv+0x196/0xbe0 net/sctp/input.c:354 sk_backlog_rcv include/net/sock.h:937 [inline] __release_sock+0x12e/0x3a0 net/core/sock.c:2379 release_sock+0x59/0x1c0 net/core/sock.c:2895 sctp_close+0x4a4/0x860 net/sctp/socket.c:1550 inet_release+0x105/0x1f0 net/ipv4/af_inet.c:428 __sock_release+0xd3/0x250 net/socket.c:579 sock_close+0x1b/0x30 net/socket.c:1161 __fput+0x2df/0x8d0 fs/file_table.c:278 ____fput+0x16/0x20 fs/file_table.c:309 task_work_run+0x14a/0x1c0 kernel/task_work.c:113 tracehook_notify_resume include/linux/tracehook.h:188 [inline] exit_to_usermode_loop+0x273/0x2c0 arch/x86/entry/common.c:166 prepare_exit_to_usermode arch/x86/entry/common.c:197 [inline] syscall_return_slowpath arch/x86/entry/common.c:268 [inline] do_syscall_64+0x52d/0x610 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x411d41 Code: 75 14 b8 03 00 00 00 0f 05 48 3d 01 f0 ff ff 0f 83 94 19 00 00 c3 48 83 ec 08 e8 0a fc ff ff 48 89 04 24 b8 03 00 00 00 0f 05 <48> 8b 3c 24 48 89 c2 e8 53 fc ff ff 48 89 d0 48 83 c4 08 48 3d 01 RSP: 002b:00007ffc24edc470 EFLAGS: 00000293 ORIG_RAX: 0000000000000003 RAX: 0000000000000000 RBX: 0000000000000004 RCX: 0000000000411d41 RDX: 0000000000000001 RSI: 0000000000740690 RDI: 0000000000000003 RBP: 0000000000000000 R08: 0000000000037ec0 R09: 0000000000037ec0 R10: 00007ffc24edc3a0 R11: 0000000000000293 R12: 0000000000000000 R13: 0000000000000001 R14: 0000000000000038 R15: 0000000000000005 Allocated by task 9529: save_stack+0x45/0xd0 mm/kasan/common.c:75 set_track mm/kasan/common.c:87 [inline] __kasan_kmalloc mm/kasan/common.c:498 [inline] __kasan_kmalloc.constprop.0+0xcf/0xe0 mm/kasan/common.c:471 kasan_kmalloc+0x9/0x10 mm/kasan/common.c:506 kmem_cache_alloc_trace+0x151/0x760 mm/slab.c:3615 kmalloc include/linux/slab.h:548 [inline] kzalloc include/linux/slab.h:743 [inline] sctp_stream_init_ext+0x51/0x110 net/sctp/stream.c:172 sctp_sendmsg_to_asoc+0x1273/0x17b0 net/sctp/socket.c:1896 sctp_sendmsg+0x10a9/0x17e0 net/sctp/socket.c:2113 inet_sendmsg+0x147/0x5d0 net/ipv4/af_inet.c:798 sock_sendmsg_nosec net/socket.c:621 [inline] sock_sendmsg+0xdd/0x130 net/socket.c:631 ___sys_sendmsg+0x806/0x930 net/socket.c:2136 __sys_sendmsg+0x105/0x1d0 net/socket.c:2174 __do_sys_sendmsg net/socket.c:2183 [inline] __se_sys_sendmsg net/socket.c:2181 [inline] __x64_sys_sendmsg+0x78/0xb0 net/socket.c:2181 do_syscall_64+0x103/0x610 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 9529: save_stack+0x45/0xd0 mm/kasan/common.c:75 set_track mm/kasan/common.c:87 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/common.c:460 kasan_slab_free+0xe/0x10 mm/kasan/common.c:468 __cache_free mm/slab.c:3491 [inline] kfree+0xcf/0x230 mm/slab.c:3816 sctp_stream_outq_migrate+0x3e6/0x540 net/sctp/stream.c:88 sctp_stream_init+0xbc/0x410 net/sctp/stream.c:139 sctp_process_init+0x21c3/0x2b20 net/sctp/sm_make_chunk.c:2466 sctp_cmd_process_init net/sctp/sm_sideeffect.c:682 [inline] sctp_cmd_interpreter net/sctp/sm_sideeffect.c:1410 [inline] sctp_side_effects net/sctp/sm_sideeffect.c:1220 [inline] sctp_do_sm+0x3145/0x5380 net/sctp/sm_sideeffect.c:1191 sctp_assoc_bh_rcv+0x343/0x660 net/sctp/associola.c:1074 sctp_inq_push+0x1ea/0x290 net/sctp/inqueue.c:95 sctp_backlog_rcv+0x196/0xbe0 net/sctp/input.c:354 sk_backlog_rcv include/net/sock.h:937 [inline] __release_sock+0x12e/0x3a0 net/core/sock.c:2379 release_sock+0x59/0x1c0 net/core/sock.c:2895 sctp_wait_for_connect+0x316/0x540 net/sctp/socket.c:8998 sctp_sendmsg_to_asoc+0x13e3/0x17b0 net/sctp/socket.c:1967 sctp_sendmsg+0x10a9/0x17e0 net/sctp/socket.c:2113 inet_sendmsg+0x147/0x5d0 net/ipv4/af_inet.c:798 sock_sendmsg_nosec net/socket.c:621 [inline] sock_sendmsg+0xdd/0x130 net/socket.c:631 ___sys_sendmsg+0x806/0x930 net/socket.c:2136 __sys_sendmsg+0x105/0x1d0 net/socket.c:2174 __do_sys_sendmsg net/socket.c:2183 [inline] __se_sys_sendmsg net/socket.c:2181 [inline] __x64_sys_sendmsg+0x78/0xb0 net/socket.c:2181 do_syscall_64+0x103/0x610 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff88808ea48800 which belongs to the cache kmalloc-96 of size 96 The buggy address is located 0 bytes inside of 96-byte region [ffff88808ea48800, ffff88808ea48860) The buggy address belongs to the page: page:ffffea00023a9200 count:1 mapcount:0 mapping:ffff88812c3f04c0 index:0x0 flags: 0x1fffc0000000200(slab) raw: 01fffc0000000200 ffffea00006a9d88 ffffea0001e81748 ffff88812c3f04c0 raw: 0000000000000000 ffff88808ea48000 0000000100000020 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88808ea48700: 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc fc ffff88808ea48780: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc >ffff88808ea48800: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc ^ ffff88808ea48880: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc ffff88808ea48900: 00 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc ==================================================================