[....] Starting enhanced syslogd: rsyslogd[ 16.808730] audit: type=1400 audit(1520494830.192:5): avc: denied { syslog } for pid=4086 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: [ 19.969151] audit: type=1400 audit(1520494833.352:6): avc: denied { map } for pid=4223 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.13' (ECDSA) to the list of known hosts. executing program [ 26.322346] audit: type=1400 audit(1520494839.705:7): avc: denied { map } for pid=4237 comm="syzkaller674700" path="/root/syzkaller674700308" 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.327631] ================================================================== [ 26.355671] BUG: KASAN: use-after-free in ucma_close+0x2d7/0x2f0 [ 26.361790] Read of size 8 at addr ffff8801ae13af00 by task syzkaller674700/4237 [ 26.369305] [ 26.370915] CPU: 0 PID: 4237 Comm: syzkaller674700 Not tainted 4.16.0-rc4+ #345 [ 26.378328] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 26.387650] Call Trace: [ 26.390215] dump_stack+0x194/0x24d [ 26.393815] ? arch_local_irq_restore+0x53/0x53 [ 26.398458] ? show_regs_print_info+0x18/0x18 [ 26.402933] ? ucma_close+0x2d7/0x2f0 [ 26.406706] print_address_description+0x73/0x250 [ 26.411522] ? ucma_close+0x2d7/0x2f0 [ 26.415301] kasan_report+0x23c/0x360 [ 26.419084] __asan_report_load8_noabort+0x14/0x20 [ 26.424010] ucma_close+0x2d7/0x2f0 [ 26.427631] ? __might_sleep+0x95/0x190 [ 26.431599] ? ucma_free_ctx+0xd90/0xd90 [ 26.435656] __fput+0x327/0x7e0 [ 26.438939] ? fput+0x140/0x140 [ 26.442214] ? _raw_spin_unlock_irq+0x27/0x70 [ 26.446713] ____fput+0x15/0x20 [ 26.449978] task_work_run+0x199/0x270 [ 26.453842] ? task_work_cancel+0x210/0x210 [ 26.458136] ? _raw_spin_unlock+0x22/0x30 [ 26.462255] ? switch_task_namespaces+0x87/0xc0 [ 26.466902] do_exit+0x9bb/0x1ad0 [ 26.470327] ? ucma_create_id+0x45b/0x620 [ 26.474452] ? mm_update_next_owner+0x930/0x930 [ 26.479095] ? ucma_create_id+0x17b/0x620 [ 26.483214] ? ucma_get_event+0xa90/0xa90 [ 26.487339] ? __might_sleep+0x95/0x190 [ 26.491289] ? kasan_check_write+0x14/0x20 [ 26.495497] ? _copy_from_user+0x99/0x110 [ 26.499621] ? ucma_write+0x11f/0x3d0 [ 26.503390] ? ucma_get_event+0xa90/0xa90 [ 26.507514] ? ucma_resolve_route+0x1a0/0x1a0 [ 26.511989] ? ucma_resolve_route+0x1a0/0x1a0 [ 26.516459] ? __vfs_write+0xf7/0x970 [ 26.520231] ? rcu_note_context_switch+0x710/0x710 [ 26.525131] ? kernel_read+0x120/0x120 [ 26.528990] ? __might_sleep+0x95/0x190 [ 26.532939] ? _cond_resched+0x14/0x30 [ 26.536797] ? __inode_security_revalidate+0xd9/0x130 [ 26.541959] ? avc_policy_seqno+0x9/0x20 [ 26.545998] ? security_file_permission+0x89/0x1e0 [ 26.550904] ? rw_verify_area+0xe5/0x2b0 [ 26.554935] ? __fdget_raw+0x20/0x20 [ 26.558623] ? vfs_write+0x224/0x510 [ 26.562312] do_group_exit+0x149/0x400 [ 26.566175] ? SyS_write+0x184/0x220 [ 26.569858] ? filp_open+0x70/0x70 [ 26.573368] ? SyS_exit+0x30/0x30 [ 26.576794] ? SyS_read+0x220/0x220 [ 26.580394] ? do_syscall_64+0xb7/0x940 [ 26.584339] ? do_group_exit+0x400/0x400 [ 26.588372] SyS_exit_group+0x1d/0x20 [ 26.592145] do_syscall_64+0x281/0x940 [ 26.596008] ? __do_page_fault+0xc90/0xc90 [ 26.600220] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 26.604950] ? syscall_return_slowpath+0x550/0x550 [ 26.609850] ? syscall_return_slowpath+0x2ac/0x550 [ 26.614750] ? prepare_exit_to_usermode+0x350/0x350 [ 26.619740] ? entry_SYSCALL_64_after_hwframe+0x52/0xb7 [ 26.625086] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 26.629908] entry_SYSCALL_64_after_hwframe+0x42/0xb7 [ 26.635067] RIP: 0033:0x43e918 [ 26.638227] RSP: 002b:00007ffd3f8e3528 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 26.645907] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 000000000043e918 [ 26.653147] RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000 [ 26.660389] RBP: 00000000004be2c0 R08: 00000000000000e7 R09: ffffffffffffffd0 [ 26.667632] R10: 00000000004002c8 R11: 0000000000000246 R12: 0000000000000001 [ 26.674875] R13: 00000000006cc160 R14: 0000000000000000 R15: 0000000000000000 [ 26.682132] [ 26.683735] Allocated by task 4237: [ 26.687345] save_stack+0x43/0xd0 [ 26.690766] kasan_kmalloc+0xad/0xe0 [ 26.694450] kmem_cache_alloc_trace+0x136/0x740 [ 26.699096] ucma_alloc_ctx+0xce/0x610 [ 26.702958] ucma_create_id+0x205/0x620 [ 26.706907] ucma_write+0x2d6/0x3d0 [ 26.710511] __vfs_write+0xef/0x970 [ 26.714112] vfs_write+0x189/0x510 [ 26.717622] SyS_write+0xef/0x220 [ 26.721045] do_syscall_64+0x281/0x940 [ 26.724902] entry_SYSCALL_64_after_hwframe+0x42/0xb7 [ 26.730058] [ 26.731660] Freed by task 4237: [ 26.734909] save_stack+0x43/0xd0 [ 26.738333] __kasan_slab_free+0x11a/0x170 [ 26.742537] kasan_slab_free+0xe/0x10 [ 26.746309] kfree+0xd9/0x260 [ 26.749385] ucma_create_id+0x45b/0x620 [ 26.753329] ucma_write+0x2d6/0x3d0 [ 26.756924] __vfs_write+0xef/0x970 [ 26.760522] vfs_write+0x189/0x510 [ 26.764033] SyS_write+0xef/0x220 [ 26.767457] do_syscall_64+0x281/0x940 [ 26.771315] entry_SYSCALL_64_after_hwframe+0x42/0xb7 [ 26.776470] [ 26.778069] The buggy address belongs to the object at ffff8801ae13ae80 [ 26.778069] which belongs to the cache kmalloc-256 of size 256 [ 26.790696] The buggy address is located 128 bytes inside of [ 26.790696] 256-byte region [ffff8801ae13ae80, ffff8801ae13af80) [ 26.802537] The buggy address belongs to the page: [ 26.807439] page:ffffea0006b84e80 count:1 mapcount:0 mapping:ffff8801ae13a0c0 index:0x0 [ 26.815551] flags: 0x2fffc0000000100(slab) [ 26.819757] raw: 02fffc0000000100 ffff8801ae13a0c0 0000000000000000 000000010000000c [ 26.827608] raw: ffffea0006d06920 ffff8801dac01648 ffff8801dac007c0 0000000000000000 [ 26.835456] page dumped because: kasan: bad access detected [ 26.841133] [ 26.842731] Memory state around the buggy address: [ 26.847632] ffff8801ae13ae00: 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc fc [ 26.854964] ffff8801ae13ae80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 26.862296] >ffff8801ae13af00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 26.869626] ^ [ 26.872964] ffff8801ae13af80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 26.880292] ffff8801ae13b000: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 26.887620] ================================================================== [ 26.894947] Disabling lock debugging due to kernel taint [ 26.900567] Kernel panic - not syncing: panic_on_warn set ... [ 26.900567] [ 26.907914] CPU: 0 PID: 4237 Comm: syzkaller674700 Tainted: G B 4.16.0-rc4+ #345 [ 26.916630] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 26.925966] Call Trace: [ 26.928527] dump_stack+0x194/0x24d [ 26.932125] ? arch_local_irq_restore+0x53/0x53 [ 26.936763] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 26.941485] ? vsnprintf+0x1ed/0x1900 [ 26.945255] ? ucma_close+0x240/0x2f0 [ 26.949029] panic+0x1e4/0x41c [ 26.952191] ? refcount_error_report+0x214/0x214 [ 26.956915] ? add_taint+0x1c/0x50 [ 26.960422] ? add_taint+0x1c/0x50 [ 26.963935] ? ucma_close+0x2d7/0x2f0 [ 26.967707] kasan_end_report+0x50/0x50 [ 26.971655] kasan_report+0x149/0x360 [ 26.975426] __asan_report_load8_noabort+0x14/0x20 [ 26.980324] ucma_close+0x2d7/0x2f0 [ 26.983928] ? __might_sleep+0x95/0x190 [ 26.987872] ? ucma_free_ctx+0xd90/0xd90 [ 26.991901] __fput+0x327/0x7e0 [ 26.995154] ? fput+0x140/0x140 [ 26.998404] ? _raw_spin_unlock_irq+0x27/0x70 [ 27.002869] ____fput+0x15/0x20 [ 27.006119] task_work_run+0x199/0x270 [ 27.009977] ? task_work_cancel+0x210/0x210 [ 27.014266] ? _raw_spin_unlock+0x22/0x30 [ 27.018385] ? switch_task_namespaces+0x87/0xc0 [ 27.023029] do_exit+0x9bb/0x1ad0 [ 27.026450] ? ucma_create_id+0x45b/0x620 [ 27.030568] ? mm_update_next_owner+0x930/0x930 [ 27.035204] ? ucma_create_id+0x17b/0x620 [ 27.039320] ? ucma_get_event+0xa90/0xa90 [ 27.043440] ? __might_sleep+0x95/0x190 [ 27.047387] ? kasan_check_write+0x14/0x20 [ 27.051590] ? _copy_from_user+0x99/0x110 [ 27.055710] ? ucma_write+0x11f/0x3d0 [ 27.059479] ? ucma_get_event+0xa90/0xa90 [ 27.063596] ? ucma_resolve_route+0x1a0/0x1a0 [ 27.068064] ? ucma_resolve_route+0x1a0/0x1a0 [ 27.072529] ? __vfs_write+0xf7/0x970 [ 27.076300] ? rcu_note_context_switch+0x710/0x710 [ 27.081198] ? kernel_read+0x120/0x120 [ 27.085054] ? __might_sleep+0x95/0x190 [ 27.088997] ? _cond_resched+0x14/0x30 [ 27.092859] ? __inode_security_revalidate+0xd9/0x130 [ 27.098024] ? avc_policy_seqno+0x9/0x20 [ 27.102059] ? security_file_permission+0x89/0x1e0 [ 27.106958] ? rw_verify_area+0xe5/0x2b0 [ 27.110986] ? __fdget_raw+0x20/0x20 [ 27.114672] ? vfs_write+0x224/0x510 [ 27.118359] do_group_exit+0x149/0x400 [ 27.122214] ? SyS_write+0x184/0x220 [ 27.125893] ? filp_open+0x70/0x70 [ 27.129402] ? SyS_exit+0x30/0x30 [ 27.132829] ? SyS_read+0x220/0x220 [ 27.136428] ? do_syscall_64+0xb7/0x940 [ 27.140371] ? do_group_exit+0x400/0x400 [ 27.144401] SyS_exit_group+0x1d/0x20 [ 27.148169] do_syscall_64+0x281/0x940 [ 27.152030] ? __do_page_fault+0xc90/0xc90 [ 27.156727] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 27.161453] ? syscall_return_slowpath+0x550/0x550 [ 27.166350] ? syscall_return_slowpath+0x2ac/0x550 [ 27.171248] ? prepare_exit_to_usermode+0x350/0x350 [ 27.176234] ? entry_SYSCALL_64_after_hwframe+0x52/0xb7 [ 27.181568] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 27.186383] entry_SYSCALL_64_after_hwframe+0x42/0xb7 [ 27.191541] RIP: 0033:0x43e918 [ 27.194709] RSP: 002b:00007ffd3f8e3528 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 27.202384] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 000000000043e918 [ 27.209631] RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000 [ 27.216883] RBP: 00000000004be2c0 R08: 00000000000000e7 R09: ffffffffffffffd0 [ 27.224120] R10: 00000000004002c8 R11: 0000000000000246 R12: 0000000000000001 [ 27.231360] R13: 00000000006cc160 R14: 0000000000000000 R15: 0000000000000000 [ 27.239071] Dumping ftrace buffer: [ 27.242578] (ftrace buffer empty) [ 27.246256] Kernel Offset: disabled [ 27.249851] Rebooting in 86400 seconds..