[....] Starting enhanced syslogd: rsyslogd[ 16.884385] audit: type=1400 audit(1520712124.361:5): avc: denied { syslog } for pid=4103 comm="rsyslogd" capability=34 scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:system_r:kernel_t:s0 tclass=capability2 permissive=1 [?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: [ 23.207469] audit: type=1400 audit(1520712130.684:6): avc: denied { map } for pid=4242 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 Warning: Permanently added '10.128.0.34' (ECDSA) to the list of known hosts. executing program [ 32.251590] audit: type=1400 audit(1520712139.728:7): avc: denied { map } for pid=4258 comm="syzkaller171534" path="/root/syzkaller171534847" 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 [ 32.279218] ================================================================== [ 32.286647] BUG: KASAN: use-after-free in ucma_close+0x2d7/0x2f0 [ 32.292765] Read of size 8 at addr ffff8801afa78480 by task syzkaller171534/4258 [ 32.300279] [ 32.301881] CPU: 1 PID: 4258 Comm: syzkaller171534 Not tainted 4.16.0-rc4+ #348 [ 32.309297] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 32.318625] Call Trace: [ 32.321193] dump_stack+0x194/0x24d [ 32.324795] ? arch_local_irq_restore+0x53/0x53 [ 32.329438] ? show_regs_print_info+0x18/0x18 [ 32.333928] ? ucma_close+0x2d7/0x2f0 [ 32.337703] print_address_description+0x73/0x250 [ 32.342517] ? ucma_close+0x2d7/0x2f0 [ 32.346289] kasan_report+0x23c/0x360 [ 32.350066] __asan_report_load8_noabort+0x14/0x20 [ 32.354968] ucma_close+0x2d7/0x2f0 [ 32.358573] ? __might_sleep+0x95/0x190 [ 32.362533] ? ucma_free_ctx+0xd90/0xd90 [ 32.366578] __fput+0x327/0x7e0 [ 32.369836] ? fput+0x140/0x140 [ 32.373098] ? _raw_spin_unlock_irq+0x27/0x70 [ 32.377581] ____fput+0x15/0x20 [ 32.380836] task_work_run+0x199/0x270 [ 32.384706] ? task_work_cancel+0x210/0x210 [ 32.389000] ? _raw_spin_unlock+0x22/0x30 [ 32.393141] ? switch_task_namespaces+0x87/0xc0 [ 32.397971] do_exit+0x9bb/0x1ad0 [ 32.401397] ? ucma_create_id+0x45b/0x620 [ 32.405526] ? mm_update_next_owner+0x930/0x930 [ 32.410168] ? ucma_create_id+0x17b/0x620 [ 32.414292] ? ucma_get_event+0xa90/0xa90 [ 32.418422] ? __might_sleep+0x95/0x190 [ 32.422375] ? kasan_check_write+0x14/0x20 [ 32.426585] ? _copy_from_user+0x99/0x110 [ 32.430708] ? ucma_write+0x11f/0x3d0 [ 32.434494] ? ucma_get_event+0xa90/0xa90 [ 32.438630] ? ucma_resolve_route+0x1a0/0x1a0 [ 32.443123] ? ucma_resolve_route+0x1a0/0x1a0 [ 32.447595] ? __vfs_write+0xf7/0x970 [ 32.451373] ? rcu_note_context_switch+0x710/0x710 [ 32.456293] ? kernel_read+0x120/0x120 [ 32.460172] ? __might_sleep+0x95/0x190 [ 32.464132] ? _cond_resched+0x14/0x30 [ 32.467995] ? __inode_security_revalidate+0xd9/0x130 [ 32.473161] ? avc_policy_seqno+0x9/0x20 [ 32.477203] ? security_file_permission+0x89/0x1e0 [ 32.482488] ? rw_verify_area+0xe5/0x2b0 [ 32.486522] ? __fdget_raw+0x20/0x20 [ 32.490209] ? vfs_write+0x224/0x510 [ 32.493901] do_group_exit+0x149/0x400 [ 32.497759] ? SyS_write+0x184/0x220 [ 32.501441] ? filp_open+0x70/0x70 [ 32.505055] ? SyS_exit+0x30/0x30 [ 32.508488] ? SyS_read+0x220/0x220 [ 32.512091] ? do_syscall_64+0xb7/0x940 [ 32.516050] ? do_group_exit+0x400/0x400 [ 32.520086] SyS_exit_group+0x1d/0x20 [ 32.523860] do_syscall_64+0x281/0x940 [ 32.527720] ? __do_page_fault+0xc90/0xc90 [ 32.531927] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 32.536656] ? syscall_return_slowpath+0x550/0x550 [ 32.541559] ? syscall_return_slowpath+0x2ac/0x550 [ 32.546463] ? prepare_exit_to_usermode+0x350/0x350 [ 32.551459] ? entry_SYSCALL_64_after_hwframe+0x52/0xb7 [ 32.556801] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 32.561624] entry_SYSCALL_64_after_hwframe+0x42/0xb7 [ 32.566799] RIP: 0033:0x43e948 [ 32.569960] RSP: 002b:00007fff1128af38 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 32.577639] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 000000000043e948 [ 32.584881] RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000 [ 32.592122] RBP: 00000000004be300 R08: 00000000000000e7 R09: ffffffffffffffd0 [ 32.599365] R10: 00000000004002c8 R11: 0000000000000246 R12: 0000000000000001 [ 32.606609] R13: 00000000006cc160 R14: 0000000000000000 R15: 0000000000000000 [ 32.613867] [ 32.615469] Allocated by task 4258: [ 32.619074] save_stack+0x43/0xd0 [ 32.622499] kasan_kmalloc+0xad/0xe0 [ 32.626193] kmem_cache_alloc_trace+0x136/0x740 [ 32.630847] ucma_alloc_ctx+0xce/0x610 [ 32.634703] ucma_create_id+0x205/0x620 [ 32.638657] ucma_write+0x2d6/0x3d0 [ 32.642276] __vfs_write+0xef/0x970 [ 32.645891] vfs_write+0x189/0x510 [ 32.649406] SyS_write+0xef/0x220 [ 32.652848] do_syscall_64+0x281/0x940 [ 32.656709] entry_SYSCALL_64_after_hwframe+0x42/0xb7 [ 32.661865] [ 32.663464] Freed by task 4258: [ 32.666729] save_stack+0x43/0xd0 [ 32.670152] __kasan_slab_free+0x11a/0x170 [ 32.674356] kasan_slab_free+0xe/0x10 [ 32.678128] kfree+0xd9/0x260 [ 32.681207] ucma_create_id+0x45b/0x620 [ 32.685152] ucma_write+0x2d6/0x3d0 [ 32.688749] __vfs_write+0xef/0x970 [ 32.692347] vfs_write+0x189/0x510 [ 32.695856] SyS_write+0xef/0x220 [ 32.699281] do_syscall_64+0x281/0x940 [ 32.703140] entry_SYSCALL_64_after_hwframe+0x42/0xb7 [ 32.708296] [ 32.709899] The buggy address belongs to the object at ffff8801afa78400 [ 32.709899] which belongs to the cache kmalloc-256 of size 256 [ 32.722524] The buggy address is located 128 bytes inside of [ 32.722524] 256-byte region [ffff8801afa78400, ffff8801afa78500) [ 32.734395] The buggy address belongs to the page: [ 32.739306] page:ffffea0006be9e00 count:1 mapcount:0 mapping:ffff8801afa78040 index:0x0 [ 32.747425] flags: 0x2fffc0000000100(slab) [ 32.751635] raw: 02fffc0000000100 ffff8801afa78040 0000000000000000 000000010000000c [ 32.759487] raw: ffffea0006cc0520 ffffea0006bfa820 ffff8801dac007c0 0000000000000000 [ 32.767336] page dumped because: kasan: bad access detected [ 32.773018] [ 32.774622] Memory state around the buggy address: [ 32.779531] ffff8801afa78380: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 32.786870] ffff8801afa78400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 32.794202] >ffff8801afa78480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 32.801540] ^ [ 32.804885] ffff8801afa78500: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb [ 32.812217] ffff8801afa78580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 32.819553] ================================================================== [ 32.826884] Disabling lock debugging due to kernel taint [ 32.832535] Kernel panic - not syncing: panic_on_warn set ... [ 32.832535] [ 32.839885] CPU: 1 PID: 4258 Comm: syzkaller171534 Tainted: G B 4.16.0-rc4+ #348 [ 32.848610] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 32.857942] Call Trace: [ 32.860512] dump_stack+0x194/0x24d [ 32.864111] ? arch_local_irq_restore+0x53/0x53 [ 32.868752] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 32.873478] ? vsnprintf+0x1ed/0x1900 [ 32.877249] ? ucma_close+0x290/0x2f0 [ 32.881025] panic+0x1e4/0x41c [ 32.884188] ? refcount_error_report+0x214/0x214 [ 32.888918] ? add_taint+0x1c/0x50 [ 32.892430] ? add_taint+0x1c/0x50 [ 32.895940] ? ucma_close+0x2d7/0x2f0 [ 32.899718] kasan_end_report+0x50/0x50 [ 32.903660] kasan_report+0x149/0x360 [ 32.907433] __asan_report_load8_noabort+0x14/0x20 [ 32.912331] ucma_close+0x2d7/0x2f0 [ 32.915929] ? __might_sleep+0x95/0x190 [ 32.919871] ? ucma_free_ctx+0xd90/0xd90 [ 32.923906] __fput+0x327/0x7e0 [ 32.927159] ? fput+0x140/0x140 [ 32.930411] ? _raw_spin_unlock_irq+0x27/0x70 [ 32.934876] ____fput+0x15/0x20 [ 32.938127] task_work_run+0x199/0x270 [ 32.941985] ? task_work_cancel+0x210/0x210 [ 32.946287] ? _raw_spin_unlock+0x22/0x30 [ 32.950407] ? switch_task_namespaces+0x87/0xc0 [ 32.955048] do_exit+0x9bb/0x1ad0 [ 32.958472] ? ucma_create_id+0x45b/0x620 [ 32.962592] ? mm_update_next_owner+0x930/0x930 [ 32.967230] ? ucma_create_id+0x17b/0x620 [ 32.971346] ? ucma_get_event+0xa90/0xa90 [ 32.975487] ? __might_sleep+0x95/0x190 [ 32.979435] ? kasan_check_write+0x14/0x20 [ 32.983648] ? _copy_from_user+0x99/0x110 [ 32.987771] ? ucma_write+0x11f/0x3d0 [ 32.991542] ? ucma_get_event+0xa90/0xa90 [ 32.995662] ? ucma_resolve_route+0x1a0/0x1a0 [ 33.000130] ? ucma_resolve_route+0x1a0/0x1a0 [ 33.004593] ? __vfs_write+0xf7/0x970 [ 33.008367] ? rcu_note_context_switch+0x710/0x710 [ 33.013269] ? kernel_read+0x120/0x120 [ 33.017127] ? __might_sleep+0x95/0x190 [ 33.021073] ? _cond_resched+0x14/0x30 [ 33.024940] ? __inode_security_revalidate+0xd9/0x130 [ 33.030108] ? avc_policy_seqno+0x9/0x20 [ 33.034146] ? security_file_permission+0x89/0x1e0 [ 33.039053] ? rw_verify_area+0xe5/0x2b0 [ 33.043085] ? __fdget_raw+0x20/0x20 [ 33.046769] ? vfs_write+0x224/0x510 [ 33.050453] do_group_exit+0x149/0x400 [ 33.054312] ? SyS_write+0x184/0x220 [ 33.057992] ? filp_open+0x70/0x70 [ 33.061512] ? SyS_exit+0x30/0x30 [ 33.064933] ? SyS_read+0x220/0x220 [ 33.068542] ? do_syscall_64+0xb7/0x940 [ 33.072494] ? do_group_exit+0x400/0x400 [ 33.076526] SyS_exit_group+0x1d/0x20 [ 33.080298] do_syscall_64+0x281/0x940 [ 33.084156] ? __do_page_fault+0xc90/0xc90 [ 33.088361] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 33.093090] ? syscall_return_slowpath+0x550/0x550 [ 33.097988] ? syscall_return_slowpath+0x2ac/0x550 [ 33.102891] ? prepare_exit_to_usermode+0x350/0x350 [ 33.107890] ? entry_SYSCALL_64_after_hwframe+0x52/0xb7 [ 33.113224] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 33.118040] entry_SYSCALL_64_after_hwframe+0x42/0xb7 [ 33.123198] RIP: 0033:0x43e948 [ 33.126358] RSP: 002b:00007fff1128af38 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 33.134046] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 000000000043e948 [ 33.141284] RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000 [ 33.148523] RBP: 00000000004be300 R08: 00000000000000e7 R09: ffffffffffffffd0 [ 33.155761] R10: 00000000004002c8 R11: 0000000000000246 R12: 0000000000000001 [ 33.163000] R13: 00000000006cc160 R14: 0000000000000000 R15: 0000000000000000 [ 33.170732] Dumping ftrace buffer: [ 33.174257] (ftrace buffer empty) [ 33.177936] Kernel Offset: disabled [ 33.181532] Rebooting in 86400 seconds..