[....] Starting enhanced syslogd: rsyslogd[ 17.126660] audit: type=1400 audit(1520489257.714:5): avc: denied { syslog } for pid=4083 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: [ 23.118555] audit: type=1400 audit(1520489263.706: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.40' (ECDSA) to the list of known hosts. executing program [ 29.448444] audit: type=1400 audit(1520489270.036:7): avc: denied { map } for pid=4237 comm="syzkaller345405" path="/root/syzkaller345405049" 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 [ 29.453250] ================================================================== [ 29.481750] BUG: KASAN: use-after-free in ucma_close+0x2d7/0x2f0 [ 29.487869] Read of size 8 at addr ffff8801add5f840 by task syzkaller345405/4237 [ 29.495376] [ 29.496980] CPU: 1 PID: 4237 Comm: syzkaller345405 Not tainted 4.16.0-rc4+ #345 [ 29.504398] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 29.513726] Call Trace: [ 29.516288] dump_stack+0x194/0x24d [ 29.519890] ? arch_local_irq_restore+0x53/0x53 [ 29.524535] ? show_regs_print_info+0x18/0x18 [ 29.529011] ? ucma_close+0x2d7/0x2f0 [ 29.532795] print_address_description+0x73/0x250 [ 29.537611] ? ucma_close+0x2d7/0x2f0 [ 29.541391] kasan_report+0x23c/0x360 [ 29.545172] __asan_report_load8_noabort+0x14/0x20 [ 29.550077] ucma_close+0x2d7/0x2f0 [ 29.553677] ? __might_sleep+0x95/0x190 [ 29.557629] ? ucma_free_ctx+0xd90/0xd90 [ 29.561663] __fput+0x327/0x7e0 [ 29.564918] ? fput+0x140/0x140 [ 29.568175] ? _raw_spin_unlock_irq+0x27/0x70 [ 29.572649] ____fput+0x15/0x20 [ 29.575909] task_work_run+0x199/0x270 [ 29.579792] ? task_work_cancel+0x210/0x210 [ 29.584102] ? _raw_spin_unlock+0x22/0x30 [ 29.588225] ? switch_task_namespaces+0x87/0xc0 [ 29.592872] do_exit+0x9bb/0x1ad0 [ 29.596300] ? ucma_create_id+0x45b/0x620 [ 29.600423] ? mm_update_next_owner+0x930/0x930 [ 29.605076] ? ucma_create_id+0x17b/0x620 [ 29.609197] ? ucma_get_event+0xa90/0xa90 [ 29.613326] ? __might_sleep+0x95/0x190 [ 29.617278] ? kasan_check_write+0x14/0x20 [ 29.621489] ? _copy_from_user+0x99/0x110 [ 29.625616] ? ucma_write+0x11f/0x3d0 [ 29.629386] ? ucma_get_event+0xa90/0xa90 [ 29.633514] ? ucma_resolve_route+0x1a0/0x1a0 [ 29.637992] ? ucma_resolve_route+0x1a0/0x1a0 [ 29.642470] ? __vfs_write+0xf7/0x970 [ 29.646248] ? rcu_note_context_switch+0x710/0x710 [ 29.651160] ? kernel_read+0x120/0x120 [ 29.655034] ? __might_sleep+0x95/0x190 [ 29.658987] ? _cond_resched+0x14/0x30 [ 29.662850] ? __inode_security_revalidate+0xd9/0x130 [ 29.668018] ? avc_policy_seqno+0x9/0x20 [ 29.672068] ? security_file_permission+0x89/0x1e0 [ 29.676973] ? rw_verify_area+0xe5/0x2b0 [ 29.681008] ? __fdget_raw+0x20/0x20 [ 29.684705] ? vfs_write+0x224/0x510 [ 29.688397] do_group_exit+0x149/0x400 [ 29.692257] ? SyS_write+0x184/0x220 [ 29.695939] ? filp_open+0x70/0x70 [ 29.699452] ? SyS_exit+0x30/0x30 [ 29.702875] ? SyS_read+0x220/0x220 [ 29.706477] ? do_syscall_64+0xb7/0x940 [ 29.710424] ? do_group_exit+0x400/0x400 [ 29.714458] SyS_exit_group+0x1d/0x20 [ 29.718233] do_syscall_64+0x281/0x940 [ 29.722091] ? __do_page_fault+0xc90/0xc90 [ 29.726300] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 29.731039] ? syscall_return_slowpath+0x550/0x550 [ 29.735944] ? syscall_return_slowpath+0x2ac/0x550 [ 29.740845] ? prepare_exit_to_usermode+0x350/0x350 [ 29.745836] ? entry_SYSCALL_64_after_hwframe+0x52/0xb7 [ 29.751176] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 29.755996] entry_SYSCALL_64_after_hwframe+0x42/0xb7 [ 29.761162] RIP: 0033:0x43e928 [ 29.764325] RSP: 002b:00007ffe92e25708 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 29.772011] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 000000000043e928 [ 29.779263] RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000 [ 29.786513] RBP: 00000000004be2c0 R08: 00000000000000e7 R09: ffffffffffffffd0 [ 29.793756] R10: 00000000004002c8 R11: 0000000000000246 R12: 0000000000000001 [ 29.800996] R13: 00000000006cc160 R14: 0000000000000000 R15: 0000000000000000 [ 29.808263] [ 29.809864] Allocated by task 4237: [ 29.813467] save_stack+0x43/0xd0 [ 29.816893] kasan_kmalloc+0xad/0xe0 [ 29.820580] kmem_cache_alloc_trace+0x136/0x740 [ 29.825399] ucma_alloc_ctx+0xce/0x610 [ 29.829259] ucma_create_id+0x205/0x620 [ 29.833209] ucma_write+0x2d6/0x3d0 [ 29.836809] __vfs_write+0xef/0x970 [ 29.840405] vfs_write+0x189/0x510 [ 29.843915] SyS_write+0xef/0x220 [ 29.847347] do_syscall_64+0x281/0x940 [ 29.851210] entry_SYSCALL_64_after_hwframe+0x42/0xb7 [ 29.856367] [ 29.857969] Freed by task 4237: [ 29.861222] save_stack+0x43/0xd0 [ 29.864648] __kasan_slab_free+0x11a/0x170 [ 29.868852] kasan_slab_free+0xe/0x10 [ 29.872624] kfree+0xd9/0x260 [ 29.875700] ucma_create_id+0x45b/0x620 [ 29.879647] ucma_write+0x2d6/0x3d0 [ 29.883247] __vfs_write+0xef/0x970 [ 29.886841] vfs_write+0x189/0x510 [ 29.890350] SyS_write+0xef/0x220 [ 29.893777] do_syscall_64+0x281/0x940 [ 29.897636] entry_SYSCALL_64_after_hwframe+0x42/0xb7 [ 29.902795] [ 29.904393] The buggy address belongs to the object at ffff8801add5f7c0 [ 29.904393] which belongs to the cache kmalloc-256 of size 256 [ 29.917034] The buggy address is located 128 bytes inside of [ 29.917034] 256-byte region [ffff8801add5f7c0, ffff8801add5f8c0) [ 29.929072] The buggy address belongs to the page: [ 29.934036] page:ffffea0006b757c0 count:1 mapcount:0 mapping:ffff8801add5f040 index:0xffff8801add5fb80 [ 29.943455] flags: 0x2fffc0000000100(slab) [ 29.947665] raw: 02fffc0000000100 ffff8801add5f040 ffff8801add5fb80 0000000100000005 [ 29.955521] raw: ffffea0006b792a0 ffffea0006b97a60 ffff8801dac007c0 0000000000000000 [ 29.963374] page dumped because: kasan: bad access detected [ 29.969058] [ 29.970675] Memory state around the buggy address: [ 29.975576] ffff8801add5f700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 29.982919] ffff8801add5f780: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb [ 29.990255] >ffff8801add5f800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 29.997585] ^ [ 30.003011] ffff8801add5f880: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 30.010349] ffff8801add5f900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 30.017677] ================================================================== [ 30.025010] Disabling lock debugging due to kernel taint [ 30.030588] Kernel panic - not syncing: panic_on_warn set ... [ 30.030588] [ 30.037935] CPU: 1 PID: 4237 Comm: syzkaller345405 Tainted: G B 4.16.0-rc4+ #345 [ 30.046652] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 30.055976] Call Trace: [ 30.058536] dump_stack+0x194/0x24d [ 30.062138] ? arch_local_irq_restore+0x53/0x53 [ 30.066779] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 30.071508] ? vsnprintf+0x1ed/0x1900 [ 30.075292] ? ucma_close+0x240/0x2f0 [ 30.079074] panic+0x1e4/0x41c [ 30.082240] ? refcount_error_report+0x214/0x214 [ 30.086968] ? add_taint+0x1c/0x50 [ 30.090490] ? add_taint+0x1c/0x50 [ 30.094025] ? ucma_close+0x2d7/0x2f0 [ 30.097813] kasan_end_report+0x50/0x50 [ 30.101766] kasan_report+0x149/0x360 [ 30.105537] __asan_report_load8_noabort+0x14/0x20 [ 30.110438] ucma_close+0x2d7/0x2f0 [ 30.114040] ? __might_sleep+0x95/0x190 [ 30.117992] ? ucma_free_ctx+0xd90/0xd90 [ 30.122119] __fput+0x327/0x7e0 [ 30.125375] ? fput+0x140/0x140 [ 30.128628] ? _raw_spin_unlock_irq+0x27/0x70 [ 30.133095] ____fput+0x15/0x20 [ 30.136345] task_work_run+0x199/0x270 [ 30.140203] ? task_work_cancel+0x210/0x210 [ 30.144514] ? _raw_spin_unlock+0x22/0x30 [ 30.148632] ? switch_task_namespaces+0x87/0xc0 [ 30.153275] do_exit+0x9bb/0x1ad0 [ 30.156700] ? ucma_create_id+0x45b/0x620 [ 30.160821] ? mm_update_next_owner+0x930/0x930 [ 30.165460] ? ucma_create_id+0x17b/0x620 [ 30.169581] ? ucma_get_event+0xa90/0xa90 [ 30.173704] ? __might_sleep+0x95/0x190 [ 30.177649] ? kasan_check_write+0x14/0x20 [ 30.181856] ? _copy_from_user+0x99/0x110 [ 30.185976] ? ucma_write+0x11f/0x3d0 [ 30.189744] ? ucma_get_event+0xa90/0xa90 [ 30.193865] ? ucma_resolve_route+0x1a0/0x1a0 [ 30.198338] ? ucma_resolve_route+0x1a0/0x1a0 [ 30.202802] ? __vfs_write+0xf7/0x970 [ 30.206574] ? rcu_note_context_switch+0x710/0x710 [ 30.211473] ? kernel_read+0x120/0x120 [ 30.215339] ? __might_sleep+0x95/0x190 [ 30.219287] ? _cond_resched+0x14/0x30 [ 30.223152] ? __inode_security_revalidate+0xd9/0x130 [ 30.228312] ? avc_policy_seqno+0x9/0x20 [ 30.232349] ? security_file_permission+0x89/0x1e0 [ 30.237254] ? rw_verify_area+0xe5/0x2b0 [ 30.241286] ? __fdget_raw+0x20/0x20 [ 30.244990] ? vfs_write+0x224/0x510 [ 30.248689] do_group_exit+0x149/0x400 [ 30.252548] ? SyS_write+0x184/0x220 [ 30.256230] ? filp_open+0x70/0x70 [ 30.259738] ? SyS_exit+0x30/0x30 [ 30.263160] ? SyS_read+0x220/0x220 [ 30.266762] ? do_syscall_64+0xb7/0x940 [ 30.270714] ? do_group_exit+0x400/0x400 [ 30.274744] SyS_exit_group+0x1d/0x20 [ 30.278518] do_syscall_64+0x281/0x940 [ 30.282377] ? __do_page_fault+0xc90/0xc90 [ 30.286592] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 30.291320] ? syscall_return_slowpath+0x550/0x550 [ 30.296220] ? syscall_return_slowpath+0x2ac/0x550 [ 30.301124] ? prepare_exit_to_usermode+0x350/0x350 [ 30.306119] ? entry_SYSCALL_64_after_hwframe+0x52/0xb7 [ 30.312855] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 30.317672] entry_SYSCALL_64_after_hwframe+0x42/0xb7 [ 30.322832] RIP: 0033:0x43e928 [ 30.325994] RSP: 002b:00007ffe92e25708 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 30.333688] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 000000000043e928 [ 30.340930] RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000 [ 30.348172] RBP: 00000000004be2c0 R08: 00000000000000e7 R09: ffffffffffffffd0 [ 30.355413] R10: 00000000004002c8 R11: 0000000000000246 R12: 0000000000000001 [ 30.362656] R13: 00000000006cc160 R14: 0000000000000000 R15: 0000000000000000 [ 30.370378] Dumping ftrace buffer: [ 30.373893] (ftrace buffer empty) [ 30.377577] Kernel Offset: disabled [ 30.381179] Rebooting in 86400 seconds..