[....] Starting enhanced syslogd: rsyslogd[ 15.617676] audit: type=1400 audit(1520637385.062:5): avc: denied { syslog } for pid=4063 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: [ 18.551471] audit: type=1400 audit(1520637387.996:6): avc: denied { map } for pid=4201 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.17' (ECDSA) to the list of known hosts. executing program [ 24.852156] audit: type=1400 audit(1520637394.296:7): avc: denied { map } for pid=4215 comm="syzkaller646847" path="/root/syzkaller646847257" 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 [ 24.857743] ================================================================== [ 24.885528] BUG: KASAN: use-after-free in ucma_close+0x2d7/0x2f0 [ 24.891649] Read of size 8 at addr ffff8801b498d880 by task syzkaller646847/4215 [ 24.899155] [ 24.900757] CPU: 1 PID: 4215 Comm: syzkaller646847 Not tainted 4.16.0-rc4+ #347 [ 24.908186] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 24.917512] Call Trace: [ 24.920078] dump_stack+0x194/0x24d [ 24.923682] ? arch_local_irq_restore+0x53/0x53 [ 24.928324] ? show_regs_print_info+0x18/0x18 [ 24.932799] ? ucma_close+0x2d7/0x2f0 [ 24.936594] print_address_description+0x73/0x250 [ 24.941410] ? ucma_close+0x2d7/0x2f0 [ 24.945183] kasan_report+0x23c/0x360 [ 24.948962] __asan_report_load8_noabort+0x14/0x20 [ 24.953868] ucma_close+0x2d7/0x2f0 [ 24.957470] ? __might_sleep+0x95/0x190 [ 24.961418] ? ucma_free_ctx+0xd90/0xd90 [ 24.965455] __fput+0x327/0x7e0 [ 24.968714] ? fput+0x140/0x140 [ 24.971969] ? _raw_spin_unlock_irq+0x27/0x70 [ 24.976443] ____fput+0x15/0x20 [ 24.979701] task_work_run+0x199/0x270 [ 24.983567] ? task_work_cancel+0x210/0x210 [ 24.987865] ? _raw_spin_unlock+0x22/0x30 [ 24.991987] ? switch_task_namespaces+0x87/0xc0 [ 24.996646] do_exit+0x9bb/0x1ad0 [ 25.000081] ? ucma_create_id+0x45b/0x620 [ 25.004208] ? mm_update_next_owner+0x930/0x930 [ 25.008851] ? ucma_create_id+0x17b/0x620 [ 25.012975] ? ucma_get_event+0xa90/0xa90 [ 25.017104] ? __might_sleep+0x95/0x190 [ 25.021061] ? kasan_check_write+0x14/0x20 [ 25.025271] ? _copy_from_user+0x99/0x110 [ 25.029399] ? ucma_write+0x11f/0x3d0 [ 25.033173] ? ucma_get_event+0xa90/0xa90 [ 25.037294] ? ucma_resolve_route+0x1a0/0x1a0 [ 25.041772] ? ucma_resolve_route+0x1a0/0x1a0 [ 25.046239] ? __vfs_write+0xf7/0x970 [ 25.050014] ? rcu_note_context_switch+0x710/0x710 [ 25.054916] ? kernel_read+0x120/0x120 [ 25.058778] ? __might_sleep+0x95/0x190 [ 25.062729] ? _cond_resched+0x14/0x30 [ 25.066591] ? __inode_security_revalidate+0xd9/0x130 [ 25.071753] ? avc_policy_seqno+0x9/0x20 [ 25.075794] ? security_file_permission+0x89/0x1e0 [ 25.080698] ? rw_verify_area+0xe5/0x2b0 [ 25.084731] ? __fdget_raw+0x20/0x20 [ 25.088422] ? vfs_write+0x224/0x510 [ 25.092117] do_group_exit+0x149/0x400 [ 25.095978] ? SyS_write+0x184/0x220 [ 25.099666] ? filp_open+0x70/0x70 [ 25.103182] ? SyS_exit+0x30/0x30 [ 25.106607] ? SyS_read+0x220/0x220 [ 25.110214] ? do_syscall_64+0xb7/0x940 [ 25.114165] ? do_group_exit+0x400/0x400 [ 25.118202] SyS_exit_group+0x1d/0x20 [ 25.121979] do_syscall_64+0x281/0x940 [ 25.125845] ? __do_page_fault+0xc90/0xc90 [ 25.130054] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 25.134785] ? syscall_return_slowpath+0x550/0x550 [ 25.139693] ? syscall_return_slowpath+0x2ac/0x550 [ 25.144597] ? prepare_exit_to_usermode+0x350/0x350 [ 25.149592] ? entry_SYSCALL_64_after_hwframe+0x52/0xb7 [ 25.154934] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 25.159757] entry_SYSCALL_64_after_hwframe+0x42/0xb7 [ 25.164918] RIP: 0033:0x43e918 [ 25.168080] RSP: 002b:00007ffc07590aa8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 25.175763] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 000000000043e918 [ 25.183006] RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000 [ 25.190275] RBP: 00000000004be2c0 R08: 00000000000000e7 R09: ffffffffffffffd0 [ 25.197539] R10: 00000000004002c8 R11: 0000000000000246 R12: 0000000000000001 [ 25.204790] R13: 00000000006cc160 R14: 0000000000000000 R15: 0000000000000000 [ 25.212053] [ 25.213657] Allocated by task 4215: [ 25.217262] save_stack+0x43/0xd0 [ 25.220686] kasan_kmalloc+0xad/0xe0 [ 25.224374] kmem_cache_alloc_trace+0x136/0x740 [ 25.229019] ucma_alloc_ctx+0xce/0x610 [ 25.232880] ucma_create_id+0x205/0x620 [ 25.236826] ucma_write+0x2d6/0x3d0 [ 25.240424] __vfs_write+0xef/0x970 [ 25.244029] vfs_write+0x189/0x510 [ 25.247539] SyS_write+0xef/0x220 [ 25.250965] do_syscall_64+0x281/0x940 [ 25.254823] entry_SYSCALL_64_after_hwframe+0x42/0xb7 [ 25.259979] [ 25.261576] Freed by task 4215: [ 25.264825] save_stack+0x43/0xd0 [ 25.268249] __kasan_slab_free+0x11a/0x170 [ 25.272455] kasan_slab_free+0xe/0x10 [ 25.276226] kfree+0xd9/0x260 [ 25.279306] ucma_create_id+0x45b/0x620 [ 25.283251] ucma_write+0x2d6/0x3d0 [ 25.286848] __vfs_write+0xef/0x970 [ 25.290445] vfs_write+0x189/0x510 [ 25.293956] SyS_write+0xef/0x220 [ 25.297382] do_syscall_64+0x281/0x940 [ 25.301241] entry_SYSCALL_64_after_hwframe+0x42/0xb7 [ 25.306397] [ 25.307997] The buggy address belongs to the object at ffff8801b498d800 [ 25.307997] which belongs to the cache kmalloc-256 of size 256 [ 25.320629] The buggy address is located 128 bytes inside of [ 25.320629] 256-byte region [ffff8801b498d800, ffff8801b498d900) [ 25.332471] The buggy address belongs to the page: [ 25.337372] page:ffffea0006d26340 count:1 mapcount:0 mapping:ffff8801b498d080 index:0x0 [ 25.345484] flags: 0x2fffc0000000100(slab) [ 25.349690] raw: 02fffc0000000100 ffff8801b498d080 0000000000000000 000000010000000c [ 25.357541] raw: ffffea00072f1da0 ffffea0006cb0a20 ffff8801dac007c0 0000000000000000 [ 25.365388] page dumped because: kasan: bad access detected [ 25.371066] [ 25.372664] Memory state around the buggy address: [ 25.377562] ffff8801b498d780: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 25.384890] ffff8801b498d800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 25.392218] >ffff8801b498d880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 25.399544] ^ [ 25.402881] ffff8801b498d900: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb [ 25.410212] ffff8801b498d980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 25.417538] ================================================================== [ 25.424865] Disabling lock debugging due to kernel taint [ 25.430440] Kernel panic - not syncing: panic_on_warn set ... [ 25.430440] [ 25.437788] CPU: 1 PID: 4215 Comm: syzkaller646847 Tainted: G B 4.16.0-rc4+ #347 [ 25.446504] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 25.455827] Call Trace: [ 25.458390] dump_stack+0x194/0x24d [ 25.461989] ? arch_local_irq_restore+0x53/0x53 [ 25.466631] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 25.471357] ? vsnprintf+0x1ed/0x1900 [ 25.475133] ? ucma_close+0x230/0x2f0 [ 25.478910] panic+0x1e4/0x41c [ 25.482073] ? refcount_error_report+0x214/0x214 [ 25.486803] ? add_taint+0x1c/0x50 [ 25.490312] ? add_taint+0x1c/0x50 [ 25.493841] ? ucma_close+0x2d7/0x2f0 [ 25.497614] kasan_end_report+0x50/0x50 [ 25.501557] kasan_report+0x149/0x360 [ 25.505328] __asan_report_load8_noabort+0x14/0x20 [ 25.510226] ucma_close+0x2d7/0x2f0 [ 25.513824] ? __might_sleep+0x95/0x190 [ 25.517770] ? ucma_free_ctx+0xd90/0xd90 [ 25.521800] __fput+0x327/0x7e0 [ 25.525055] ? fput+0x140/0x140 [ 25.528313] ? _raw_spin_unlock_irq+0x27/0x70 [ 25.532780] ____fput+0x15/0x20 [ 25.536035] task_work_run+0x199/0x270 [ 25.539910] ? task_work_cancel+0x210/0x210 [ 25.544202] ? _raw_spin_unlock+0x22/0x30 [ 25.548319] ? switch_task_namespaces+0x87/0xc0 [ 25.552961] do_exit+0x9bb/0x1ad0 [ 25.556392] ? ucma_create_id+0x45b/0x620 [ 25.560519] ? mm_update_next_owner+0x930/0x930 [ 25.565159] ? ucma_create_id+0x17b/0x620 [ 25.569276] ? ucma_get_event+0xa90/0xa90 [ 25.573403] ? __might_sleep+0x95/0x190 [ 25.577351] ? kasan_check_write+0x14/0x20 [ 25.581556] ? _copy_from_user+0x99/0x110 [ 25.585675] ? ucma_write+0x11f/0x3d0 [ 25.589444] ? ucma_get_event+0xa90/0xa90 [ 25.593563] ? ucma_resolve_route+0x1a0/0x1a0 [ 25.598038] ? ucma_resolve_route+0x1a0/0x1a0 [ 25.602506] ? __vfs_write+0xf7/0x970 [ 25.606279] ? rcu_note_context_switch+0x710/0x710 [ 25.611178] ? kernel_read+0x120/0x120 [ 25.615039] ? __might_sleep+0x95/0x190 [ 25.618988] ? _cond_resched+0x14/0x30 [ 25.622848] ? __inode_security_revalidate+0xd9/0x130 [ 25.628008] ? avc_policy_seqno+0x9/0x20 [ 25.632056] ? security_file_permission+0x89/0x1e0 [ 25.636958] ? rw_verify_area+0xe5/0x2b0 [ 25.640988] ? __fdget_raw+0x20/0x20 [ 25.644676] ? vfs_write+0x224/0x510 [ 25.648366] do_group_exit+0x149/0x400 [ 25.652224] ? SyS_write+0x184/0x220 [ 25.655907] ? filp_open+0x70/0x70 [ 25.659416] ? SyS_exit+0x30/0x30 [ 25.662842] ? SyS_read+0x220/0x220 [ 25.666441] ? do_syscall_64+0xb7/0x940 [ 25.670385] ? do_group_exit+0x400/0x400 [ 25.674415] SyS_exit_group+0x1d/0x20 [ 25.678199] do_syscall_64+0x281/0x940 [ 25.682070] ? __do_page_fault+0xc90/0xc90 [ 25.686277] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 25.691010] ? syscall_return_slowpath+0x550/0x550 [ 25.695917] ? syscall_return_slowpath+0x2ac/0x550 [ 25.700818] ? prepare_exit_to_usermode+0x350/0x350 [ 25.705807] ? entry_SYSCALL_64_after_hwframe+0x52/0xb7 [ 25.711143] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 25.715973] entry_SYSCALL_64_after_hwframe+0x42/0xb7 [ 25.721133] RIP: 0033:0x43e918 [ 25.724293] RSP: 002b:00007ffc07590aa8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 25.731971] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 000000000043e918 [ 25.739210] RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000 [ 25.746448] RBP: 00000000004be2c0 R08: 00000000000000e7 R09: ffffffffffffffd0 [ 25.753698] R10: 00000000004002c8 R11: 0000000000000246 R12: 0000000000000001 [ 25.760937] R13: 00000000006cc160 R14: 0000000000000000 R15: 0000000000000000 [ 25.768615] Dumping ftrace buffer: [ 25.772129] (ftrace buffer empty) [ 25.775807] Kernel Offset: disabled [ 25.779405] Rebooting in 86400 seconds..