================================================================== BUG: KASAN: use-after-free in sctp_auth_destroy_hmacs.part.1+0x5b/0x60 net/sctp/auth.c:509 Read of size 8 at addr ffff8880998e89c0 by task syz-executor.5/8419 CPU: 0 PID: 8419 Comm: syz-executor.5 Not tainted 5.3.0-rc5-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+0x165/0x21a lib/dump_stack.c:113 print_address_description.cold.4+0x9/0x327 mm/kasan/report.c:351 __kasan_report.cold.5+0x1b/0x40 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 sctp_auth_destroy_hmacs.part.1+0x5b/0x60 net/sctp/auth.c:509 sctp_auth_destroy_hmacs net/sctp/auth.c:505 [inline] sctp_auth_free+0xe3/0x160 net/sctp/auth.c:1076 sctp_endpoint_destroy net/sctp/endpointola.c:201 [inline] sctp_endpoint_put+0x92/0x1b0 net/sctp/endpointola.c:234 sctp_endpoint_free+0x6c/0x80 net/sctp/endpointola.c:181 sctp_destroy_sock+0x84/0x390 net/sctp/socket.c:5110 sctp_v6_destroy_sock+0xd/0x20 net/sctp/socket.c:9448 sk_common_release+0x5e/0x2d0 net/core/sock.c:3160 sctp_close+0x3e5/0x750 net/sctp/socket.c:1536 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/0x780 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+0x1f2/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_64+0x462/0x540 arch/x86/entry/common.c:299 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x417781 Code: 75 14 b8 03 00 00 00 0f 05 48 3d 01 f0 ff ff 0f 83 a4 1a 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:00007ffe1de152d0 EFLAGS: 00000293 ORIG_RAX: 0000000000000003 RAX: 0000000000000000 RBX: 0000000000000004 RCX: 0000000000417781 RDX: 0000001b2e020000 RSI: 0000000000000001 RDI: 0000000000000003 RBP: 0000000000000001 R08: 0000000000000000 R09: 0000000000000000 R10: 00007ffe1de153b0 R11: 0000000000000293 R12: 000000000118c9a0 R13: 000000000118c9a0 R14: 00000000000003e8 R15: 000000000118bf2c Allocated by task 8432: save_stack mm/kasan/common.c:69 [inline] set_track mm/kasan/common.c:77 [inline] __kasan_kmalloc.part.0+0x44/0xc0 mm/kasan/common.c:487 __kasan_kmalloc.constprop.1+0xb1/0xc0 mm/kasan/common.c:468 kasan_kmalloc+0x9/0x10 mm/kasan/common.c:501 kmem_cache_alloc_trace+0x162/0x410 mm/slab.c:3550 kmalloc include/linux/slab.h:552 [inline] kmalloc_array include/linux/slab.h:675 [inline] kcalloc include/linux/slab.h:687 [inline] sctp_auth_init_hmacs+0xab/0x270 net/sctp/auth.c:464 sctp_auth_init+0x7e/0x470 net/sctp/auth.c:1055 sctp_setsockopt_auth_supported net/sctp/socket.c:4547 [inline] sctp_setsockopt+0x2843/0x5ee0 net/sctp/socket.c:4767 sock_common_setsockopt+0x73/0xf0 net/core/sock.c:3139 __sys_setsockopt+0x213/0x440 net/socket.c:2084 __do_sys_setsockopt net/socket.c:2100 [inline] __se_sys_setsockopt net/socket.c:2097 [inline] __x64_sys_setsockopt+0xb9/0x150 net/socket.c:2097 do_syscall_64+0xd0/0x540 arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 8432: save_stack mm/kasan/common.c:69 [inline] set_track mm/kasan/common.c:77 [inline] __kasan_slab_free+0x11a/0x1e0 mm/kasan/common.c:449 kasan_slab_free+0xe/0x10 mm/kasan/common.c:457 __cache_free mm/slab.c:3425 [inline] kfree+0x104/0x2d0 mm/slab.c:3756 sctp_auth_destroy_hmacs.part.1+0x4a/0x60 net/sctp/auth.c:511 sctp_auth_destroy_hmacs net/sctp/auth.c:505 [inline] sctp_auth_init_hmacs+0x1c2/0x270 net/sctp/auth.c:496 sctp_auth_init+0x7e/0x470 net/sctp/auth.c:1055 sctp_setsockopt_auth_supported net/sctp/socket.c:4547 [inline] sctp_setsockopt+0x2843/0x5ee0 net/sctp/socket.c:4767 sock_common_setsockopt+0x73/0xf0 net/core/sock.c:3139 __sys_setsockopt+0x213/0x440 net/socket.c:2084 __do_sys_setsockopt net/socket.c:2100 [inline] __se_sys_setsockopt net/socket.c:2097 [inline] __x64_sys_setsockopt+0xb9/0x150 net/socket.c:2097 do_syscall_64+0xd0/0x540 arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff8880998e89c0 which belongs to the cache kmalloc-32 of size 32 The buggy address is located 0 bytes inside of 32-byte region [ffff8880998e89c0, ffff8880998e89e0) The buggy address belongs to the page: page:ffffea0002663a00 refcount:1 mapcount:0 mapping:ffff8880aa4001c0 index:0xffff8880998e8fc1 flags: 0xfffe0000000200(slab) raw: 00fffe0000000200 ffffea000287b408 ffffea00028abf88 ffff8880aa4001c0 raw: ffff8880998e8fc1 ffff8880998e8000 000000010000003b 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880998e8880: 00 00 fc fc fc fc fc fc 05 fc fc fc fc fc fc fc ffff8880998e8900: 00 00 fc fc fc fc fc fc fb fb fb fb fc fc fc fc >ffff8880998e8980: 05 fc fc fc fc fc fc fc fb fb fb fb fc fc fc fc ^ ffff8880998e8a00: fb fb fb fb fc fc fc fc 05 fc fc fc fc fc fc fc ffff8880998e8a80: 05 fc fc fc fc fc fc fc 05 fc fc fc fc fc fc fc ==================================================================