[....] Starting enhanced syslogd: rsyslogd[ 16.930503] audit: type=1400 audit(1521005800.953:5): avc: denied { syslog } for pid=4082 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: [ 22.718688] audit: type=1400 audit(1521005806.741: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.52' (ECDSA) to the list of known hosts. executing program [ 29.049982] audit: type=1400 audit(1521005813.072:7): avc: denied { map } for pid=4237 comm="syzkaller311744" path="/root/syzkaller311744162" 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.058297] ================================================================== [ 29.083360] BUG: KASAN: use-after-free in ucma_close+0x2d7/0x2f0 [ 29.089493] Read of size 8 at addr ffff8801b12b0340 by task syzkaller311744/4237 [ 29.096995] [ 29.098603] CPU: 0 PID: 4237 Comm: syzkaller311744 Not tainted 4.16.0-rc5+ #352 [ 29.106019] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 29.115362] Call Trace: [ 29.117938] dump_stack+0x194/0x24d [ 29.121544] ? arch_local_irq_restore+0x53/0x53 [ 29.126189] ? show_regs_print_info+0x18/0x18 [ 29.130672] ? ucma_close+0x2d7/0x2f0 [ 29.134448] print_address_description+0x73/0x250 [ 29.139264] ? ucma_close+0x2d7/0x2f0 [ 29.143038] kasan_report+0x23c/0x360 [ 29.146825] __asan_report_load8_noabort+0x14/0x20 [ 29.151724] ucma_close+0x2d7/0x2f0 [ 29.155323] ? __might_sleep+0x95/0x190 [ 29.159274] ? ucma_free_ctx+0xd90/0xd90 [ 29.163311] __fput+0x327/0x7e0 [ 29.166572] ? fput+0x140/0x140 [ 29.169828] ? _raw_spin_unlock_irq+0x27/0x70 [ 29.174301] ____fput+0x15/0x20 [ 29.177557] task_work_run+0x199/0x270 [ 29.181427] ? task_work_cancel+0x210/0x210 [ 29.185725] ? _raw_spin_unlock+0x22/0x30 [ 29.189861] ? switch_task_namespaces+0x87/0xc0 [ 29.194506] do_exit+0x9bb/0x1ad0 [ 29.197934] ? ucma_create_id+0x45b/0x620 [ 29.202059] ? mm_update_next_owner+0x930/0x930 [ 29.206703] ? ucma_create_id+0x17b/0x620 [ 29.210836] ? ucma_get_event+0xa90/0xa90 [ 29.214963] ? __might_sleep+0x95/0x190 [ 29.218918] ? kasan_check_write+0x14/0x20 [ 29.223125] ? _copy_from_user+0x99/0x110 [ 29.227252] ? ucma_write+0x11f/0x3d0 [ 29.231022] ? ucma_get_event+0xa90/0xa90 [ 29.235141] ? ucma_resolve_route+0x1a0/0x1a0 [ 29.239618] ? ucma_resolve_route+0x1a0/0x1a0 [ 29.244084] ? __vfs_write+0xf7/0x970 [ 29.247858] ? rcu_note_context_switch+0x710/0x710 [ 29.252772] ? kernel_read+0x120/0x120 [ 29.256645] ? __might_sleep+0x95/0x190 [ 29.260595] ? _cond_resched+0x14/0x30 [ 29.264456] ? __inode_security_revalidate+0xd9/0x130 [ 29.269620] ? avc_policy_seqno+0x9/0x20 [ 29.273664] ? security_file_permission+0x89/0x1e0 [ 29.278568] ? rw_verify_area+0xe5/0x2b0 [ 29.282599] ? __fdget_raw+0x20/0x20 [ 29.286287] ? vfs_write+0x224/0x510 [ 29.289981] do_group_exit+0x149/0x400 [ 29.293839] ? SyS_write+0x184/0x220 [ 29.297535] ? filp_open+0x70/0x70 [ 29.301064] ? SyS_exit+0x30/0x30 [ 29.304496] ? SyS_read+0x220/0x220 [ 29.308097] ? do_syscall_64+0xb7/0x940 [ 29.312043] ? do_group_exit+0x400/0x400 [ 29.316089] SyS_exit_group+0x1d/0x20 [ 29.319862] do_syscall_64+0x281/0x940 [ 29.323731] ? __do_page_fault+0xc90/0xc90 [ 29.327940] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 29.332683] ? syscall_return_slowpath+0x550/0x550 [ 29.337586] ? syscall_return_slowpath+0x2ac/0x550 [ 29.342500] ? prepare_exit_to_usermode+0x350/0x350 [ 29.347993] ? entry_SYSCALL_64_after_hwframe+0x52/0xb7 [ 29.353342] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 29.358166] entry_SYSCALL_64_after_hwframe+0x42/0xb7 [ 29.363328] RIP: 0033:0x43e988 [ 29.366491] RSP: 002b:00007ffc28ef32f8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 29.374171] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 000000000043e988 [ 29.381416] RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000 [ 29.388658] RBP: 00000000004be320 R08: 00000000000000e7 R09: ffffffffffffffd0 [ 29.395908] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 [ 29.403152] R13: 00000000006cc160 R14: 0000000000000000 R15: 0000000000000000 [ 29.410408] [ 29.412007] Allocated by task 4237: [ 29.415610] save_stack+0x43/0xd0 [ 29.419043] kasan_kmalloc+0xad/0xe0 [ 29.422737] kmem_cache_alloc_trace+0x136/0x740 [ 29.427375] ucma_alloc_ctx+0xce/0x610 [ 29.431231] ucma_create_id+0x205/0x620 [ 29.435176] ucma_write+0x2d6/0x3d0 [ 29.438773] __vfs_write+0xef/0x970 [ 29.442369] vfs_write+0x189/0x510 [ 29.445880] SyS_write+0xef/0x220 [ 29.449306] do_syscall_64+0x281/0x940 [ 29.453164] entry_SYSCALL_64_after_hwframe+0x42/0xb7 [ 29.458335] [ 29.459936] Freed by task 4237: [ 29.463185] save_stack+0x43/0xd0 [ 29.466608] __kasan_slab_free+0x11a/0x170 [ 29.470815] kasan_slab_free+0xe/0x10 [ 29.474596] kfree+0xd9/0x260 [ 29.477675] ucma_create_id+0x45b/0x620 [ 29.481621] ucma_write+0x2d6/0x3d0 [ 29.485216] __vfs_write+0xef/0x970 [ 29.488813] vfs_write+0x189/0x510 [ 29.492325] SyS_write+0xef/0x220 [ 29.495751] do_syscall_64+0x281/0x940 [ 29.499609] entry_SYSCALL_64_after_hwframe+0x42/0xb7 [ 29.504764] [ 29.506363] The buggy address belongs to the object at ffff8801b12b02c0 [ 29.506363] which belongs to the cache kmalloc-256 of size 256 [ 29.518988] The buggy address is located 128 bytes inside of [ 29.518988] 256-byte region [ffff8801b12b02c0, ffff8801b12b03c0) [ 29.530846] The buggy address belongs to the page: [ 29.535759] page:ffffea0006c4ac00 count:1 mapcount:0 mapping:ffff8801b12b0040 index:0x0 [ 29.543875] flags: 0x2fffc0000000100(slab) [ 29.548083] raw: 02fffc0000000100 ffff8801b12b0040 0000000000000000 000000010000000c [ 29.555942] raw: ffffea0006dfb0e0 ffffea0006c34d60 ffff8801dac007c0 0000000000000000 [ 29.563805] page dumped because: kasan: bad access detected [ 29.569488] [ 29.571090] Memory state around the buggy address: [ 29.575999] ffff8801b12b0200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 29.583331] ffff8801b12b0280: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb [ 29.590662] >ffff8801b12b0300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 29.598000] ^ [ 29.603420] ffff8801b12b0380: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 29.610759] ffff8801b12b0400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 29.618085] ================================================================== [ 29.625413] Disabling lock debugging due to kernel taint [ 29.631148] Kernel panic - not syncing: panic_on_warn set ... [ 29.631148] [ 29.638499] CPU: 0 PID: 4237 Comm: syzkaller311744 Tainted: G B 4.16.0-rc5+ #352 [ 29.647218] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 29.656543] Call Trace: [ 29.659103] dump_stack+0x194/0x24d [ 29.662704] ? arch_local_irq_restore+0x53/0x53 [ 29.667348] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 29.672072] ? vsnprintf+0x1ed/0x1900 [ 29.675843] ? ucma_close+0x1f0/0x2f0 [ 29.679616] panic+0x1e4/0x41c [ 29.682789] ? refcount_error_report+0x214/0x214 [ 29.687529] ? add_taint+0x1c/0x50 [ 29.691039] ? add_taint+0x1c/0x50 [ 29.694549] ? ucma_close+0x2d7/0x2f0 [ 29.698329] kasan_end_report+0x50/0x50 [ 29.702281] kasan_report+0x149/0x360 [ 29.706055] __asan_report_load8_noabort+0x14/0x20 [ 29.710954] ucma_close+0x2d7/0x2f0 [ 29.714550] ? __might_sleep+0x95/0x190 [ 29.718491] ? ucma_free_ctx+0xd90/0xd90 [ 29.722529] __fput+0x327/0x7e0 [ 29.725782] ? fput+0x140/0x140 [ 29.729033] ? _raw_spin_unlock_irq+0x27/0x70 [ 29.733499] ____fput+0x15/0x20 [ 29.736752] task_work_run+0x199/0x270 [ 29.740612] ? task_work_cancel+0x210/0x210 [ 29.744901] ? _raw_spin_unlock+0x22/0x30 [ 29.749023] ? switch_task_namespaces+0x87/0xc0 [ 29.753664] do_exit+0x9bb/0x1ad0 [ 29.757096] ? ucma_create_id+0x45b/0x620 [ 29.761214] ? mm_update_next_owner+0x930/0x930 [ 29.765854] ? ucma_create_id+0x17b/0x620 [ 29.769969] ? ucma_get_event+0xa90/0xa90 [ 29.774089] ? __might_sleep+0x95/0x190 [ 29.778053] ? kasan_check_write+0x14/0x20 [ 29.782262] ? _copy_from_user+0x99/0x110 [ 29.786382] ? ucma_write+0x11f/0x3d0 [ 29.790149] ? ucma_get_event+0xa90/0xa90 [ 29.794269] ? ucma_resolve_route+0x1a0/0x1a0 [ 29.798736] ? ucma_resolve_route+0x1a0/0x1a0 [ 29.803202] ? __vfs_write+0xf7/0x970 [ 29.806983] ? rcu_note_context_switch+0x710/0x710 [ 29.811884] ? kernel_read+0x120/0x120 [ 29.815743] ? __might_sleep+0x95/0x190 [ 29.819687] ? _cond_resched+0x14/0x30 [ 29.823557] ? __inode_security_revalidate+0xd9/0x130 [ 29.828716] ? avc_policy_seqno+0x9/0x20 [ 29.832749] ? security_file_permission+0x89/0x1e0 [ 29.837648] ? rw_verify_area+0xe5/0x2b0 [ 29.841677] ? __fdget_raw+0x20/0x20 [ 29.845368] ? vfs_write+0x224/0x510 [ 29.849053] do_group_exit+0x149/0x400 [ 29.852908] ? SyS_write+0x184/0x220 [ 29.856589] ? filp_open+0x70/0x70 [ 29.860098] ? SyS_exit+0x30/0x30 [ 29.863524] ? SyS_read+0x220/0x220 [ 29.867122] ? do_syscall_64+0xb7/0x940 [ 29.871076] ? do_group_exit+0x400/0x400 [ 29.875109] SyS_exit_group+0x1d/0x20 [ 29.878877] do_syscall_64+0x281/0x940 [ 29.882736] ? __do_page_fault+0xc90/0xc90 [ 29.886940] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 29.891667] ? syscall_return_slowpath+0x550/0x550 [ 29.896565] ? syscall_return_slowpath+0x2ac/0x550 [ 29.901465] ? prepare_exit_to_usermode+0x350/0x350 [ 29.906461] ? entry_SYSCALL_64_after_hwframe+0x52/0xb7 [ 29.911804] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 29.916618] entry_SYSCALL_64_after_hwframe+0x42/0xb7 [ 29.921780] RIP: 0033:0x43e988 [ 29.924937] RSP: 002b:00007ffc28ef32f8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 29.932612] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 000000000043e988 [ 29.939850] RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000 [ 29.947089] RBP: 00000000004be320 R08: 00000000000000e7 R09: ffffffffffffffd0 [ 29.954328] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 [ 29.961566] R13: 00000000006cc160 R14: 0000000000000000 R15: 0000000000000000 [ 29.969253] Dumping ftrace buffer: [ 29.972760] (ftrace buffer empty) [ 29.976440] Kernel Offset: disabled [ 29.980035] Rebooting in 86400 seconds..