Debian GNU/Linux 7 syzkaller ttyS0 2017/08/19 23:25:31 parsed 1 programs 2017/08/19 23:25:31 executed programs: 0 syzkaller login: [ 35.082226] ================================================================== [ 35.083315] BUG: KASAN: use-after-free in userfaultfd_release+0x5c1/0x6e0 [ 35.083817] Read of size 8 at addr ffff88006c477320 by task syz-executor0/3395 [ 35.084331] [ 35.084443] CPU: 3 PID: 3395 Comm: syz-executor0 Not tainted 4.13.0-rc5-next-20170817+ #5 [ 35.085052] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011 [ 35.085643] Call Trace: [ 35.085825] dump_stack+0x194/0x257 [ 35.086091] ? arch_local_irq_restore+0x53/0x53 [ 35.086442] ? show_regs_print_info+0x65/0x65 [ 35.086796] ? is_bpf_text_address+0xa4/0x120 [ 35.087145] ? unwind_get_return_address+0x61/0xa0 [ 35.087499] ? userfaultfd_release+0x5c1/0x6e0 [ 35.087860] print_address_description+0x73/0x250 [ 35.088217] ? userfaultfd_release+0x5c1/0x6e0 [ 35.088535] kasan_report+0x24e/0x340 [ 35.088845] ? userfaultfd_event_wait_completion+0x910/0x910 [ 35.089319] __asan_report_load8_noabort+0x14/0x20 [ 35.089701] userfaultfd_release+0x5c1/0x6e0 [ 35.090070] ? fcntl_setlk+0x10c0/0x10c0 [ 35.090367] ? kmem_cache_free+0x77/0x280 [ 35.090642] ? do_exit+0xa33/0x1b30 [ 35.090939] ? userfaultfd_event_wait_completion+0x910/0x910 [ 35.091345] ? fsnotify+0x1af0/0x1af0 [ 35.091600] ? rcu_note_context_switch+0x710/0x710 [ 35.091935] ? __might_sleep+0x95/0x190 [ 35.092235] ? userfaultfd_event_wait_completion+0x910/0x910 [ 35.092619] __fput+0x327/0x7e0 [ 35.092842] ? fput+0x140/0x140 [ 35.093115] ? do_raw_spin_trylock+0x190/0x190 [ 35.093423] ____fput+0x15/0x20 [ 35.093656] task_work_run+0x199/0x270 [ 35.093986] ? task_work_cancel+0x210/0x210 [ 35.094308] ? _raw_spin_unlock+0x22/0x30 [ 35.094586] ? switch_task_namespaces+0x87/0xc0 [ 35.094901] do_exit+0xa52/0x1b30 [ 35.095154] ? __might_sleep+0x95/0x190 [ 35.095448] ? __fd_install+0x2f7/0x6a0 [ 35.095730] ? mm_update_next_owner+0x930/0x930 [ 35.096052] ? lock_acquire+0x1d5/0x580 [ 35.096370] ? userfaultfd_ctx_read+0x935/0x2100 [ 35.096714] ? lock_downgrade+0x990/0x990 [ 35.097055] ? do_raw_spin_trylock+0x190/0x190 [ 35.097396] ? compat_SyS_epoll_pwait+0x520/0x520 [ 35.097738] ? debug_check_no_locks_freed+0x3c0/0x3c0 [ 35.098145] ? _raw_spin_unlock+0x22/0x30 [ 35.098437] ? userfaultfd_ctx_read+0x975/0x2100 [ 35.098759] ? userfaultfd_release+0x6e0/0x6e0 [ 35.099097] ? save_stack_trace+0x16/0x20 [ 35.099388] ? save_stack+0x43/0xd0 [ 35.099643] ? kasan_slab_free+0x71/0xc0 [ 35.099947] ? futex_wait_setup+0x22e/0x3d0 [ 35.100277] ? futex_wake+0x680/0x680 [ 35.100545] ? __dequeue_signal+0x103/0x7b0 [ 35.100890] ? recalc_sigpending_tsk+0x117/0x150 [ 35.101256] ? get_signal+0x855/0x17e0 [ 35.101515] ? lock_downgrade+0x990/0x990 [ 35.101836] do_group_exit+0x149/0x400 [ 35.102143] ? SyS_exit+0x30/0x30 [ 35.102373] ? drop_futex_key_refs.isra.13+0x60/0xb0 [ 35.102715] get_signal+0x7e8/0x17e0 [ 35.102973] ? ptrace_notify+0x130/0x130 [ 35.103275] ? check_same_owner+0x320/0x320 [ 35.103878] ? lock_release+0xa40/0xa40 [ 35.104196] ? __might_sleep+0x95/0x190 [ 35.104461] ? wake_up_q+0xe0/0xe0 [ 35.104724] ? kasan_check_read+0x11/0x20 [ 35.105035] ? __fsnotify_parent+0xb4/0x3a0 [ 35.105365] do_signal+0x94/0x1ee0 [ 35.105615] ? rw_verify_area+0xe5/0x2b0 [ 35.105904] ? setup_sigcontext+0x7d0/0x7d0 [ 35.106225] ? dup_iter+0x260/0x260 [ 35.106536] ? kfree+0x1c5/0x250 [ 35.106764] ? vfs_readv+0x14c/0x1c0 [ 35.107020] ? __fget_light+0x297/0x380 [ 35.107356] ? fget_raw+0x20/0x20 [ 35.107613] ? security_mmap_file+0x14e/0x190 [ 35.107961] ? vm_mmap_pgoff+0x1fc/0x280 [ 35.108312] ? vm_mmap_pgoff+0x13b/0x280 [ 35.108655] exit_to_usermode_loop+0x224/0x300 [ 35.108991] ? trace_event_raw_event_sys_exit+0x260/0x260 [ 35.109471] ? fput+0xd2/0x140 [ 35.109702] syscall_return_slowpath+0x42f/0x500 [ 35.110108] ? prepare_exit_to_usermode+0x2c0/0x2c0 [ 35.110468] ? vfs_readv+0x1c0/0x1c0 [ 35.110730] ? find_mergeable_anon_vma+0xd0/0xd0 [ 35.111056] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 35.111400] entry_SYSCALL_64_fastpath+0xbc/0xbe [ 35.111730] RIP: 0033:0x446739 [ 35.111959] RSP: 002b:00007fd44cc0cc08 EFLAGS: 00000292 ORIG_RAX: 0000000000000013 [ 35.112515] RAX: 0000000000000020 RBX: 0000000000000007 RCX: 0000000000446739 [ 35.113015] RDX: 0000000000000007 RSI: 0000000020053f90 RDI: 0000000000000007 [ 35.113586] RBP: 00000000007082a0 R08: 0000000000000000 R09: 0000000000000000 [ 35.114128] R10: 0000000000000000 R11: 0000000000000292 R12: 00000000ffffffff [ 35.114689] R13: 0000000000003f10 R14: 00000000006e5fd0 R15: 0000000020053f90 [ 35.115195] [ 35.115318] Allocated by task 3392: [ 35.115559] save_stack_trace+0x16/0x20 [ 35.115838] save_stack+0x43/0xd0 [ 35.116123] kasan_kmalloc+0xad/0xe0 [ 35.116469] kasan_slab_alloc+0x12/0x20 [ 35.116862] kmem_cache_alloc+0x12e/0x760 [ 35.117203] dup_userfaultfd+0x21c/0x890 [ 35.117489] copy_mm+0xa27/0x1247 [ 35.117712] copy_process.part.36+0x1ea3/0x4af0 [ 35.118029] _do_fork+0x1ef/0xfb0 [ 35.118283] SyS_clone+0x37/0x50 [ 35.118591] do_syscall_64+0x26c/0x8c0 [ 35.118841] return_from_SYSCALL_64+0x0/0x7a [ 35.119148] [ 35.119259] Freed by task 3392: [ 35.119538] save_stack_trace+0x16/0x20 [ 35.119820] save_stack+0x43/0xd0 [ 35.120138] kasan_slab_free+0x71/0xc0 [ 35.120409] kmem_cache_free+0x77/0x280 [ 35.120666] userfaultfd_ctx_put+0x50c/0x740 [ 35.120981] userfaultfd_event_wait_completion+0x754/0x910 [ 35.121436] dup_userfaultfd_complete+0x2de/0x480 [ 35.121817] copy_mm+0xde2/0x1247 [ 35.122104] copy_process.part.36+0x1ea3/0x4af0 [ 35.122472] _do_fork+0x1ef/0xfb0 [ 35.122748] SyS_clone+0x37/0x50 [ 35.123002] do_syscall_64+0x26c/0x8c0 [ 35.123332] return_from_SYSCALL_64+0x0/0x7a [ 35.123665] [ 35.123811] The buggy address belongs to the object at ffff88006c4771c0 [ 35.123811] which belongs to the cache userfaultfd_ctx_cache of size 360 [ 35.124728] The buggy address is located 352 bytes inside of [ 35.124728] 360-byte region [ffff88006c4771c0, ffff88006c477328) [ 35.126028] The buggy address belongs to the page: [ 35.126360] page:ffffea0001b11dc0 count:1 mapcount:0 mapping:ffff88006c477000 index:0xffff88006c477ff7 [ 35.127048] flags: 0x500000000000100(slab) [ 35.127335] raw: 0500000000000100 ffff88006c477000 ffff88006c477ff7 0000000100000009 [ 35.127861] raw: ffffea0001ac3aa0 ffffea0001a3bee0 ffff88006bfdd500 0000000000000000 [ 35.128524] page dumped because: kasan: bad access detected [ 35.128899] [ 35.129009] Memory state around the buggy address: [ 35.129340] ffff88006c477200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 35.129845] ffff88006c477280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 35.130312] >ffff88006c477300: fb fb fb fb fb fc fc fc fc fc fc fc fc fc fc fc [ 35.130841] ^ [ 35.131146] ffff88006c477380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 35.131687] ffff88006c477400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 35.132193] ================================================================== [ 35.132735] Kernel panic - not syncing: panic_on_warn set ... [ 35.132735] [ 35.133231] CPU: 3 PID: 3395 Comm: syz-executor0 Tainted: G B 4.13.0-rc5-next-20170817+ #5 [ 35.133861] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011 [ 35.134402] Call Trace: [ 35.134577] dump_stack+0x194/0x257 [ 35.134820] ? arch_local_irq_restore+0x53/0x53 [ 35.135141] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 35.135525] ? userfaultfd_release+0x580/0x6e0 [ 35.135885] panic+0x1e4/0x417 [ 35.136114] ? __warn+0x1d9/0x1d9 [ 35.136417] ? userfaultfd_release+0x5c1/0x6e0 [ 35.136735] kasan_end_report+0x50/0x50 [ 35.136998] kasan_report+0x137/0x340 [ 35.137250] ? userfaultfd_event_wait_completion+0x910/0x910 [ 35.137649] __asan_report_load8_noabort+0x14/0x20 [ 35.137991] userfaultfd_release+0x5c1/0x6e0 [ 35.138285] ? fcntl_setlk+0x10c0/0x10c0 [ 35.138553] ? kmem_cache_free+0x77/0x280 [ 35.138857] ? do_exit+0xa33/0x1b30 [ 35.139125] ? userfaultfd_event_wait_completion+0x910/0x910 [ 35.139523] ? fsnotify+0x1af0/0x1af0 [ 35.139806] ? rcu_note_context_switch+0x710/0x710 [ 35.140148] ? __might_sleep+0x95/0x190 [ 35.140469] ? userfaultfd_event_wait_completion+0x910/0x910 [ 35.140881] __fput+0x327/0x7e0 [ 35.141102] ? fput+0x140/0x140 [ 35.141323] ? do_raw_spin_trylock+0x190/0x190 [ 35.141630] ____fput+0x15/0x20 [ 35.141891] task_work_run+0x199/0x270 [ 35.142190] ? task_work_cancel+0x210/0x210 [ 35.142519] ? _raw_spin_unlock+0x22/0x30 [ 35.142822] ? switch_task_namespaces+0x87/0xc0 [ 35.143184] do_exit+0xa52/0x1b30 [ 35.143431] ? __might_sleep+0x95/0x190 [ 35.143774] ? __fd_install+0x2f7/0x6a0 [ 35.144072] ? mm_update_next_owner+0x930/0x930 [ 35.144419] ? lock_acquire+0x1d5/0x580 [ 35.144705] ? userfaultfd_ctx_read+0x935/0x2100 [ 35.145086] ? lock_downgrade+0x990/0x990 [ 35.145373] ? do_raw_spin_trylock+0x190/0x190 [ 35.145714] ? compat_SyS_epoll_pwait+0x520/0x520 [ 35.146104] ? debug_check_no_locks_freed+0x3c0/0x3c0 [ 35.146814] ? _raw_spin_unlock+0x22/0x30 [ 35.147119] ? userfaultfd_ctx_read+0x975/0x2100 [ 35.147451] ? userfaultfd_release+0x6e0/0x6e0 [ 35.147770] ? save_stack_trace+0x16/0x20 [ 35.148056] ? save_stack+0x43/0xd0 [ 35.148311] ? kasan_slab_free+0x71/0xc0 [ 35.148598] ? futex_wait_setup+0x22e/0x3d0 [ 35.148888] ? futex_wake+0x680/0x680 [ 35.149167] ? __dequeue_signal+0x103/0x7b0 [ 35.149454] ? recalc_sigpending_tsk+0x117/0x150 [ 35.149770] ? get_signal+0x855/0x17e0 [ 35.150028] ? lock_downgrade+0x990/0x990 [ 35.150347] do_group_exit+0x149/0x400 [ 35.150620] ? SyS_exit+0x30/0x30 [ 35.150902] ? drop_futex_key_refs.isra.13+0x60/0xb0 [ 35.151272] get_signal+0x7e8/0x17e0 [ 35.151554] ? ptrace_notify+0x130/0x130 [ 35.151851] ? check_same_owner+0x320/0x320 [ 35.152254] ? lock_release+0xa40/0xa40 [ 35.152521] ? __might_sleep+0x95/0x190 [ 35.152799] ? wake_up_q+0xe0/0xe0 [ 35.153050] ? kasan_check_read+0x11/0x20 [ 35.153355] ? __fsnotify_parent+0xb4/0x3a0 [ 35.153685] do_signal+0x94/0x1ee0 [ 35.153958] ? rw_verify_area+0xe5/0x2b0 [ 35.154242] ? setup_sigcontext+0x7d0/0x7d0 [ 35.154529] ? dup_iter+0x260/0x260 [ 35.154786] ? kfree+0x1c5/0x250 [ 35.155023] ? vfs_readv+0x14c/0x1c0 [ 35.155323] ? __fget_light+0x297/0x380 [ 35.155617] ? fget_raw+0x20/0x20 [ 35.155874] ? security_mmap_file+0x14e/0x190 [ 35.156295] ? vm_mmap_pgoff+0x1fc/0x280 [ 35.156605] ? vm_mmap_pgoff+0x13b/0x280 [ 35.156892] exit_to_usermode_loop+0x224/0x300 [ 35.157197] ? trace_event_raw_event_sys_exit+0x260/0x260 [ 35.157563] ? fput+0xd2/0x140 [ 35.157779] syscall_return_slowpath+0x42f/0x500 [ 35.158122] ? prepare_exit_to_usermode+0x2c0/0x2c0 [ 35.158475] ? vfs_readv+0x1c0/0x1c0 [ 35.158737] ? find_mergeable_anon_vma+0xd0/0xd0 [ 35.159109] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 35.159427] entry_SYSCALL_64_fastpath+0xbc/0xbe [ 35.159740] RIP: 0033:0x446739 [ 35.159960] RSP: 002b:00007fd44cc0cc08 EFLAGS: 00000292 ORIG_RAX: 0000000000000013 [ 35.160471] RAX: 0000000000000020 RBX: 0000000000000007 RCX: 0000000000446739 [ 35.160986] RDX: 0000000000000007 RSI: 0000000020053f90 RDI: 0000000000000007 [ 35.161556] RBP: 00000000007082a0 R08: 0000000000000000 R09: 0000000000000000 [ 35.162089] R10: 0000000000000000 R11: 0000000000000292 R12: 00000000ffffffff [ 35.162566] R13: 0000000000003f10 R14: 00000000006e5fd0 R15: 0000000020053f90 [ 35.163113] Dumping ftrace buffer: [ 35.163362] (ftrace buffer empty) [ 35.163663] Kernel Offset: disabled [ 35.163920] Rebooting in 86400 seconds..