[....] Starting enhanced syslogd: rsyslogd[ 17.443141] audit: type=1400 audit(1520883193.895:5): avc: denied { syslog } for pid=4097 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.007447] audit: type=1400 audit(1520883199.460:6): avc: denied { map } for pid=4237 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.0' (ECDSA) to the list of known hosts. executing program [ 29.381202] audit: type=1400 audit(1520883205.833:7): avc: denied { map } for pid=4251 comm="syzkaller595231" path="/root/syzkaller595231363" 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.386674] ================================================================== [ 29.414674] BUG: KASAN: use-after-free in ucma_close+0x2d7/0x2f0 [ 29.420795] Read of size 8 at addr ffff8801b321d8c0 by task syzkaller595231/4251 [ 29.428301] [ 29.429911] CPU: 1 PID: 4251 Comm: syzkaller595231 Not tainted 4.16.0-rc5+ #351 [ 29.437333] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 29.446663] Call Trace: [ 29.449232] dump_stack+0x194/0x24d [ 29.452849] ? arch_local_irq_restore+0x53/0x53 [ 29.457507] ? show_regs_print_info+0x18/0x18 [ 29.461986] ? ucma_close+0x2d7/0x2f0 [ 29.465764] print_address_description+0x73/0x250 [ 29.470584] ? ucma_close+0x2d7/0x2f0 [ 29.474368] kasan_report+0x23c/0x360 [ 29.478149] __asan_report_load8_noabort+0x14/0x20 [ 29.483058] ucma_close+0x2d7/0x2f0 [ 29.486668] ? __might_sleep+0x95/0x190 [ 29.490627] ? ucma_free_ctx+0xd90/0xd90 [ 29.494668] __fput+0x327/0x7e0 [ 29.497932] ? fput+0x140/0x140 [ 29.501200] ? _raw_spin_unlock_irq+0x27/0x70 [ 29.505682] ____fput+0x15/0x20 [ 29.508936] task_work_run+0x199/0x270 [ 29.512837] ? task_work_cancel+0x210/0x210 [ 29.517139] ? _raw_spin_unlock+0x22/0x30 [ 29.521281] ? switch_task_namespaces+0x87/0xc0 [ 29.525940] do_exit+0x9bb/0x1ad0 [ 29.529374] ? ucma_create_id+0x45b/0x620 [ 29.533504] ? mm_update_next_owner+0x930/0x930 [ 29.538153] ? ucma_create_id+0x17b/0x620 [ 29.542280] ? ucma_get_event+0xa90/0xa90 [ 29.546414] ? __might_sleep+0x95/0x190 [ 29.550369] ? kasan_check_write+0x14/0x20 [ 29.554591] ? _copy_from_user+0x99/0x110 [ 29.558717] ? ucma_write+0x11f/0x3d0 [ 29.562504] ? ucma_get_event+0xa90/0xa90 [ 29.566632] ? ucma_resolve_route+0x1a0/0x1a0 [ 29.571111] ? ucma_resolve_route+0x1a0/0x1a0 [ 29.575594] ? __vfs_write+0xf7/0x970 [ 29.579373] ? rcu_note_context_switch+0x710/0x710 [ 29.584286] ? kernel_read+0x120/0x120 [ 29.588153] ? __might_sleep+0x95/0x190 [ 29.592116] ? _cond_resched+0x14/0x30 [ 29.595998] ? __inode_security_revalidate+0xd9/0x130 [ 29.601171] ? avc_policy_seqno+0x9/0x20 [ 29.605226] ? security_file_permission+0x89/0x1e0 [ 29.610136] ? rw_verify_area+0xe5/0x2b0 [ 29.614185] ? __fdget_raw+0x20/0x20 [ 29.617878] ? vfs_write+0x224/0x510 [ 29.621579] do_group_exit+0x149/0x400 [ 29.625443] ? SyS_write+0x184/0x220 [ 29.629134] ? filp_open+0x70/0x70 [ 29.632650] ? SyS_exit+0x30/0x30 [ 29.636086] ? SyS_read+0x220/0x220 [ 29.639694] ? do_syscall_64+0xb7/0x940 [ 29.643644] ? do_group_exit+0x400/0x400 [ 29.647683] SyS_exit_group+0x1d/0x20 [ 29.651462] do_syscall_64+0x281/0x940 [ 29.655325] ? __do_page_fault+0xc90/0xc90 [ 29.659542] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 29.664275] ? syscall_return_slowpath+0x550/0x550 [ 29.669181] ? syscall_return_slowpath+0x2ac/0x550 [ 29.674090] ? prepare_exit_to_usermode+0x350/0x350 [ 29.679090] ? entry_SYSCALL_64_after_hwframe+0x52/0xb7 [ 29.684442] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 29.689275] entry_SYSCALL_64_after_hwframe+0x42/0xb7 [ 29.694442] RIP: 0033:0x43e918 [ 29.697606] RSP: 002b:00007fff64c73678 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 29.705290] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 000000000043e918 [ 29.712542] RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000 [ 29.719789] RBP: 00000000004be2c0 R08: 00000000000000e7 R09: ffffffffffffffd0 [ 29.727040] R10: 00000000004002c8 R11: 0000000000000246 R12: 0000000000000001 [ 29.734296] R13: 00000000006cc160 R14: 0000000000000000 R15: 0000000000000000 [ 29.741571] [ 29.743178] Allocated by task 4251: [ 29.746784] save_stack+0x43/0xd0 [ 29.750210] kasan_kmalloc+0xad/0xe0 [ 29.753897] kmem_cache_alloc_trace+0x136/0x740 [ 29.758541] ucma_alloc_ctx+0xce/0x610 [ 29.762404] ucma_create_id+0x205/0x620 [ 29.766353] ucma_write+0x2d6/0x3d0 [ 29.769958] __vfs_write+0xef/0x970 [ 29.773557] vfs_write+0x189/0x510 [ 29.777071] SyS_write+0xef/0x220 [ 29.780501] do_syscall_64+0x281/0x940 [ 29.784365] entry_SYSCALL_64_after_hwframe+0x42/0xb7 [ 29.789524] [ 29.791127] Freed by task 4251: [ 29.794385] save_stack+0x43/0xd0 [ 29.797810] __kasan_slab_free+0x11a/0x170 [ 29.802024] kasan_slab_free+0xe/0x10 [ 29.805802] kfree+0xd9/0x260 [ 29.808886] ucma_create_id+0x45b/0x620 [ 29.812833] ucma_write+0x2d6/0x3d0 [ 29.816436] __vfs_write+0xef/0x970 [ 29.820047] vfs_write+0x189/0x510 [ 29.823565] SyS_write+0xef/0x220 [ 29.827017] do_syscall_64+0x281/0x940 [ 29.830913] entry_SYSCALL_64_after_hwframe+0x42/0xb7 [ 29.836080] [ 29.837695] The buggy address belongs to the object at ffff8801b321d840 [ 29.837695] which belongs to the cache kmalloc-256 of size 256 [ 29.850328] The buggy address is located 128 bytes inside of [ 29.850328] 256-byte region [ffff8801b321d840, ffff8801b321d940) [ 29.862178] The buggy address belongs to the page: [ 29.867088] page:ffffea0006cc8740 count:1 mapcount:0 mapping:ffff8801b321d0c0 index:0x0 [ 29.875209] flags: 0x2fffc0000000100(slab) [ 29.879421] raw: 02fffc0000000100 ffff8801b321d0c0 0000000000000000 000000010000000c [ 29.887276] raw: ffffea0006cdc860 ffffea0006cc8c20 ffff8801dac007c0 0000000000000000 [ 29.895130] page dumped because: kasan: bad access detected [ 29.900812] [ 29.902413] Memory state around the buggy address: [ 29.907319] ffff8801b321d780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 29.914655] ffff8801b321d800: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb [ 29.921991] >ffff8801b321d880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 29.929328] ^ [ 29.934754] ffff8801b321d900: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 29.942094] ffff8801b321d980: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 29.949426] ================================================================== [ 29.956759] Disabling lock debugging due to kernel taint [ 29.962375] Kernel panic - not syncing: panic_on_warn set ... [ 29.962375] [ 29.969735] CPU: 1 PID: 4251 Comm: syzkaller595231 Tainted: G B 4.16.0-rc5+ #351 [ 29.978461] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 29.987789] Call Trace: [ 29.990354] dump_stack+0x194/0x24d [ 29.993957] ? arch_local_irq_restore+0x53/0x53 [ 29.998604] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 30.003335] ? vsnprintf+0x1ed/0x1900 [ 30.007116] ? ucma_close+0x240/0x2f0 [ 30.010894] panic+0x1e4/0x41c [ 30.014057] ? refcount_error_report+0x214/0x214 [ 30.018786] ? add_taint+0x1c/0x50 [ 30.022299] ? add_taint+0x1c/0x50 [ 30.025815] ? ucma_close+0x2d7/0x2f0 [ 30.029594] kasan_end_report+0x50/0x50 [ 30.033549] kasan_report+0x149/0x360 [ 30.037324] __asan_report_load8_noabort+0x14/0x20 [ 30.042227] ucma_close+0x2d7/0x2f0 [ 30.045829] ? __might_sleep+0x95/0x190 [ 30.049782] ? ucma_free_ctx+0xd90/0xd90 [ 30.053818] __fput+0x327/0x7e0 [ 30.057076] ? fput+0x140/0x140 [ 30.060332] ? _raw_spin_unlock_irq+0x27/0x70 [ 30.064804] ____fput+0x15/0x20 [ 30.068057] task_work_run+0x199/0x270 [ 30.071917] ? task_work_cancel+0x210/0x210 [ 30.076211] ? _raw_spin_unlock+0x22/0x30 [ 30.080334] ? switch_task_namespaces+0x87/0xc0 [ 30.084981] do_exit+0x9bb/0x1ad0 [ 30.088411] ? ucma_create_id+0x45b/0x620 [ 30.092537] ? mm_update_next_owner+0x930/0x930 [ 30.097181] ? ucma_create_id+0x17b/0x620 [ 30.101302] ? ucma_get_event+0xa90/0xa90 [ 30.105429] ? __might_sleep+0x95/0x190 [ 30.109398] ? kasan_check_write+0x14/0x20 [ 30.113618] ? _copy_from_user+0x99/0x110 [ 30.117744] ? ucma_write+0x11f/0x3d0 [ 30.121517] ? ucma_get_event+0xa90/0xa90 [ 30.125639] ? ucma_resolve_route+0x1a0/0x1a0 [ 30.130199] ? ucma_resolve_route+0x1a0/0x1a0 [ 30.134708] ? __vfs_write+0xf7/0x970 [ 30.138489] ? rcu_note_context_switch+0x710/0x710 [ 30.143396] ? kernel_read+0x120/0x120 [ 30.147259] ? __might_sleep+0x95/0x190 [ 30.151214] ? _cond_resched+0x14/0x30 [ 30.155075] ? __inode_security_revalidate+0xd9/0x130 [ 30.160239] ? avc_policy_seqno+0x9/0x20 [ 30.164280] ? security_file_permission+0x89/0x1e0 [ 30.169185] ? rw_verify_area+0xe5/0x2b0 [ 30.173221] ? __fdget_raw+0x20/0x20 [ 30.176913] ? vfs_write+0x224/0x510 [ 30.180604] do_group_exit+0x149/0x400 [ 30.184465] ? SyS_write+0x184/0x220 [ 30.188151] ? filp_open+0x70/0x70 [ 30.191670] ? SyS_exit+0x30/0x30 [ 30.195095] ? SyS_read+0x220/0x220 [ 30.198697] ? do_syscall_64+0xb7/0x940 [ 30.202647] ? do_group_exit+0x400/0x400 [ 30.206694] SyS_exit_group+0x1d/0x20 [ 30.210472] do_syscall_64+0x281/0x940 [ 30.214335] ? __do_page_fault+0xc90/0xc90 [ 30.218543] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 30.223273] ? syscall_return_slowpath+0x550/0x550 [ 30.228176] ? syscall_return_slowpath+0x2ac/0x550 [ 30.233082] ? prepare_exit_to_usermode+0x350/0x350 [ 30.238079] ? entry_SYSCALL_64_after_hwframe+0x52/0xb7 [ 30.243426] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 30.248247] entry_SYSCALL_64_after_hwframe+0x42/0xb7 [ 30.253409] RIP: 0033:0x43e918 [ 30.256571] RSP: 002b:00007fff64c73678 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 30.264252] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 000000000043e918 [ 30.271493] RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000 [ 30.278744] RBP: 00000000004be2c0 R08: 00000000000000e7 R09: ffffffffffffffd0 [ 30.285987] R10: 00000000004002c8 R11: 0000000000000246 R12: 0000000000000001 [ 30.293232] R13: 00000000006cc160 R14: 0000000000000000 R15: 0000000000000000 [ 30.300945] Dumping ftrace buffer: [ 30.304463] (ftrace buffer empty) [ 30.308145] Kernel Offset: disabled [ 30.311748] Rebooting in 86400 seconds..