================================================================== BUG: KASAN: use-after-free in __read_once_size include/linux/compiler.h:183 [inline] BUG: KASAN: use-after-free in atomic_read arch/x86/include/asm/atomic.h:27 [inline] BUG: KASAN: use-after-free in refcount_inc_not_zero+0x16e/0x180 lib/refcount.c:120 Read of size 4 at addr ffff8801c47e2358 by task syz-executor6/18136 CPU: 1 PID: 18136 Comm: syz-executor6 Not tainted 4.15.0-rc1+ #200 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_load4_noabort+0x14/0x20 mm/kasan/report.c:429 __read_once_size include/linux/compiler.h:183 [inline] atomic_read arch/x86/include/asm/atomic.h:27 [inline] refcount_inc_not_zero+0x16e/0x180 lib/refcount.c:120 refcount_inc+0x15/0x50 lib/refcount.c:153 sctp_association_hold+0x16/0x20 net/sctp/associola.c:874 sctp_generate_timeout_event+0x2b0/0x330 net/sctp/sm_sideeffect.c:299 sctp_generate_t1_init_event+0x1e/0x30 net/sctp/sm_sideeffect.c:336 call_timer_fn+0x23b/0x840 kernel/time/timer.c:1320 expire_timers kernel/time/timer.c:1357 [inline] __run_timers+0x7e1/0xb60 kernel/time/timer.c:1660 run_timer_softirq+0x4c/0xb0 kernel/time/timer.c:1686 __do_softirq+0x29d/0xbb2 kernel/softirq.c:285 invoke_softirq kernel/softirq.c:365 [inline] irq_exit+0x1d3/0x210 kernel/softirq.c:405 exiting_irq arch/x86/include/asm/apic.h:540 [inline] smp_apic_timer_interrupt+0x16b/0x700 arch/x86/kernel/apic/apic.c:1052 apic_timer_interrupt+0x9d/0xb0 arch/x86/entry/entry_64.S:795 RIP: 0010:zap_pte_range mm/memory.c:1300 [inline] RIP: 0010:zap_pmd_range mm/memory.c:1438 [inline] RIP: 0010:zap_pud_range mm/memory.c:1467 [inline] RIP: 0010:zap_p4d_range mm/memory.c:1488 [inline] RIP: 0010:unmap_page_range+0xcc2/0x22e0 mm/memory.c:1509 RSP: 0018:ffff8801c3e6ed20 EFLAGS: 00000246 ORIG_RAX: ffffffffffffff11 RAX: 1ffff1003afdcd02 RBX: dffffc0000000000 RCX: ffffffff819a12d7 RDX: 0000000000000000 RSI: ffffea00064e8000 RDI: ffff8801d86f900c RBP: ffff8801c3e6f1c8 R08: 1ffffffff0d2ef33 R09: 0000000000000004 R10: 0000000000000000 R11: ffffffff87489d60 R12: 0000000000702000 R13: ffffea00064e8000 R14: ffff8801d7ee6810 R15: 0000000000000002 unmap_single_vma+0x15f/0x2d0 mm/memory.c:1554 unmap_vmas+0xf1/0x1b0 mm/memory.c:1584 exit_mmap+0x232/0x530 mm/mmap.c:3018 __mmput kernel/fork.c:924 [inline] mmput+0x223/0x6d0 kernel/fork.c:945 exit_mm kernel/exit.c:544 [inline] do_exit+0x90a/0x1ae0 kernel/exit.c:852 do_group_exit+0x149/0x400 kernel/exit.c:968 get_signal+0x73f/0x16c0 kernel/signal.c:2335 do_signal+0x94/0x1ee0 arch/x86/kernel/signal.c:809 exit_to_usermode_loop+0x214/0x310 arch/x86/entry/common.c:158 prepare_exit_to_usermode arch/x86/entry/common.c:195 [inline] syscall_return_slowpath+0x490/0x550 arch/x86/entry/common.c:264 entry_SYSCALL_64_fastpath+0x94/0x96 RIP: 0033:0x4529d9 RSP: 002b:00007fea89643c58 EFLAGS: 00000212 ORIG_RAX: 0000000000000137 RAX: 0000000000000171 RBX: 0000000000758020 RCX: 00000000004529d9 RDX: 0000000000000005 RSI: 0000000020832000 RDI: 00000000000005b6 RBP: 00000000000003f8 R08: 0000000000000004 R09: 0000000000000000 R10: 000000002031c000 R11: 0000000000000212 R12: 00000000006f2fe0 R13: 00000000ffffffff R14: 00007fea896446d4 R15: 0000000000000000 Allocated by task 18147: 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:3613 kmalloc include/linux/slab.h:499 [inline] kzalloc include/linux/slab.h:688 [inline] sctp_association_new+0x114/0x2130 net/sctp/associola.c:308 sctp_sendmsg+0x1cfd/0x3300 net/sctp/socket.c:1869 inet_sendmsg+0x11f/0x5e0 net/ipv4/af_inet.c:763 sock_sendmsg_nosec net/socket.c:632 [inline] sock_sendmsg+0xca/0x110 net/socket.c:642 SYSC_sendto+0x358/0x5a0 net/socket.c:1749 SyS_sendto+0x40/0x50 net/socket.c:1717 entry_SYSCALL_64_fastpath+0x1f/0x96 Freed by task 18155: 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:3491 [inline] kfree+0xca/0x250 mm/slab.c:3806 sctp_association_destroy net/sctp/associola.c:434 [inline] sctp_association_put+0x21c/0x2f0 net/sctp/associola.c:883 sctp_association_free+0x688/0x930 net/sctp/associola.c:412 sctp_cmd_delete_tcb net/sctp/sm_sideeffect.c:939 [inline] sctp_cmd_interpreter net/sctp/sm_sideeffect.c:1355 [inline] sctp_side_effects net/sctp/sm_sideeffect.c:1222 [inline] sctp_do_sm+0x271b/0x6a30 net/sctp/sm_sideeffect.c:1193 sctp_primitive_SHUTDOWN+0xa0/0xd0 net/sctp/primitive.c:104 sctp_close+0x3c6/0x980 net/sctp/socket.c:1563 inet_release+0xed/0x1c0 net/ipv4/af_inet.c:426 inet6_release+0x50/0x70 net/ipv6/af_inet6.c:433 sock_release+0x8d/0x1e0 net/socket.c:596 sock_close+0x16/0x20 net/socket.c:1125 __fput+0x333/0x7f0 fs/file_table.c:210 ____fput+0x15/0x20 fs/file_table.c:244 task_work_run+0x199/0x270 kernel/task_work.c:113 exit_task_work include/linux/task_work.h:22 [inline] do_exit+0x9bb/0x1ae0 kernel/exit.c:865 do_group_exit+0x149/0x400 kernel/exit.c:968 get_signal+0x73f/0x16c0 kernel/signal.c:2335 do_signal+0x94/0x1ee0 arch/x86/kernel/signal.c:809 exit_to_usermode_loop+0x214/0x310 arch/x86/entry/common.c:158 prepare_exit_to_usermode arch/x86/entry/common.c:195 [inline] syscall_return_slowpath+0x490/0x550 arch/x86/entry/common.c:264 entry_SYSCALL_64_fastpath+0x94/0x96 The buggy address belongs to the object at ffff8801c47e2340 which belongs to the cache kmalloc-4096 of size 4096 The buggy address is located 24 bytes inside of 4096-byte region [ffff8801c47e2340, ffff8801c47e3340) The buggy address belongs to the page: page:0000000055f750f9 count:1 mapcount:0 mapping:00000000f3481f26 index:0x0 compound_mapcount: 0 flags: 0x2fffc0000008100(slab|head) raw: 02fffc0000008100 ffff8801c47e2340 0000000000000000 0000000100000001 raw: ffffea00076176a0 ffffea00074c6fa0 ffff8801db000dc0 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8801c47e2200: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8801c47e2280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8801c47e2300: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb ^ ffff8801c47e2380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8801c47e2400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================