================================================================== BUG: KASAN: use-after-free in sctp_sock_dump+0xaa3/0xb20 net/sctp/diag.c:311 Read of size 8 at addr ffff888097a904a0 by task syz-executor.0/7739 CPU: 0 PID: 7739 Comm: syz-executor.0 Not tainted 5.5.0-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+0x197/0x210 lib/dump_stack.c:118 print_address_description.constprop.0.cold+0xd4/0x30b mm/kasan/report.c:374 __kasan_report.cold+0x1b/0x32 mm/kasan/report.c:506 kasan_report+0x12/0x20 mm/kasan/common.c:641 __asan_report_load8_noabort+0x14/0x20 mm/kasan/generic_report.c:135 sctp_sock_dump+0xaa3/0xb20 net/sctp/diag.c:311 sctp_for_each_transport+0x2b4/0x350 net/sctp/socket.c:5458 sctp_diag_dump+0x33e/0x450 net/sctp/diag.c:513 __inet_diag_dump+0x9e/0x130 net/ipv4/inet_diag.c:1053 inet_diag_dump+0x9b/0x110 net/ipv4/inet_diag.c:1069 netlink_dump+0x558/0xfb0 net/netlink/af_netlink.c:2244 __netlink_dump_start+0x673/0x930 net/netlink/af_netlink.c:2352 netlink_dump_start include/linux/netlink.h:233 [inline] inet_diag_handler_cmd+0x262/0x320 net/ipv4/inet_diag.c:1174 __sock_diag_cmd net/core/sock_diag.c:233 [inline] sock_diag_rcv_msg+0x319/0x410 net/core/sock_diag.c:264 netlink_rcv_skb+0x177/0x450 net/netlink/af_netlink.c:2477 sock_diag_rcv+0x2b/0x40 net/core/sock_diag.c:275 netlink_unicast_kernel net/netlink/af_netlink.c:1302 [inline] netlink_unicast+0x59e/0x7e0 net/netlink/af_netlink.c:1328 netlink_sendmsg+0x91c/0xea0 net/netlink/af_netlink.c:1917 sock_sendmsg_nosec net/socket.c:652 [inline] sock_sendmsg+0xd7/0x130 net/socket.c:672 sock_write_iter+0x2cb/0x400 net/socket.c:1004 call_write_iter include/linux/fs.h:1901 [inline] do_iter_readv_writev+0x5f8/0x8f0 fs/read_write.c:693 do_iter_write fs/read_write.c:998 [inline] do_iter_write+0x184/0x610 fs/read_write.c:979 vfs_writev+0x1b3/0x2f0 fs/read_write.c:1071 do_writev+0x2b0/0x330 fs/read_write.c:1114 __do_sys_writev fs/read_write.c:1187 [inline] __se_sys_writev fs/read_write.c:1184 [inline] __x64_sys_writev+0x75/0xb0 fs/read_write.c:1184 do_syscall_64+0xfa/0x790 arch/x86/entry/common.c:294 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x45b399 Code: ad b6 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 7b b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007fb812102c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000014 RAX: ffffffffffffffda RBX: 00007fb8121036d4 RCX: 000000000045b399 RDX: 0000000000000001 RSI: 0000000020000000 RDI: 000000000000000c RBP: 000000000075c1c0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff R13: 0000000000000cdd R14: 00000000004c9cac R15: 000000000075c1cc Allocated by task 7739: save_stack+0x23/0x90 mm/kasan/common.c:72 set_track mm/kasan/common.c:80 [inline] __kasan_kmalloc mm/kasan/common.c:515 [inline] __kasan_kmalloc.constprop.0+0xcf/0xe0 mm/kasan/common.c:488 kasan_kmalloc+0x9/0x10 mm/kasan/common.c:529 kmem_cache_alloc_trace+0x158/0x790 mm/slab.c:3551 kmalloc include/linux/slab.h:555 [inline] kzalloc include/linux/slab.h:669 [inline] sctp_endpoint_new+0x79/0xc80 net/sctp/endpointola.c:134 sctp_init_sock+0xd00/0x1460 net/sctp/socket.c:5143 inet6_create net/ipv6/af_inet6.c:253 [inline] inet6_create+0x9ce/0xf80 net/ipv6/af_inet6.c:107 __sock_create+0x3ce/0x730 net/socket.c:1433 sock_create net/socket.c:1484 [inline] __sys_socket+0x103/0x220 net/socket.c:1526 __do_sys_socket net/socket.c:1535 [inline] __se_sys_socket net/socket.c:1533 [inline] __x64_sys_socket+0x73/0xb0 net/socket.c:1533 do_syscall_64+0xfa/0x790 arch/x86/entry/common.c:294 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 7738: save_stack+0x23/0x90 mm/kasan/common.c:72 set_track mm/kasan/common.c:80 [inline] kasan_set_free_info mm/kasan/common.c:337 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/common.c:476 kasan_slab_free+0xe/0x10 mm/kasan/common.c:485 __cache_free mm/slab.c:3426 [inline] kfree+0x10a/0x2c0 mm/slab.c:3757 sctp_endpoint_destroy net/sctp/endpointola.c:220 [inline] sctp_endpoint_put+0x22d/0x2d0 net/sctp/endpointola.c:236 sctp_endpoint_free+0x77/0x90 net/sctp/endpointola.c:183 sctp_destroy_sock+0x9f/0x3e0 net/sctp/socket.c:5196 sctp_v6_destroy_sock+0x16/0x30 net/sctp/socket.c:9636 sk_common_release+0x6b/0x390 net/core/sock.c:3170 sctp_close+0x553/0x960 net/sctp/socket.c:1536 inet_release+0xed/0x200 net/ipv4/af_inet.c:427 inet6_release+0x53/0x80 net/ipv6/af_inet6.c:470 __sock_release+0xce/0x280 net/socket.c:605 sock_close+0x1e/0x30 net/socket.c:1283 __fput+0x2ff/0x890 fs/file_table.c:280 ____fput+0x16/0x20 fs/file_table.c:313 task_work_run+0x145/0x1c0 kernel/task_work.c:113 get_signal+0x206e/0x24f0 kernel/signal.c:2528 do_signal+0x87/0x1700 arch/x86/kernel/signal.c:813 exit_to_usermode_loop+0x286/0x380 arch/x86/entry/common.c:160 prepare_exit_to_usermode arch/x86/entry/common.c:195 [inline] syscall_return_slowpath arch/x86/entry/common.c:278 [inline] do_syscall_64+0x676/0x790 arch/x86/entry/common.c:304 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff888097a90400 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 160 bytes inside of 512-byte region [ffff888097a90400, ffff888097a90600) The buggy address belongs to the page: page:ffffea00025ea400 refcount:1 mapcount:0 mapping:ffff8880aa400a80 index:0x0 flags: 0xfffe0000000200(slab) raw: 00fffe0000000200 ffffea00027bae88 ffffea000236a308 ffff8880aa400a80 raw: 0000000000000000 ffff888097a90000 0000000100000004 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888097a90380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888097a90400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888097a90480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888097a90500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888097a90580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================