[?25l[?1c7[ ok 8[?25h[?0c. [....] Starting periodic command scheduler: cron[?25l[?1c7[ ok 8[?25h[?0c. Starting mcstransd: [....] Starting file context maintaining daemon: restorecond[?25l[?1c7[ ok 8[?25h[?0c. [....] Starting OpenBSD Secure Shell server: sshd[?25l[?1c7[ ok 8[?25h[?0c. [ 17.832466] audit: type=1400 audit(1520865582.590:6): avc: denied { map } for pid=4145 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 Debian GNU/Linux 7 syzkaller ttyS0 Warning: Permanently added '10.128.0.27' (ECDSA) to the list of known hosts. executing program syzkaller login: [ 24.188046] audit: type=1400 audit(1520865588.945:7): avc: denied { map } for pid=4159 comm="syzkaller926755" path="/root/syzkaller926755254" 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 [ 24.215837] ================================================================== [ 24.223251] BUG: KASAN: use-after-free in ucma_close+0x2d7/0x2f0 [ 24.229374] Read of size 8 at addr ffff8801bdcd6840 by task syzkaller926755/4159 [ 24.236876] [ 24.238476] CPU: 1 PID: 4159 Comm: syzkaller926755 Not tainted 4.16.0-rc5+ #351 [ 24.245888] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 24.255211] Call Trace: [ 24.257772] dump_stack+0x194/0x24d [ 24.261372] ? arch_local_irq_restore+0x53/0x53 [ 24.266015] ? show_regs_print_info+0x18/0x18 [ 24.270496] ? ucma_close+0x2d7/0x2f0 [ 24.274270] print_address_description+0x73/0x250 [ 24.279082] ? ucma_close+0x2d7/0x2f0 [ 24.282855] kasan_report+0x23c/0x360 [ 24.286632] __asan_report_load8_noabort+0x14/0x20 [ 24.291534] ucma_close+0x2d7/0x2f0 [ 24.295132] ? __might_sleep+0x95/0x190 [ 24.299078] ? ucma_free_ctx+0xd90/0xd90 [ 24.303110] __fput+0x327/0x7e0 [ 24.306366] ? fput+0x140/0x140 [ 24.309628] ? _raw_spin_unlock_irq+0x27/0x70 [ 24.314100] ____fput+0x15/0x20 [ 24.317353] task_work_run+0x199/0x270 [ 24.321215] ? task_work_cancel+0x210/0x210 [ 24.325510] ? _raw_spin_unlock+0x22/0x30 [ 24.329632] ? switch_task_namespaces+0x87/0xc0 [ 24.334280] do_exit+0x9bb/0x1ad0 [ 24.337702] ? ucma_create_id+0x45b/0x620 [ 24.341825] ? mm_update_next_owner+0x930/0x930 [ 24.346466] ? ucma_create_id+0x17b/0x620 [ 24.350587] ? ucma_get_event+0xa90/0xa90 [ 24.354713] ? __might_sleep+0x95/0x190 [ 24.358667] ? kasan_check_write+0x14/0x20 [ 24.362872] ? _copy_from_user+0x99/0x110 [ 24.366995] ? ucma_write+0x11f/0x3d0 [ 24.370771] ? ucma_get_event+0xa90/0xa90 [ 24.374890] ? ucma_resolve_route+0x1a0/0x1a0 [ 24.379365] ? ucma_resolve_route+0x1a0/0x1a0 [ 24.383832] ? __vfs_write+0xf7/0x970 [ 24.387602] ? rcu_note_context_switch+0x710/0x710 [ 24.392511] ? kernel_read+0x120/0x120 [ 24.396369] ? __might_sleep+0x95/0x190 [ 24.400319] ? _cond_resched+0x14/0x30 [ 24.404181] ? __inode_security_revalidate+0xd9/0x130 [ 24.409344] ? avc_policy_seqno+0x9/0x20 [ 24.413382] ? security_file_permission+0x89/0x1e0 [ 24.418283] ? rw_verify_area+0xe5/0x2b0 [ 24.422314] ? __fdget_raw+0x20/0x20 [ 24.426000] ? vfs_write+0x224/0x510 [ 24.429697] do_group_exit+0x149/0x400 [ 24.433558] ? SyS_write+0x184/0x220 [ 24.437242] ? filp_open+0x70/0x70 [ 24.440753] ? SyS_exit+0x30/0x30 [ 24.444187] ? SyS_read+0x220/0x220 [ 24.447791] ? do_syscall_64+0xb7/0x940 [ 24.451739] ? do_group_exit+0x400/0x400 [ 24.455773] SyS_exit_group+0x1d/0x20 [ 24.459555] do_syscall_64+0x281/0x940 [ 24.463413] ? __do_page_fault+0xc90/0xc90 [ 24.467621] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 24.472350] ? syscall_return_slowpath+0x550/0x550 [ 24.477249] ? syscall_return_slowpath+0x2ac/0x550 [ 24.482149] ? prepare_exit_to_usermode+0x350/0x350 [ 24.487140] ? entry_SYSCALL_64_after_hwframe+0x52/0xb7 [ 24.492479] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 24.497298] entry_SYSCALL_64_after_hwframe+0x42/0xb7 [ 24.502455] RIP: 0033:0x43e928 [ 24.505616] RSP: 002b:00007ffc083c67e8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 24.513292] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 000000000043e928 [ 24.520533] RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000 [ 24.527783] RBP: 00000000004be3c0 R08: 00000000000000e7 R09: ffffffffffffffd0 [ 24.535025] R10: 00000000004002c8 R11: 0000000000000246 R12: 0000000000000001 [ 24.542272] R13: 00000000006cc160 R14: 0000000000000000 R15: 0000000000000000 [ 24.549525] [ 24.551123] Allocated by task 4159: [ 24.554722] save_stack+0x43/0xd0 [ 24.558143] kasan_kmalloc+0xad/0xe0 [ 24.561830] kmem_cache_alloc_trace+0x136/0x740 [ 24.566467] ucma_alloc_ctx+0xce/0x610 [ 24.570323] ucma_create_id+0x205/0x620 [ 24.574266] ucma_write+0x2d6/0x3d0 [ 24.577862] __vfs_write+0xef/0x970 [ 24.581456] vfs_write+0x189/0x510 [ 24.584962] SyS_write+0xef/0x220 [ 24.588386] do_syscall_64+0x281/0x940 [ 24.592243] entry_SYSCALL_64_after_hwframe+0x42/0xb7 [ 24.597397] [ 24.598994] Freed by task 4159: [ 24.602245] save_stack+0x43/0xd0 [ 24.605669] __kasan_slab_free+0x11a/0x170 [ 24.609874] kasan_slab_free+0xe/0x10 [ 24.613645] kfree+0xd9/0x260 [ 24.616722] ucma_create_id+0x45b/0x620 [ 24.620665] ucma_write+0x2d6/0x3d0 [ 24.624259] __vfs_write+0xef/0x970 [ 24.627854] vfs_write+0x189/0x510 [ 24.631361] SyS_write+0xef/0x220 [ 24.634784] do_syscall_64+0x281/0x940 [ 24.638640] entry_SYSCALL_64_after_hwframe+0x42/0xb7 [ 24.643796] [ 24.645395] The buggy address belongs to the object at ffff8801bdcd67c0 [ 24.645395] which belongs to the cache kmalloc-256 of size 256 [ 24.658027] The buggy address is located 128 bytes inside of [ 24.658027] 256-byte region [ffff8801bdcd67c0, ffff8801bdcd68c0) [ 24.669871] The buggy address belongs to the page: [ 24.674779] page:ffffea0006f73580 count:1 mapcount:0 mapping:ffff8801bdcd6040 index:0x0 [ 24.682891] flags: 0x2fffc0000000100(slab) [ 24.687096] raw: 02fffc0000000100 ffff8801bdcd6040 0000000000000000 000000010000000c [ 24.694949] raw: ffffea0006d8c1a0 ffffea0006f54fa0 ffff8801dac007c0 0000000000000000 [ 24.702796] page dumped because: kasan: bad access detected [ 24.708474] [ 24.710071] Memory state around the buggy address: [ 24.714967] ffff8801bdcd6700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 24.722294] ffff8801bdcd6780: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb [ 24.729626] >ffff8801bdcd6800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 24.736957] ^ [ 24.742375] ffff8801bdcd6880: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 24.749702] ffff8801bdcd6900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 24.757032] ================================================================== [ 24.764358] Disabling lock debugging due to kernel taint [ 24.769827] Kernel panic - not syncing: panic_on_warn set ... [ 24.769827] [ 24.777169] CPU: 1 PID: 4159 Comm: syzkaller926755 Tainted: G B 4.16.0-rc5+ #351 [ 24.785884] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 24.795203] Call Trace: [ 24.797763] dump_stack+0x194/0x24d [ 24.801362] ? arch_local_irq_restore+0x53/0x53 [ 24.806000] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 24.810733] ? vsnprintf+0x1ed/0x1900 [ 24.814507] ? ucma_close+0x240/0x2f0 [ 24.818276] panic+0x1e4/0x41c [ 24.821442] ? refcount_error_report+0x214/0x214 [ 24.826168] ? add_taint+0x1c/0x50 [ 24.829676] ? add_taint+0x1c/0x50 [ 24.833186] ? ucma_close+0x2d7/0x2f0 [ 24.836956] kasan_end_report+0x50/0x50 [ 24.840899] kasan_report+0x149/0x360 [ 24.844671] __asan_report_load8_noabort+0x14/0x20 [ 24.849571] ucma_close+0x2d7/0x2f0 [ 24.853168] ? __might_sleep+0x95/0x190 [ 24.857114] ? ucma_free_ctx+0xd90/0xd90 [ 24.861146] __fput+0x327/0x7e0 [ 24.864401] ? fput+0x140/0x140 [ 24.867654] ? _raw_spin_unlock_irq+0x27/0x70 [ 24.872120] ____fput+0x15/0x20 [ 24.875370] task_work_run+0x199/0x270 [ 24.879228] ? task_work_cancel+0x210/0x210 [ 24.883534] ? _raw_spin_unlock+0x22/0x30 [ 24.887655] ? switch_task_namespaces+0x87/0xc0 [ 24.892297] do_exit+0x9bb/0x1ad0 [ 24.895722] ? ucma_create_id+0x45b/0x620 [ 24.899844] ? mm_update_next_owner+0x930/0x930 [ 24.904485] ? ucma_create_id+0x17b/0x620 [ 24.908602] ? ucma_get_event+0xa90/0xa90 [ 24.912725] ? __might_sleep+0x95/0x190 [ 24.916671] ? kasan_check_write+0x14/0x20 [ 24.920878] ? _copy_from_user+0x99/0x110 [ 24.924998] ? ucma_write+0x11f/0x3d0 [ 24.928773] ? ucma_get_event+0xa90/0xa90 [ 24.932890] ? ucma_resolve_route+0x1a0/0x1a0 [ 24.937358] ? ucma_resolve_route+0x1a0/0x1a0 [ 24.941821] ? __vfs_write+0xf7/0x970 [ 24.945591] ? rcu_note_context_switch+0x710/0x710 [ 24.950491] ? kernel_read+0x120/0x120 [ 24.954347] ? __might_sleep+0x95/0x190 [ 24.958295] ? _cond_resched+0x14/0x30 [ 24.962151] ? __inode_security_revalidate+0xd9/0x130 [ 24.967308] ? avc_policy_seqno+0x9/0x20 [ 24.971341] ? security_file_permission+0x89/0x1e0 [ 24.976238] ? rw_verify_area+0xe5/0x2b0 [ 24.980266] ? __fdget_raw+0x20/0x20 [ 24.983951] ? vfs_write+0x224/0x510 [ 24.987638] do_group_exit+0x149/0x400 [ 24.991496] ? SyS_write+0x184/0x220 [ 24.995179] ? filp_open+0x70/0x70 [ 24.998689] ? SyS_exit+0x30/0x30 [ 25.002118] ? SyS_read+0x220/0x220 [ 25.005723] ? do_syscall_64+0xb7/0x940 [ 25.009666] ? do_group_exit+0x400/0x400 [ 25.013698] SyS_exit_group+0x1d/0x20 [ 25.017466] do_syscall_64+0x281/0x940 [ 25.021323] ? __do_page_fault+0xc90/0xc90 [ 25.025525] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 25.030612] ? syscall_return_slowpath+0x550/0x550 [ 25.035512] ? syscall_return_slowpath+0x2ac/0x550 [ 25.040412] ? prepare_exit_to_usermode+0x350/0x350 [ 25.045399] ? entry_SYSCALL_64_after_hwframe+0x52/0xb7 [ 25.050735] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 25.055553] entry_SYSCALL_64_after_hwframe+0x42/0xb7 [ 25.060712] RIP: 0033:0x43e928 [ 25.063869] RSP: 002b:00007ffc083c67e8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 25.071546] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 000000000043e928 [ 25.078786] RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000 [ 25.086027] RBP: 00000000004be3c0 R08: 00000000000000e7 R09: ffffffffffffffd0 [ 25.093267] R10: 00000000004002c8 R11: 0000000000000246 R12: 0000000000000001 [ 25.100506] R13: 00000000006cc160 R14: 0000000000000000 R15: 0000000000000000 [ 25.108201] Dumping ftrace buffer: [ 25.111713] (ftrace buffer empty) [ 25.115390] Kernel Offset: disabled [ 25.118986] Rebooting in 86400 seconds..