[....] Starting enhanced syslogd: rsyslogd[ 15.769229] audit: type=1400 audit(1521077306.044:5): avc: denied { syslog } for pid=4076 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: [ 19.030853] audit: type=1400 audit(1521077309.305:6): avc: denied { map } for pid=4216 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.10.17' (ECDSA) to the list of known hosts. executing program [ 36.778700] audit: type=1400 audit(1521077327.053:7): avc: denied { map } for pid=4233 comm="syzkaller942099" path="/root/syzkaller942099266" 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 [ 36.805861] ================================================================== [ 36.813266] BUG: KASAN: use-after-free in ucma_close+0x2d7/0x2f0 [ 36.819382] Read of size 8 at addr ffff8801d2f52c40 by task syzkaller942099/4233 [ 36.826884] [ 36.828487] CPU: 1 PID: 4233 Comm: syzkaller942099 Not tainted 4.16.0-rc5+ #353 [ 36.835903] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 36.845229] Call Trace: [ 36.847791] dump_stack+0x194/0x24d [ 36.851392] ? arch_local_irq_restore+0x53/0x53 [ 36.856035] ? show_regs_print_info+0x18/0x18 [ 36.860509] ? ucma_close+0x2d7/0x2f0 [ 36.864285] print_address_description+0x73/0x250 [ 36.869114] ? ucma_close+0x2d7/0x2f0 [ 36.872888] kasan_report+0x23c/0x360 [ 36.876665] __asan_report_load8_noabort+0x14/0x20 [ 36.881564] ucma_close+0x2d7/0x2f0 [ 36.885167] ? __might_sleep+0x95/0x190 [ 36.889112] ? ucma_free_ctx+0xd90/0xd90 [ 36.893145] __fput+0x327/0x7e0 [ 36.896401] ? fput+0x140/0x140 [ 36.899656] ? _raw_spin_unlock_irq+0x27/0x70 [ 36.904128] ____fput+0x15/0x20 [ 36.907380] task_work_run+0x199/0x270 [ 36.911246] ? task_work_cancel+0x210/0x210 [ 36.915628] ? _raw_spin_unlock+0x22/0x30 [ 36.919749] ? switch_task_namespaces+0x87/0xc0 [ 36.924397] do_exit+0x9bb/0x1ad0 [ 36.927828] ? ucma_create_id+0x45b/0x620 [ 36.931953] ? mm_update_next_owner+0x930/0x930 [ 36.936597] ? ucma_create_id+0x17b/0x620 [ 36.940716] ? ucma_get_event+0xa90/0xa90 [ 36.944842] ? __might_sleep+0x95/0x190 [ 36.948794] ? kasan_check_write+0x14/0x20 [ 36.953001] ? _copy_from_user+0x99/0x110 [ 36.957123] ? ucma_write+0x11f/0x3d0 [ 36.960892] ? ucma_get_event+0xa90/0xa90 [ 36.965019] ? ucma_resolve_route+0x1a0/0x1a0 [ 36.969493] ? ucma_resolve_route+0x1a0/0x1a0 [ 36.973960] ? __vfs_write+0xf7/0x970 [ 36.977734] ? rcu_note_context_switch+0x710/0x710 [ 36.982652] ? kernel_read+0x120/0x120 [ 36.986511] ? __might_sleep+0x95/0x190 [ 36.990461] ? _cond_resched+0x14/0x30 [ 36.994320] ? __inode_security_revalidate+0xd9/0x130 [ 36.999483] ? avc_policy_seqno+0x9/0x20 [ 37.003525] ? security_file_permission+0x89/0x1e0 [ 37.008439] ? rw_verify_area+0xe5/0x2b0 [ 37.012470] ? __fdget_raw+0x20/0x20 [ 37.016160] ? vfs_write+0x224/0x510 [ 37.019850] do_group_exit+0x149/0x400 [ 37.023707] ? SyS_write+0x184/0x220 [ 37.027391] ? filp_open+0x70/0x70 [ 37.030901] ? SyS_exit+0x30/0x30 [ 37.034326] ? SyS_read+0x220/0x220 [ 37.037926] ? do_syscall_64+0xb7/0x940 [ 37.041870] ? do_group_exit+0x400/0x400 [ 37.045915] SyS_exit_group+0x1d/0x20 [ 37.049690] do_syscall_64+0x281/0x940 [ 37.053546] ? __do_page_fault+0xc90/0xc90 [ 37.057764] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 37.062495] ? syscall_return_slowpath+0x550/0x550 [ 37.067492] ? syscall_return_slowpath+0x2ac/0x550 [ 37.072393] ? prepare_exit_to_usermode+0x350/0x350 [ 37.077384] ? entry_SYSCALL_64_after_hwframe+0x52/0xb7 [ 37.082722] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 37.087542] entry_SYSCALL_64_after_hwframe+0x42/0xb7 [ 37.092703] RIP: 0033:0x43e918 [ 37.095862] RSP: 002b:00007ffc3b4b31b8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 37.103543] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 000000000043e918 [ 37.110785] RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000 [ 37.118034] RBP: 00000000004be2c0 R08: 00000000000000e7 R09: ffffffffffffffd0 [ 37.125276] R10: 00000000004002c8 R11: 0000000000000246 R12: 0000000000000001 [ 37.132517] R13: 00000000006cc160 R14: 0000000000000000 R15: 0000000000000000 [ 37.139774] [ 37.141376] Allocated by task 4233: [ 37.144975] save_stack+0x43/0xd0 [ 37.148399] kasan_kmalloc+0xad/0xe0 [ 37.152083] kmem_cache_alloc_trace+0x136/0x740 [ 37.156723] ucma_alloc_ctx+0xce/0x610 [ 37.160587] ucma_create_id+0x205/0x620 [ 37.164532] ucma_write+0x2d6/0x3d0 [ 37.168150] __vfs_write+0xef/0x970 [ 37.171749] vfs_write+0x189/0x510 [ 37.175260] SyS_write+0xef/0x220 [ 37.178685] do_syscall_64+0x281/0x940 [ 37.182541] entry_SYSCALL_64_after_hwframe+0x42/0xb7 [ 37.187709] [ 37.189308] Freed by task 4233: [ 37.192558] save_stack+0x43/0xd0 [ 37.195981] __kasan_slab_free+0x11a/0x170 [ 37.200198] kasan_slab_free+0xe/0x10 [ 37.203967] kfree+0xd9/0x260 [ 37.207041] ucma_create_id+0x45b/0x620 [ 37.210982] ucma_write+0x2d6/0x3d0 [ 37.214579] __vfs_write+0xef/0x970 [ 37.218193] vfs_write+0x189/0x510 [ 37.221702] SyS_write+0xef/0x220 [ 37.225126] do_syscall_64+0x281/0x940 [ 37.228983] entry_SYSCALL_64_after_hwframe+0x42/0xb7 [ 37.234140] [ 37.235738] The buggy address belongs to the object at ffff8801d2f52bc0 [ 37.235738] which belongs to the cache kmalloc-256 of size 256 [ 37.248364] The buggy address is located 128 bytes inside of [ 37.248364] 256-byte region [ffff8801d2f52bc0, ffff8801d2f52cc0) [ 37.260292] The buggy address belongs to the page: [ 37.265192] page:ffffea00074bd480 count:1 mapcount:0 mapping:ffff8801d2f52080 index:0xffff8801d2f52d00 [ 37.274609] flags: 0x2fffc0000000100(slab) [ 37.278814] raw: 02fffc0000000100 ffff8801d2f52080 ffff8801d2f52d00 000000010000000b [ 37.286664] raw: ffffea0006c300a0 ffffea000737fee0 ffff8801dac007c0 0000000000000000 [ 37.294510] page dumped because: kasan: bad access detected [ 37.300185] [ 37.301780] Memory state around the buggy address: [ 37.306679] ffff8801d2f52b00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc [ 37.314021] ffff8801d2f52b80: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb [ 37.321348] >ffff8801d2f52c00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 37.328675] ^ [ 37.334097] ffff8801d2f52c80: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 37.341426] ffff8801d2f52d00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 37.348760] ================================================================== [ 37.356086] Disabling lock debugging due to kernel taint [ 37.361556] Kernel panic - not syncing: panic_on_warn set ... [ 37.361556] [ 37.368889] CPU: 1 PID: 4233 Comm: syzkaller942099 Tainted: G B 4.16.0-rc5+ #353 [ 37.377606] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 37.386930] Call Trace: [ 37.389493] dump_stack+0x194/0x24d [ 37.393089] ? arch_local_irq_restore+0x53/0x53 [ 37.397728] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 37.402456] ? vsnprintf+0x1ed/0x1900 [ 37.406237] ? ucma_close+0x210/0x2f0 [ 37.410009] panic+0x1e4/0x41c [ 37.413178] ? refcount_error_report+0x214/0x214 [ 37.417906] ? add_taint+0x1c/0x50 [ 37.421417] ? add_taint+0x1c/0x50 [ 37.424937] ? ucma_close+0x2d7/0x2f0 [ 37.428718] kasan_end_report+0x50/0x50 [ 37.432660] kasan_report+0x149/0x360 [ 37.436433] __asan_report_load8_noabort+0x14/0x20 [ 37.441332] ucma_close+0x2d7/0x2f0 [ 37.444931] ? __might_sleep+0x95/0x190 [ 37.448877] ? ucma_free_ctx+0xd90/0xd90 [ 37.452909] __fput+0x327/0x7e0 [ 37.456165] ? fput+0x140/0x140 [ 37.459416] ? _raw_spin_unlock_irq+0x27/0x70 [ 37.463882] ____fput+0x15/0x20 [ 37.467132] task_work_run+0x199/0x270 [ 37.470990] ? task_work_cancel+0x210/0x210 [ 37.475284] ? _raw_spin_unlock+0x22/0x30 [ 37.479402] ? switch_task_namespaces+0x87/0xc0 [ 37.484043] do_exit+0x9bb/0x1ad0 [ 37.487464] ? ucma_create_id+0x45b/0x620 [ 37.491582] ? mm_update_next_owner+0x930/0x930 [ 37.496222] ? ucma_create_id+0x17b/0x620 [ 37.500338] ? ucma_get_event+0xa90/0xa90 [ 37.504459] ? __might_sleep+0x95/0x190 [ 37.508404] ? kasan_check_write+0x14/0x20 [ 37.512619] ? _copy_from_user+0x99/0x110 [ 37.516735] ? ucma_write+0x11f/0x3d0 [ 37.520504] ? ucma_get_event+0xa90/0xa90 [ 37.524620] ? ucma_resolve_route+0x1a0/0x1a0 [ 37.529090] ? ucma_resolve_route+0x1a0/0x1a0 [ 37.533564] ? __vfs_write+0xf7/0x970 [ 37.537336] ? rcu_note_context_switch+0x710/0x710 [ 37.542236] ? kernel_read+0x120/0x120 [ 37.546092] ? __might_sleep+0x95/0x190 [ 37.550037] ? _cond_resched+0x14/0x30 [ 37.553897] ? __inode_security_revalidate+0xd9/0x130 [ 37.559056] ? avc_policy_seqno+0x9/0x20 [ 37.563090] ? security_file_permission+0x89/0x1e0 [ 37.567989] ? rw_verify_area+0xe5/0x2b0 [ 37.572016] ? __fdget_raw+0x20/0x20 [ 37.575709] ? vfs_write+0x224/0x510 [ 37.579398] do_group_exit+0x149/0x400 [ 37.583266] ? SyS_write+0x184/0x220 [ 37.586949] ? filp_open+0x70/0x70 [ 37.590463] ? SyS_exit+0x30/0x30 [ 37.593883] ? SyS_read+0x220/0x220 [ 37.597482] ? do_syscall_64+0xb7/0x940 [ 37.601424] ? do_group_exit+0x400/0x400 [ 37.605453] SyS_exit_group+0x1d/0x20 [ 37.609223] do_syscall_64+0x281/0x940 [ 37.613079] ? __do_page_fault+0xc90/0xc90 [ 37.617282] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 37.622008] ? syscall_return_slowpath+0x550/0x550 [ 37.626918] ? syscall_return_slowpath+0x2ac/0x550 [ 37.631819] ? prepare_exit_to_usermode+0x350/0x350 [ 37.636804] ? entry_SYSCALL_64_after_hwframe+0x52/0xb7 [ 37.642140] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 37.646971] entry_SYSCALL_64_after_hwframe+0x42/0xb7 [ 37.652127] RIP: 0033:0x43e918 [ 37.655290] RSP: 002b:00007ffc3b4b31b8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 37.662976] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 000000000043e918 [ 37.670217] RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000 [ 37.677457] RBP: 00000000004be2c0 R08: 00000000000000e7 R09: ffffffffffffffd0 [ 37.684698] R10: 00000000004002c8 R11: 0000000000000246 R12: 0000000000000001 [ 37.691936] R13: 00000000006cc160 R14: 0000000000000000 R15: 0000000000000000 [ 37.699573] Dumping ftrace buffer: [ 37.703080] (ftrace buffer empty) [ 37.706760] Kernel Offset: disabled [ 37.710357] Rebooting in 86400 seconds..