[?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. [ 18.876196] audit: type=1400 audit(1520784435.671:6): avc: denied { map } for pid=4221 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.52' (ECDSA) to the list of known hosts. executing program syzkaller login: [ 25.224232] audit: type=1400 audit(1520784442.020:7): avc: denied { map } for pid=4235 comm="syzkaller885350" path="/root/syzkaller885350491" 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 [ 25.229586] ================================================================== [ 25.257576] BUG: KASAN: use-after-free in ucma_close+0x2d7/0x2f0 [ 25.263714] Read of size 8 at addr ffff8801b11c0740 by task syzkaller885350/4235 [ 25.271222] [ 25.272829] CPU: 0 PID: 4235 Comm: syzkaller885350 Not tainted 4.16.0-rc4+ #349 [ 25.280243] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 25.289572] Call Trace: [ 25.292141] dump_stack+0x194/0x24d [ 25.295748] ? arch_local_irq_restore+0x53/0x53 [ 25.300389] ? show_regs_print_info+0x18/0x18 [ 25.304862] ? ucma_close+0x2d7/0x2f0 [ 25.308635] print_address_description+0x73/0x250 [ 25.313536] ? ucma_close+0x2d7/0x2f0 [ 25.317310] kasan_report+0x23c/0x360 [ 25.321085] __asan_report_load8_noabort+0x14/0x20 [ 25.325985] ucma_close+0x2d7/0x2f0 [ 25.329587] ? __might_sleep+0x95/0x190 [ 25.333537] ? ucma_free_ctx+0xd90/0xd90 [ 25.337571] __fput+0x327/0x7e0 [ 25.340830] ? fput+0x140/0x140 [ 25.344083] ? _raw_spin_unlock_irq+0x27/0x70 [ 25.348555] ____fput+0x15/0x20 [ 25.351807] task_work_run+0x199/0x270 [ 25.355668] ? task_work_cancel+0x210/0x210 [ 25.359963] ? _raw_spin_unlock+0x22/0x30 [ 25.364085] ? switch_task_namespaces+0x87/0xc0 [ 25.368738] do_exit+0x9bb/0x1ad0 [ 25.372164] ? ucma_create_id+0x45b/0x620 [ 25.376292] ? mm_update_next_owner+0x930/0x930 [ 25.380940] ? ucma_create_id+0x17b/0x620 [ 25.385161] ? ucma_get_event+0xa90/0xa90 [ 25.389288] ? __might_sleep+0x95/0x190 [ 25.393248] ? kasan_check_write+0x14/0x20 [ 25.397454] ? _copy_from_user+0x99/0x110 [ 25.401577] ? ucma_write+0x11f/0x3d0 [ 25.405346] ? ucma_get_event+0xa90/0xa90 [ 25.409467] ? ucma_resolve_route+0x1a0/0x1a0 [ 25.413943] ? ucma_resolve_route+0x1a0/0x1a0 [ 25.418407] ? __vfs_write+0xf7/0x970 [ 25.422180] ? rcu_note_context_switch+0x710/0x710 [ 25.427081] ? kernel_read+0x120/0x120 [ 25.430939] ? __might_sleep+0x95/0x190 [ 25.434888] ? _cond_resched+0x14/0x30 [ 25.438749] ? __inode_security_revalidate+0xd9/0x130 [ 25.443909] ? avc_policy_seqno+0x9/0x20 [ 25.447949] ? security_file_permission+0x89/0x1e0 [ 25.452859] ? rw_verify_area+0xe5/0x2b0 [ 25.456891] ? __fdget_raw+0x20/0x20 [ 25.460576] ? vfs_write+0x224/0x510 [ 25.464264] do_group_exit+0x149/0x400 [ 25.468121] ? SyS_write+0x184/0x220 [ 25.471804] ? filp_open+0x70/0x70 [ 25.475314] ? SyS_exit+0x30/0x30 [ 25.478737] ? SyS_read+0x220/0x220 [ 25.482340] ? do_syscall_64+0xb7/0x940 [ 25.486285] ? do_group_exit+0x400/0x400 [ 25.490316] SyS_exit_group+0x1d/0x20 [ 25.494089] do_syscall_64+0x281/0x940 [ 25.497949] ? __do_page_fault+0xc90/0xc90 [ 25.502169] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 25.506896] ? syscall_return_slowpath+0x550/0x550 [ 25.511797] ? syscall_return_slowpath+0x2ac/0x550 [ 25.516700] ? prepare_exit_to_usermode+0x350/0x350 [ 25.521690] ? entry_SYSCALL_64_after_hwframe+0x52/0xb7 [ 25.527033] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 25.531854] entry_SYSCALL_64_after_hwframe+0x42/0xb7 [ 25.537019] RIP: 0033:0x43e918 [ 25.540183] RSP: 002b:00007fffd54381b8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 25.548058] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 000000000043e918 [ 25.555306] RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000 [ 25.562545] RBP: 00000000004be2c0 R08: 00000000000000e7 R09: ffffffffffffffd0 [ 25.569786] R10: 00000000004002c8 R11: 0000000000000246 R12: 0000000000000001 [ 25.577030] R13: 00000000006cc160 R14: 0000000000000000 R15: 0000000000000000 [ 25.584297] [ 25.585898] Allocated by task 4235: [ 25.589501] save_stack+0x43/0xd0 [ 25.592927] kasan_kmalloc+0xad/0xe0 [ 25.596614] kmem_cache_alloc_trace+0x136/0x740 [ 25.601280] ucma_alloc_ctx+0xce/0x610 [ 25.605139] ucma_create_id+0x205/0x620 [ 25.609086] ucma_write+0x2d6/0x3d0 [ 25.612684] __vfs_write+0xef/0x970 [ 25.616279] vfs_write+0x189/0x510 [ 25.619788] SyS_write+0xef/0x220 [ 25.623212] do_syscall_64+0x281/0x940 [ 25.627068] entry_SYSCALL_64_after_hwframe+0x42/0xb7 [ 25.632228] [ 25.633824] Freed by task 4235: [ 25.637073] save_stack+0x43/0xd0 [ 25.640494] __kasan_slab_free+0x11a/0x170 [ 25.644696] kasan_slab_free+0xe/0x10 [ 25.648470] kfree+0xd9/0x260 [ 25.651544] ucma_create_id+0x45b/0x620 [ 25.655489] ucma_write+0x2d6/0x3d0 [ 25.659085] __vfs_write+0xef/0x970 [ 25.662684] vfs_write+0x189/0x510 [ 25.666193] SyS_write+0xef/0x220 [ 25.669615] do_syscall_64+0x281/0x940 [ 25.673476] entry_SYSCALL_64_after_hwframe+0x42/0xb7 [ 25.678633] [ 25.680232] The buggy address belongs to the object at ffff8801b11c06c0 [ 25.680232] which belongs to the cache kmalloc-256 of size 256 [ 25.692855] The buggy address is located 128 bytes inside of [ 25.692855] 256-byte region [ffff8801b11c06c0, ffff8801b11c07c0) [ 25.704695] The buggy address belongs to the page: [ 25.709593] page:ffffea0006c47000 count:1 mapcount:0 mapping:ffff8801b11c0080 index:0xffff8801b11c0940 [ 25.719012] flags: 0x2fffc0000000100(slab) [ 25.723231] raw: 02fffc0000000100 ffff8801b11c0080 ffff8801b11c0940 0000000100000009 [ 25.731082] raw: ffffea0006bcc5e0 ffffea0006c563a0 ffff8801dac007c0 0000000000000000 [ 25.738928] page dumped because: kasan: bad access detected [ 25.744606] [ 25.746205] Memory state around the buggy address: [ 25.751105] ffff8801b11c0600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 25.758440] ffff8801b11c0680: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb [ 25.765771] >ffff8801b11c0700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 25.773101] ^ [ 25.778521] ffff8801b11c0780: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 25.785849] ffff8801b11c0800: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 25.793173] ================================================================== [ 25.800500] Disabling lock debugging due to kernel taint [ 25.806127] Kernel panic - not syncing: panic_on_warn set ... [ 25.806127] [ 25.813479] CPU: 0 PID: 4235 Comm: syzkaller885350 Tainted: G B 4.16.0-rc4+ #349 [ 25.822194] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 25.831603] Call Trace: [ 25.834166] dump_stack+0x194/0x24d [ 25.837766] ? arch_local_irq_restore+0x53/0x53 [ 25.842403] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 25.847127] ? vsnprintf+0x1ed/0x1900 [ 25.850899] ? ucma_close+0x280/0x2f0 [ 25.854671] panic+0x1e4/0x41c [ 25.857832] ? refcount_error_report+0x214/0x214 [ 25.862557] ? add_taint+0x1c/0x50 [ 25.866065] ? add_taint+0x1c/0x50 [ 25.869584] ? ucma_close+0x2d7/0x2f0 [ 25.873354] kasan_end_report+0x50/0x50 [ 25.877296] kasan_report+0x149/0x360 [ 25.881067] __asan_report_load8_noabort+0x14/0x20 [ 25.885967] ucma_close+0x2d7/0x2f0 [ 25.889567] ? __might_sleep+0x95/0x190 [ 25.893510] ? ucma_free_ctx+0xd90/0xd90 [ 25.897543] __fput+0x327/0x7e0 [ 25.900797] ? fput+0x140/0x140 [ 25.904049] ? _raw_spin_unlock_irq+0x27/0x70 [ 25.908520] ____fput+0x15/0x20 [ 25.911770] task_work_run+0x199/0x270 [ 25.915632] ? task_work_cancel+0x210/0x210 [ 25.919923] ? _raw_spin_unlock+0x22/0x30 [ 25.924043] ? switch_task_namespaces+0x87/0xc0 [ 25.928683] do_exit+0x9bb/0x1ad0 [ 25.932105] ? ucma_create_id+0x45b/0x620 [ 25.936226] ? mm_update_next_owner+0x930/0x930 [ 25.940862] ? ucma_create_id+0x17b/0x620 [ 25.944977] ? ucma_get_event+0xa90/0xa90 [ 25.949095] ? __might_sleep+0x95/0x190 [ 25.953051] ? kasan_check_write+0x14/0x20 [ 25.957256] ? _copy_from_user+0x99/0x110 [ 25.961383] ? ucma_write+0x11f/0x3d0 [ 25.965154] ? ucma_get_event+0xa90/0xa90 [ 25.969279] ? ucma_resolve_route+0x1a0/0x1a0 [ 25.973746] ? ucma_resolve_route+0x1a0/0x1a0 [ 25.978206] ? __vfs_write+0xf7/0x970 [ 25.981978] ? rcu_note_context_switch+0x710/0x710 [ 25.986876] ? kernel_read+0x120/0x120 [ 25.990732] ? __might_sleep+0x95/0x190 [ 25.994676] ? _cond_resched+0x14/0x30 [ 25.998535] ? __inode_security_revalidate+0xd9/0x130 [ 26.003692] ? avc_policy_seqno+0x9/0x20 [ 26.007726] ? security_file_permission+0x89/0x1e0 [ 26.012634] ? rw_verify_area+0xe5/0x2b0 [ 26.016664] ? __fdget_raw+0x20/0x20 [ 26.020348] ? vfs_write+0x224/0x510 [ 26.024036] do_group_exit+0x149/0x400 [ 26.027894] ? SyS_write+0x184/0x220 [ 26.031578] ? filp_open+0x70/0x70 [ 26.035085] ? SyS_exit+0x30/0x30 [ 26.038508] ? SyS_read+0x220/0x220 [ 26.042106] ? do_syscall_64+0xb7/0x940 [ 26.046062] ? do_group_exit+0x400/0x400 [ 26.050091] SyS_exit_group+0x1d/0x20 [ 26.053861] do_syscall_64+0x281/0x940 [ 26.057719] ? __do_page_fault+0xc90/0xc90 [ 26.061925] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 26.066747] ? syscall_return_slowpath+0x550/0x550 [ 26.071649] ? syscall_return_slowpath+0x2ac/0x550 [ 26.076548] ? prepare_exit_to_usermode+0x350/0x350 [ 26.081535] ? entry_SYSCALL_64_after_hwframe+0x52/0xb7 [ 26.086871] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 26.091687] entry_SYSCALL_64_after_hwframe+0x42/0xb7 [ 26.096844] RIP: 0033:0x43e918 [ 26.100003] RSP: 002b:00007fffd54381b8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 26.107685] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 000000000043e918 [ 26.114931] RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000 [ 26.122173] RBP: 00000000004be2c0 R08: 00000000000000e7 R09: ffffffffffffffd0 [ 26.129411] R10: 00000000004002c8 R11: 0000000000000246 R12: 0000000000000001 [ 26.136655] R13: 00000000006cc160 R14: 0000000000000000 R15: 0000000000000000 [ 26.144387] Dumping ftrace buffer: [ 26.147905] (ftrace buffer empty) [ 26.151590] Kernel Offset: disabled [ 26.155192] Rebooting in 86400 seconds..