[....] Starting enhanced syslogd: rsyslogd[ 16.261697] audit: type=1400 audit(1520861458.433:5): avc: denied { syslog } for pid=4078 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 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. Debian GNU/Linux 7 syzkaller ttyS0 syzkaller login: [ 22.064861] audit: type=1400 audit(1520861464.236:6): avc: denied { map } for pid=4219 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.49' (ECDSA) to the list of known hosts. executing program [ 28.340921] audit: type=1400 audit(1520861470.512:7): avc: denied { map } for pid=4232 comm="syzkaller530200" path="/root/syzkaller530200798" 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 [ 28.368584] ================================================================== [ 28.375984] BUG: KASAN: use-after-free in ucma_close+0x2d7/0x2f0 [ 28.382099] Read of size 8 at addr ffff8801b0efcd80 by task syzkaller530200/4232 [ 28.389599] [ 28.391202] CPU: 0 PID: 4232 Comm: syzkaller530200 Not tainted 4.16.0-rc5+ #351 [ 28.398621] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 28.407954] Call Trace: [ 28.410518] dump_stack+0x194/0x24d [ 28.414120] ? arch_local_irq_restore+0x53/0x53 [ 28.418763] ? show_regs_print_info+0x18/0x18 [ 28.423234] ? ucma_close+0x2d7/0x2f0 [ 28.427006] print_address_description+0x73/0x250 [ 28.431819] ? ucma_close+0x2d7/0x2f0 [ 28.435595] kasan_report+0x23c/0x360 [ 28.439371] __asan_report_load8_noabort+0x14/0x20 [ 28.444271] ucma_close+0x2d7/0x2f0 [ 28.447869] ? __might_sleep+0x95/0x190 [ 28.451816] ? ucma_free_ctx+0xd90/0xd90 [ 28.455854] __fput+0x327/0x7e0 [ 28.459114] ? fput+0x140/0x140 [ 28.462365] ? _raw_spin_unlock_irq+0x27/0x70 [ 28.466836] ____fput+0x15/0x20 [ 28.470086] task_work_run+0x199/0x270 [ 28.473946] ? task_work_cancel+0x210/0x210 [ 28.478237] ? _raw_spin_unlock+0x22/0x30 [ 28.482361] ? switch_task_namespaces+0x87/0xc0 [ 28.487005] do_exit+0x9bb/0x1ad0 [ 28.490436] ? ucma_create_id+0x45b/0x620 [ 28.494569] ? mm_update_next_owner+0x930/0x930 [ 28.499208] ? ucma_create_id+0x17b/0x620 [ 28.503326] ? ucma_get_event+0xa90/0xa90 [ 28.507458] ? __might_sleep+0x95/0x190 [ 28.511412] ? kasan_check_write+0x14/0x20 [ 28.515620] ? _copy_from_user+0x99/0x110 [ 28.519743] ? ucma_write+0x11f/0x3d0 [ 28.523511] ? ucma_get_event+0xa90/0xa90 [ 28.527631] ? ucma_resolve_route+0x1a0/0x1a0 [ 28.532111] ? ucma_resolve_route+0x1a0/0x1a0 [ 28.536579] ? __vfs_write+0xf7/0x970 [ 28.540352] ? rcu_note_context_switch+0x710/0x710 [ 28.545271] ? kernel_read+0x120/0x120 [ 28.549135] ? __might_sleep+0x95/0x190 [ 28.553087] ? _cond_resched+0x14/0x30 [ 28.556946] ? __inode_security_revalidate+0xd9/0x130 [ 28.562108] ? avc_policy_seqno+0x9/0x20 [ 28.566145] ? security_file_permission+0x89/0x1e0 [ 28.571046] ? rw_verify_area+0xe5/0x2b0 [ 28.575075] ? __fdget_raw+0x20/0x20 [ 28.578763] ? vfs_write+0x224/0x510 [ 28.582453] do_group_exit+0x149/0x400 [ 28.586310] ? SyS_write+0x184/0x220 [ 28.589992] ? filp_open+0x70/0x70 [ 28.593506] ? SyS_exit+0x30/0x30 [ 28.596932] ? SyS_read+0x220/0x220 [ 28.600534] ? do_syscall_64+0xb7/0x940 [ 28.604479] ? do_group_exit+0x400/0x400 [ 28.608514] SyS_exit_group+0x1d/0x20 [ 28.612287] do_syscall_64+0x281/0x940 [ 28.616142] ? __do_page_fault+0xc90/0xc90 [ 28.620350] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 28.625077] ? syscall_return_slowpath+0x550/0x550 [ 28.629980] ? syscall_return_slowpath+0x2ac/0x550 [ 28.634879] ? prepare_exit_to_usermode+0x350/0x350 [ 28.639870] ? entry_SYSCALL_64_after_hwframe+0x52/0xb7 [ 28.645211] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 28.650035] entry_SYSCALL_64_after_hwframe+0x42/0xb7 [ 28.655195] RIP: 0033:0x43e988 [ 28.658359] RSP: 002b:00007ffde94d4c58 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 28.666041] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 000000000043e988 [ 28.673284] RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000 [ 28.680611] RBP: 00000000004be360 R08: 00000000000000e7 R09: ffffffffffffffd0 [ 28.687857] R10: 00000000004002c8 R11: 0000000000000246 R12: 0000000000000001 [ 28.695100] R13: 00000000006cc160 R14: 0000000000000000 R15: 0000000000000000 [ 28.702361] [ 28.703962] Allocated by task 4232: [ 28.707560] save_stack+0x43/0xd0 [ 28.710981] kasan_kmalloc+0xad/0xe0 [ 28.714665] kmem_cache_alloc_trace+0x136/0x740 [ 28.719389] ucma_alloc_ctx+0xce/0x610 [ 28.723245] ucma_create_id+0x205/0x620 [ 28.727186] ucma_write+0x2d6/0x3d0 [ 28.730785] __vfs_write+0xef/0x970 [ 28.734383] vfs_write+0x189/0x510 [ 28.737893] SyS_write+0xef/0x220 [ 28.741316] do_syscall_64+0x281/0x940 [ 28.745175] entry_SYSCALL_64_after_hwframe+0x42/0xb7 [ 28.750337] [ 28.751941] Freed by task 4232: [ 28.755190] save_stack+0x43/0xd0 [ 28.758610] __kasan_slab_free+0x11a/0x170 [ 28.762810] kasan_slab_free+0xe/0x10 [ 28.766580] kfree+0xd9/0x260 [ 28.769653] ucma_create_id+0x45b/0x620 [ 28.773597] ucma_write+0x2d6/0x3d0 [ 28.777192] __vfs_write+0xef/0x970 [ 28.780786] vfs_write+0x189/0x510 [ 28.784293] SyS_write+0xef/0x220 [ 28.787714] do_syscall_64+0x281/0x940 [ 28.791570] entry_SYSCALL_64_after_hwframe+0x42/0xb7 [ 28.796727] [ 28.798335] The buggy address belongs to the object at ffff8801b0efcd00 [ 28.798335] which belongs to the cache kmalloc-256 of size 256 [ 28.810959] The buggy address is located 128 bytes inside of [ 28.810959] 256-byte region [ffff8801b0efcd00, ffff8801b0efce00) [ 28.822800] The buggy address belongs to the page: [ 28.827697] page:ffffea0006c3bf00 count:1 mapcount:0 mapping:ffff8801b0efc080 index:0xffff8801b0efce40 [ 28.837110] flags: 0x2fffc0000000100(slab) [ 28.841316] raw: 02fffc0000000100 ffff8801b0efc080 ffff8801b0efce40 000000010000000b [ 28.849167] raw: ffffea00073a2fa0 ffffea0006c4b520 ffff8801dac007c0 0000000000000000 [ 28.857014] page dumped because: kasan: bad access detected [ 28.862691] [ 28.864285] Memory state around the buggy address: [ 28.869181] ffff8801b0efcc80: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 28.876511] ffff8801b0efcd00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 28.883840] >ffff8801b0efcd80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 28.891173] ^ [ 28.894511] ffff8801b0efce00: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb [ 28.901844] ffff8801b0efce80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 28.909184] ================================================================== [ 28.916524] Disabling lock debugging due to kernel taint [ 28.922088] Kernel panic - not syncing: panic_on_warn set ... [ 28.922088] [ 28.929434] CPU: 0 PID: 4232 Comm: syzkaller530200 Tainted: G B 4.16.0-rc5+ #351 [ 28.938152] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 28.947479] Call Trace: [ 28.950047] dump_stack+0x194/0x24d [ 28.953646] ? arch_local_irq_restore+0x53/0x53 [ 28.958287] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 28.963010] ? vsnprintf+0x1ed/0x1900 [ 28.966789] ? ucma_close+0x240/0x2f0 [ 28.970560] panic+0x1e4/0x41c [ 28.973720] ? refcount_error_report+0x214/0x214 [ 28.978450] ? add_taint+0x1c/0x50 [ 28.981958] ? add_taint+0x1c/0x50 [ 28.985469] ? ucma_close+0x2d7/0x2f0 [ 28.989238] kasan_end_report+0x50/0x50 [ 28.993187] kasan_report+0x149/0x360 [ 28.996963] __asan_report_load8_noabort+0x14/0x20 [ 29.001863] ucma_close+0x2d7/0x2f0 [ 29.005461] ? __might_sleep+0x95/0x190 [ 29.009404] ? ucma_free_ctx+0xd90/0xd90 [ 29.013862] __fput+0x327/0x7e0 [ 29.017116] ? fput+0x140/0x140 [ 29.020364] ? _raw_spin_unlock_irq+0x27/0x70 [ 29.024829] ____fput+0x15/0x20 [ 29.028079] task_work_run+0x199/0x270 [ 29.031936] ? task_work_cancel+0x210/0x210 [ 29.036226] ? _raw_spin_unlock+0x22/0x30 [ 29.040344] ? switch_task_namespaces+0x87/0xc0 [ 29.044984] do_exit+0x9bb/0x1ad0 [ 29.048405] ? ucma_create_id+0x45b/0x620 [ 29.052525] ? mm_update_next_owner+0x930/0x930 [ 29.057171] ? ucma_create_id+0x17b/0x620 [ 29.061285] ? ucma_get_event+0xa90/0xa90 [ 29.065403] ? __might_sleep+0x95/0x190 [ 29.069349] ? kasan_check_write+0x14/0x20 [ 29.073553] ? _copy_from_user+0x99/0x110 [ 29.077671] ? ucma_write+0x11f/0x3d0 [ 29.081440] ? ucma_get_event+0xa90/0xa90 [ 29.085556] ? ucma_resolve_route+0x1a0/0x1a0 [ 29.090108] ? ucma_resolve_route+0x1a0/0x1a0 [ 29.094570] ? __vfs_write+0xf7/0x970 [ 29.098338] ? rcu_note_context_switch+0x710/0x710 [ 29.103234] ? kernel_read+0x120/0x120 [ 29.107089] ? __might_sleep+0x95/0x190 [ 29.111033] ? _cond_resched+0x14/0x30 [ 29.114888] ? __inode_security_revalidate+0xd9/0x130 [ 29.120053] ? avc_policy_seqno+0x9/0x20 [ 29.124086] ? security_file_permission+0x89/0x1e0 [ 29.128983] ? rw_verify_area+0xe5/0x2b0 [ 29.133010] ? __fdget_raw+0x20/0x20 [ 29.136697] ? vfs_write+0x224/0x510 [ 29.140382] do_group_exit+0x149/0x400 [ 29.144241] ? SyS_write+0x184/0x220 [ 29.147926] ? filp_open+0x70/0x70 [ 29.151436] ? SyS_exit+0x30/0x30 [ 29.154856] ? SyS_read+0x220/0x220 [ 29.158455] ? do_syscall_64+0xb7/0x940 [ 29.162397] ? do_group_exit+0x400/0x400 [ 29.166433] SyS_exit_group+0x1d/0x20 [ 29.170199] do_syscall_64+0x281/0x940 [ 29.174055] ? __do_page_fault+0xc90/0xc90 [ 29.178259] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 29.182983] ? syscall_return_slowpath+0x550/0x550 [ 29.187883] ? syscall_return_slowpath+0x2ac/0x550 [ 29.192781] ? prepare_exit_to_usermode+0x350/0x350 [ 29.197769] ? entry_SYSCALL_64_after_hwframe+0x52/0xb7 [ 29.203103] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 29.207917] entry_SYSCALL_64_after_hwframe+0x42/0xb7 [ 29.213075] RIP: 0033:0x43e988 [ 29.216232] RSP: 002b:00007ffde94d4c58 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 29.223907] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 000000000043e988 [ 29.231147] RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000 [ 29.238387] RBP: 00000000004be360 R08: 00000000000000e7 R09: ffffffffffffffd0 [ 29.245625] R10: 00000000004002c8 R11: 0000000000000246 R12: 0000000000000001 [ 29.252864] R13: 00000000006cc160 R14: 0000000000000000 R15: 0000000000000000 [ 29.260503] Dumping ftrace buffer: [ 29.264015] (ftrace buffer empty) [ 29.267696] Kernel Offset: disabled [ 29.271297] Rebooting in 86400 seconds..