[?25l[?1c7[ ok 8[?25h[?0c. Starting mcstransd: [....] Starting periodic command scheduler: cron[?25l[?1c7[ ok 8[?25h[?0c. [....] Starting file context maintaining daemon: restorecond[?25l[?1c7[ ok 8[?25h[?0c. [....] Starting OpenBSD Secure Shell server: sshd[?25l[?1c7[ ok 8[?25h[?0c. Debian GNU/Linux 7 syzkaller ttyS0 syzkaller login: [ 20.071482] audit: type=1400 audit(1520610948.085:6): avc: denied { map } for pid=4220 comm="bash" path="/bin/bash" dev="sda1" ino=1457 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=system_u:object_r:file_t:s0 tclass=file permissive=1 [ 20.102690] sshd (4218) used greatest stack depth: 16712 bytes left Warning: Permanently added '10.128.10.20' (ECDSA) to the list of known hosts. executing program [ 26.433393] audit: type=1400 audit(1520610954.447:7): avc: denied { map } for pid=4234 comm="syzkaller772001" path="/root/syzkaller772001888" dev="sda1" ino=16481 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:user_home_t:s0 tclass=file permissive=1 [ 26.438764] ================================================================== [ 26.466672] BUG: KASAN: use-after-free in ucma_close+0x2d7/0x2f0 [ 26.472793] Read of size 8 at addr ffff8801b07913c0 by task syzkaller772001/4234 [ 26.480294] [ 26.481895] CPU: 0 PID: 4234 Comm: syzkaller772001 Not tainted 4.16.0-rc4+ #346 [ 26.489307] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 26.498632] Call Trace: [ 26.501191] dump_stack+0x194/0x24d [ 26.504790] ? arch_local_irq_restore+0x53/0x53 [ 26.509432] ? show_regs_print_info+0x18/0x18 [ 26.513905] ? ucma_close+0x2d7/0x2f0 [ 26.517680] print_address_description+0x73/0x250 [ 26.522495] ? ucma_close+0x2d7/0x2f0 [ 26.526265] kasan_report+0x23c/0x360 [ 26.530039] __asan_report_load8_noabort+0x14/0x20 [ 26.534939] ucma_close+0x2d7/0x2f0 [ 26.538537] ? __might_sleep+0x95/0x190 [ 26.542486] ? ucma_free_ctx+0xd90/0xd90 [ 26.546520] __fput+0x327/0x7e0 [ 26.549782] ? fput+0x140/0x140 [ 26.553036] ? _raw_spin_unlock_irq+0x27/0x70 [ 26.557505] ____fput+0x15/0x20 [ 26.560755] task_work_run+0x199/0x270 [ 26.564614] ? task_work_cancel+0x210/0x210 [ 26.568909] ? _raw_spin_unlock+0x22/0x30 [ 26.573029] ? switch_task_namespaces+0x87/0xc0 [ 26.577672] do_exit+0x9bb/0x1ad0 [ 26.581094] ? ucma_create_id+0x45b/0x620 [ 26.585220] ? mm_update_next_owner+0x930/0x930 [ 26.589866] ? ucma_create_id+0x17b/0x620 [ 26.593987] ? ucma_get_event+0xa90/0xa90 [ 26.598113] ? __might_sleep+0x95/0x190 [ 26.602066] ? kasan_check_write+0x14/0x20 [ 26.606275] ? _copy_from_user+0x99/0x110 [ 26.610399] ? ucma_write+0x11f/0x3d0 [ 26.614167] ? ucma_get_event+0xa90/0xa90 [ 26.618287] ? ucma_resolve_route+0x1a0/0x1a0 [ 26.622764] ? ucma_resolve_route+0x1a0/0x1a0 [ 26.627228] ? __vfs_write+0xf7/0x970 [ 26.631002] ? rcu_note_context_switch+0x710/0x710 [ 26.635915] ? kernel_read+0x120/0x120 [ 26.639772] ? __might_sleep+0x95/0x190 [ 26.643720] ? _cond_resched+0x14/0x30 [ 26.647582] ? __inode_security_revalidate+0xd9/0x130 [ 26.652745] ? avc_policy_seqno+0x9/0x20 [ 26.656783] ? security_file_permission+0x89/0x1e0 [ 26.661688] ? rw_verify_area+0xe5/0x2b0 [ 26.665719] ? __fdget_raw+0x20/0x20 [ 26.669405] ? vfs_write+0x224/0x510 [ 26.673096] do_group_exit+0x149/0x400 [ 26.676954] ? SyS_write+0x184/0x220 [ 26.680638] ? filp_open+0x70/0x70 [ 26.684150] ? SyS_exit+0x30/0x30 [ 26.687572] ? SyS_read+0x220/0x220 [ 26.691172] ? do_syscall_64+0xb7/0x940 [ 26.695129] ? do_group_exit+0x400/0x400 [ 26.699165] SyS_exit_group+0x1d/0x20 [ 26.702940] do_syscall_64+0x281/0x940 [ 26.706798] ? __do_page_fault+0xc90/0xc90 [ 26.711005] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 26.715733] ? syscall_return_slowpath+0x550/0x550 [ 26.720646] ? syscall_return_slowpath+0x2ac/0x550 [ 26.725558] ? prepare_exit_to_usermode+0x350/0x350 [ 26.730548] ? entry_SYSCALL_64_after_hwframe+0x52/0xb7 [ 26.735891] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 26.740713] entry_SYSCALL_64_after_hwframe+0x42/0xb7 [ 26.745875] RIP: 0033:0x43e928 [ 26.749042] RSP: 002b:00007ffeebc39068 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 26.756735] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 000000000043e928 [ 26.763978] RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000 [ 26.771228] RBP: 00000000004be2c0 R08: 00000000000000e7 R09: ffffffffffffffd0 [ 26.778469] R10: 00000000004002c8 R11: 0000000000000246 R12: 0000000000000001 [ 26.785709] R13: 00000000006cc160 R14: 0000000000000000 R15: 0000000000000000 [ 26.792964] [ 26.794563] Allocated by task 4234: [ 26.798163] save_stack+0x43/0xd0 [ 26.801585] kasan_kmalloc+0xad/0xe0 [ 26.805269] kmem_cache_alloc_trace+0x136/0x740 [ 26.809909] ucma_alloc_ctx+0xce/0x610 [ 26.813765] ucma_create_id+0x205/0x620 [ 26.817707] ucma_write+0x2d6/0x3d0 [ 26.821305] __vfs_write+0xef/0x970 [ 26.824901] vfs_write+0x189/0x510 [ 26.828409] SyS_write+0xef/0x220 [ 26.831837] do_syscall_64+0x281/0x940 [ 26.835698] entry_SYSCALL_64_after_hwframe+0x42/0xb7 [ 26.840853] [ 26.842453] Freed by task 4234: [ 26.845703] save_stack+0x43/0xd0 [ 26.849133] __kasan_slab_free+0x11a/0x170 [ 26.853344] kasan_slab_free+0xe/0x10 [ 26.857116] kfree+0xd9/0x260 [ 26.860192] ucma_create_id+0x45b/0x620 [ 26.864137] ucma_write+0x2d6/0x3d0 [ 26.867737] __vfs_write+0xef/0x970 [ 26.871333] vfs_write+0x189/0x510 [ 26.874851] SyS_write+0xef/0x220 [ 26.878274] do_syscall_64+0x281/0x940 [ 26.882131] entry_SYSCALL_64_after_hwframe+0x42/0xb7 [ 26.887285] [ 26.888887] The buggy address belongs to the object at ffff8801b0791340 [ 26.888887] which belongs to the cache kmalloc-256 of size 256 [ 26.901509] The buggy address is located 128 bytes inside of [ 26.901509] 256-byte region [ffff8801b0791340, ffff8801b0791440) [ 26.913352] The buggy address belongs to the page: [ 26.918251] page:ffffea0006c1e440 count:1 mapcount:0 mapping:ffff8801b07910c0 index:0x0 [ 26.926367] flags: 0x2fffc0000000100(slab) [ 26.930574] raw: 02fffc0000000100 ffff8801b07910c0 0000000000000000 000000010000000c [ 26.938426] raw: ffffea0006c024a0 ffffea0006c1e5a0 ffff8801dac007c0 0000000000000000 [ 26.946277] page dumped because: kasan: bad access detected [ 26.951954] [ 26.953553] Memory state around the buggy address: [ 26.958451] ffff8801b0791280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 26.965782] ffff8801b0791300: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb [ 26.973110] >ffff8801b0791380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 26.980435] ^ [ 26.985863] ffff8801b0791400: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 26.993194] ffff8801b0791480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 27.000520] ================================================================== [ 27.007845] Disabling lock debugging due to kernel taint [ 27.013533] Kernel panic - not syncing: panic_on_warn set ... [ 27.013533] [ 27.020885] CPU: 0 PID: 4234 Comm: syzkaller772001 Tainted: G B 4.16.0-rc4+ #346 [ 27.029601] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 27.038923] Call Trace: [ 27.041484] dump_stack+0x194/0x24d [ 27.045081] ? arch_local_irq_restore+0x53/0x53 [ 27.049720] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 27.054444] ? vsnprintf+0x1ed/0x1900 [ 27.058214] ? ucma_close+0x240/0x2f0 [ 27.061983] panic+0x1e4/0x41c [ 27.065145] ? refcount_error_report+0x214/0x214 [ 27.069872] ? add_taint+0x1c/0x50 [ 27.073383] ? add_taint+0x1c/0x50 [ 27.076893] ? ucma_close+0x2d7/0x2f0 [ 27.080661] kasan_end_report+0x50/0x50 [ 27.084604] kasan_report+0x149/0x360 [ 27.088373] __asan_report_load8_noabort+0x14/0x20 [ 27.093273] ucma_close+0x2d7/0x2f0 [ 27.096869] ? __might_sleep+0x95/0x190 [ 27.100815] ? ucma_free_ctx+0xd90/0xd90 [ 27.104848] __fput+0x327/0x7e0 [ 27.108101] ? fput+0x140/0x140 [ 27.111354] ? _raw_spin_unlock_irq+0x27/0x70 [ 27.115826] ____fput+0x15/0x20 [ 27.119075] task_work_run+0x199/0x270 [ 27.122931] ? task_work_cancel+0x210/0x210 [ 27.127219] ? _raw_spin_unlock+0x22/0x30 [ 27.131336] ? switch_task_namespaces+0x87/0xc0 [ 27.135977] do_exit+0x9bb/0x1ad0 [ 27.139397] ? ucma_create_id+0x45b/0x620 [ 27.143515] ? mm_update_next_owner+0x930/0x930 [ 27.148154] ? ucma_create_id+0x17b/0x620 [ 27.152270] ? ucma_get_event+0xa90/0xa90 [ 27.156389] ? __might_sleep+0x95/0x190 [ 27.160334] ? kasan_check_write+0x14/0x20 [ 27.164540] ? _copy_from_user+0x99/0x110 [ 27.168660] ? ucma_write+0x11f/0x3d0 [ 27.172426] ? ucma_get_event+0xa90/0xa90 [ 27.176540] ? ucma_resolve_route+0x1a0/0x1a0 [ 27.181010] ? ucma_resolve_route+0x1a0/0x1a0 [ 27.185480] ? __vfs_write+0xf7/0x970 [ 27.189249] ? rcu_note_context_switch+0x710/0x710 [ 27.194160] ? kernel_read+0x120/0x120 [ 27.198024] ? __might_sleep+0x95/0x190 [ 27.201971] ? _cond_resched+0x14/0x30 [ 27.205827] ? __inode_security_revalidate+0xd9/0x130 [ 27.210984] ? avc_policy_seqno+0x9/0x20 [ 27.215023] ? security_file_permission+0x89/0x1e0 [ 27.219923] ? rw_verify_area+0xe5/0x2b0 [ 27.223953] ? __fdget_raw+0x20/0x20 [ 27.227636] ? vfs_write+0x224/0x510 [ 27.231321] do_group_exit+0x149/0x400 [ 27.235176] ? SyS_write+0x184/0x220 [ 27.238855] ? filp_open+0x70/0x70 [ 27.242363] ? SyS_exit+0x30/0x30 [ 27.245783] ? SyS_read+0x220/0x220 [ 27.249394] ? do_syscall_64+0xb7/0x940 [ 27.253338] ? do_group_exit+0x400/0x400 [ 27.257367] SyS_exit_group+0x1d/0x20 [ 27.261134] do_syscall_64+0x281/0x940 [ 27.264992] ? __do_page_fault+0xc90/0xc90 [ 27.269196] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 27.273921] ? syscall_return_slowpath+0x550/0x550 [ 27.278821] ? syscall_return_slowpath+0x2ac/0x550 [ 27.283721] ? prepare_exit_to_usermode+0x350/0x350 [ 27.288705] ? entry_SYSCALL_64_after_hwframe+0x52/0xb7 [ 27.294038] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 27.298852] entry_SYSCALL_64_after_hwframe+0x42/0xb7 [ 27.304015] RIP: 0033:0x43e928 [ 27.307177] RSP: 002b:00007ffeebc39068 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 27.314851] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 000000000043e928 [ 27.322088] RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000 [ 27.329327] RBP: 00000000004be2c0 R08: 00000000000000e7 R09: ffffffffffffffd0 [ 27.336566] R10: 00000000004002c8 R11: 0000000000000246 R12: 0000000000000001 [ 27.343803] R13: 00000000006cc160 R14: 0000000000000000 R15: 0000000000000000 [ 27.351508] Dumping ftrace buffer: [ 27.355018] (ftrace buffer empty) [ 27.358697] Kernel Offset: disabled [ 27.362291] Rebooting in 86400 seconds..