netlink: 4 bytes leftover after parsing attributes in process `syz-executor1'. ================================================================== BUG: KASAN: use-after-free in sctp_association_free+0x7b7/0x930 net/sctp/associola.c:333 Read of size 8 at addr ffff8801c9704820 by task syz-executor0/10144 CPU: 1 PID: 10144 Comm: syz-executor0 Not tainted 4.14.0-rc8+ #77 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0x194/0x257 lib/dump_stack.c:53 print_address_description+0x73/0x250 mm/kasan/report.c:252 kasan_report_error mm/kasan/report.c:351 [inline] kasan_report+0x25b/0x340 mm/kasan/report.c:409 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:430 sctp_association_free+0x7b7/0x930 net/sctp/associola.c:333 sctp_sendmsg+0x2311/0x31f0 net/sctp/socket.c:2041 inet_sendmsg+0x11f/0x5e0 net/ipv4/af_inet.c:762 sock_sendmsg_nosec net/socket.c:633 [inline] sock_sendmsg+0xca/0x110 net/socket.c:643 SYSC_sendto+0x352/0x5a0 net/socket.c:1750 SyS_sendto+0x40/0x50 net/socket.c:1718 do_syscall_32_irqs_on arch/x86/entry/common.c:329 [inline] do_fast_syscall_32+0x3f2/0xf05 arch/x86/entry/common.c:391 entry_SYSENTER_compat+0x51/0x60 arch/x86/entry/entry_64_compat.S:125 RIP: 0023:0xf7ff0c79 RSP: 002b:00000000f77aa01c EFLAGS: 00000296 ORIG_RAX: 0000000000000171 RAX: ffffffffffffffda RBX: 0000000000000014 RCX: 0000000020ffaa67 RDX: 0000000000000599 RSI: 0000000000000002 RDI: 0000000020ffbfe4 RBP: 000000000000001c R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 10144: save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59 save_stack+0x43/0xd0 mm/kasan/kasan.c:447 set_track mm/kasan/kasan.c:459 [inline] kasan_kmalloc+0xad/0xe0 mm/kasan/kasan.c:551 kmem_cache_alloc_trace+0x136/0x750 mm/slab.c:3628 kmalloc include/linux/slab.h:494 [inline] kzalloc include/linux/slab.h:667 [inline] sctp_association_new+0x114/0x21e0 net/sctp/associola.c:309 sctp_sendmsg+0x128c/0x31f0 net/sctp/socket.c:1868 inet_sendmsg+0x11f/0x5e0 net/ipv4/af_inet.c:762 sock_sendmsg_nosec net/socket.c:633 [inline] sock_sendmsg+0xca/0x110 net/socket.c:643 SYSC_sendto+0x352/0x5a0 net/socket.c:1750 SyS_sendto+0x40/0x50 net/socket.c:1718 do_syscall_32_irqs_on arch/x86/entry/common.c:329 [inline] do_fast_syscall_32+0x3f2/0xf05 arch/x86/entry/common.c:391 entry_SYSENTER_compat+0x51/0x60 arch/x86/entry/entry_64_compat.S:125 Freed by task 10144: save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59 save_stack+0x43/0xd0 mm/kasan/kasan.c:447 set_track mm/kasan/kasan.c:459 [inline] kasan_slab_free+0x71/0xc0 mm/kasan/kasan.c:524 __cache_free mm/slab.c:3504 [inline] kfree+0xca/0x250 mm/slab.c:3821 sctp_association_destroy net/sctp/associola.c:435 [inline] sctp_association_put+0x21c/0x2f0 net/sctp/associola.c:884 sctp_wait_for_sndbuf+0x5e3/0x7c0 net/sctp/socket.c:7866 sctp_sendmsg+0x2750/0x31f0 net/sctp/socket.c:1965 inet_sendmsg+0x11f/0x5e0 net/ipv4/af_inet.c:762 sock_sendmsg_nosec net/socket.c:633 [inline] sock_sendmsg+0xca/0x110 net/socket.c:643 SYSC_sendto+0x352/0x5a0 net/socket.c:1750 SyS_sendto+0x40/0x50 net/socket.c:1718 do_syscall_32_irqs_on arch/x86/entry/common.c:329 [inline] do_fast_syscall_32+0x3f2/0xf05 arch/x86/entry/common.c:391 entry_SYSENTER_compat+0x51/0x60 arch/x86/entry/entry_64_compat.S:125 The buggy address belongs to the object at ffff8801c9704800 which belongs to the cache kmalloc-4096 of size 4096 The buggy address is located 32 bytes inside of 4096-byte region [ffff8801c9704800, ffff8801c9705800) The buggy address belongs to the page: page:ffffea000725c100 count:1 mapcount:0 mapping:ffff8801c9704800 index:0x0 compound_mapcount: 0 flags: 0x2fffc0000008100(slab|head) raw: 02fffc0000008100 ffff8801c9704800 0000000000000000 0000000100000001 raw: ffffea00072439a0 ffffea0007240420 ffff8801dac00dc0 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8801c9704700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8801c9704780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8801c9704800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8801c9704880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8801c9704900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================