[ 17.268962] audit: type=1400 audit(1521067860.874:5): avc: denied { syslog } for pid=4078 comm="rsyslogd" capability=34 scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:system_r:kernel_t:s0 tclass=capability2 permissive=1 [....] Starting enhanced syslogd: rsyslogd[?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: [ 23.266121] audit: type=1400 audit(1521067866.871:6): avc: denied { map } for pid=4226 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.21' (ECDSA) to the list of known hosts. executing program [ 29.651652] audit: type=1400 audit(1521067873.257:7): avc: denied { map } for pid=4240 comm="syzkaller412372" path="/root/syzkaller412372937" 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.660374] ================================================================== [ 29.684929] BUG: KASAN: use-after-free in ucma_close+0x2d7/0x2f0 [ 29.691045] Read of size 8 at addr ffff8801b08af240 by task syzkaller412372/4240 [ 29.698544] [ 29.700143] CPU: 0 PID: 4240 Comm: syzkaller412372 Not tainted 4.16.0-rc5+ #353 [ 29.707567] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 29.716888] Call Trace: [ 29.719447] dump_stack+0x194/0x24d [ 29.723047] ? arch_local_irq_restore+0x53/0x53 [ 29.727686] ? show_regs_print_info+0x18/0x18 [ 29.732160] ? ucma_close+0x2d7/0x2f0 [ 29.735937] print_address_description+0x73/0x250 [ 29.740752] ? ucma_close+0x2d7/0x2f0 [ 29.744523] kasan_report+0x23c/0x360 [ 29.748297] __asan_report_load8_noabort+0x14/0x20 [ 29.753198] ucma_close+0x2d7/0x2f0 [ 29.756798] ? __might_sleep+0x95/0x190 [ 29.760744] ? ucma_free_ctx+0xd90/0xd90 [ 29.764775] __fput+0x327/0x7e0 [ 29.768032] ? fput+0x140/0x140 [ 29.771287] ? _raw_spin_unlock_irq+0x27/0x70 [ 29.775760] ____fput+0x15/0x20 [ 29.779011] task_work_run+0x199/0x270 [ 29.782872] ? task_work_cancel+0x210/0x210 [ 29.787167] ? _raw_spin_unlock+0x22/0x30 [ 29.791302] ? switch_task_namespaces+0x87/0xc0 [ 29.795952] do_exit+0x9bb/0x1ad0 [ 29.799378] ? ucma_create_id+0x45b/0x620 [ 29.803499] ? mm_update_next_owner+0x930/0x930 [ 29.808143] ? ucma_create_id+0x17b/0x620 [ 29.812261] ? ucma_get_event+0xa90/0xa90 [ 29.816386] ? __might_sleep+0x95/0x190 [ 29.820335] ? kasan_check_write+0x14/0x20 [ 29.824541] ? _copy_from_user+0x99/0x110 [ 29.828663] ? ucma_write+0x11f/0x3d0 [ 29.832434] ? ucma_get_event+0xa90/0xa90 [ 29.836725] ? ucma_resolve_route+0x1a0/0x1a0 [ 29.841201] ? ucma_resolve_route+0x1a0/0x1a0 [ 29.845665] ? __vfs_write+0xf7/0x970 [ 29.849439] ? rcu_note_context_switch+0x710/0x710 [ 29.854351] ? kernel_read+0x120/0x120 [ 29.858210] ? __might_sleep+0x95/0x190 [ 29.862157] ? _cond_resched+0x14/0x30 [ 29.866031] ? __inode_security_revalidate+0xd9/0x130 [ 29.871206] ? avc_policy_seqno+0x9/0x20 [ 29.875249] ? security_file_permission+0x89/0x1e0 [ 29.880154] ? rw_verify_area+0xe5/0x2b0 [ 29.884183] ? __fdget_raw+0x20/0x20 [ 29.887870] ? vfs_write+0x224/0x510 [ 29.891559] do_group_exit+0x149/0x400 [ 29.895423] ? SyS_write+0x184/0x220 [ 29.899106] ? filp_open+0x70/0x70 [ 29.902622] ? SyS_exit+0x30/0x30 [ 29.906055] ? SyS_read+0x220/0x220 [ 29.909662] ? do_syscall_64+0xb7/0x940 [ 29.913608] ? do_group_exit+0x400/0x400 [ 29.917641] SyS_exit_group+0x1d/0x20 [ 29.921420] do_syscall_64+0x281/0x940 [ 29.925276] ? __do_page_fault+0xc90/0xc90 [ 29.929482] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 29.934210] ? syscall_return_slowpath+0x550/0x550 [ 29.939111] ? syscall_return_slowpath+0x2ac/0x550 [ 29.944014] ? prepare_exit_to_usermode+0x350/0x350 [ 29.949004] ? entry_SYSCALL_64_after_hwframe+0x52/0xb7 [ 29.954346] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 29.959168] entry_SYSCALL_64_after_hwframe+0x42/0xb7 [ 29.964328] RIP: 0033:0x43e948 [ 29.967489] RSP: 002b:00007ffeb14f01e8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 29.975165] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 000000000043e948 [ 29.982407] RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000 [ 29.989648] RBP: 00000000004be300 R08: 00000000000000e7 R09: ffffffffffffffd0 [ 29.996889] R10: 00000000004002c8 R11: 0000000000000246 R12: 0000000000000001 [ 30.004130] R13: 00000000006cc160 R14: 0000000000000000 R15: 0000000000000000 [ 30.011386] [ 30.012989] Allocated by task 4240: [ 30.016586] save_stack+0x43/0xd0 [ 30.020021] kasan_kmalloc+0xad/0xe0 [ 30.023710] kmem_cache_alloc_trace+0x136/0x740 [ 30.028347] ucma_alloc_ctx+0xce/0x610 [ 30.032204] ucma_create_id+0x205/0x620 [ 30.036145] ucma_write+0x2d6/0x3d0 [ 30.039743] __vfs_write+0xef/0x970 [ 30.043341] vfs_write+0x189/0x510 [ 30.046849] SyS_write+0xef/0x220 [ 30.050272] do_syscall_64+0x281/0x940 [ 30.054127] entry_SYSCALL_64_after_hwframe+0x42/0xb7 [ 30.059283] [ 30.060880] Freed by task 4240: [ 30.064128] save_stack+0x43/0xd0 [ 30.067548] __kasan_slab_free+0x11a/0x170 [ 30.071750] kasan_slab_free+0xe/0x10 [ 30.075523] kfree+0xd9/0x260 [ 30.078597] ucma_create_id+0x45b/0x620 [ 30.082539] ucma_write+0x2d6/0x3d0 [ 30.086133] __vfs_write+0xef/0x970 [ 30.089730] vfs_write+0x189/0x510 [ 30.093237] SyS_write+0xef/0x220 [ 30.096658] do_syscall_64+0x281/0x940 [ 30.100514] entry_SYSCALL_64_after_hwframe+0x42/0xb7 [ 30.105668] [ 30.107265] The buggy address belongs to the object at ffff8801b08af1c0 [ 30.107265] which belongs to the cache kmalloc-256 of size 256 [ 30.119889] The buggy address is located 128 bytes inside of [ 30.119889] 256-byte region [ffff8801b08af1c0, ffff8801b08af2c0) [ 30.131730] The buggy address belongs to the page: [ 30.136629] page:ffffea0006c22bc0 count:1 mapcount:0 mapping:ffff8801b08af080 index:0xffff8801b08afd00 [ 30.146044] flags: 0x2fffc0000000100(slab) [ 30.150249] raw: 02fffc0000000100 ffff8801b08af080 ffff8801b08afd00 000000010000000b [ 30.158103] raw: ffffea0006c228e0 ffffea0006c6cfe0 ffff8801dac007c0 0000000000000000 [ 30.165952] page dumped because: kasan: bad access detected [ 30.171627] [ 30.173222] Memory state around the buggy address: [ 30.178121] ffff8801b08af100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 30.185449] ffff8801b08af180: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb [ 30.192777] >ffff8801b08af200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 30.200103] ^ [ 30.205520] ffff8801b08af280: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 30.212849] ffff8801b08af300: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 30.220173] ================================================================== [ 30.227497] Disabling lock debugging due to kernel taint [ 30.233087] Kernel panic - not syncing: panic_on_warn set ... [ 30.233087] [ 30.240432] CPU: 0 PID: 4240 Comm: syzkaller412372 Tainted: G B 4.16.0-rc5+ #353 [ 30.249150] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 30.258470] Call Trace: [ 30.261029] dump_stack+0x194/0x24d [ 30.264628] ? arch_local_irq_restore+0x53/0x53 [ 30.269266] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 30.273994] ? vsnprintf+0x1ed/0x1900 [ 30.277768] ? ucma_close+0x210/0x2f0 [ 30.281539] panic+0x1e4/0x41c [ 30.284699] ? refcount_error_report+0x214/0x214 [ 30.289423] ? add_taint+0x1c/0x50 [ 30.292939] ? add_taint+0x1c/0x50 [ 30.296446] ? ucma_close+0x2d7/0x2f0 [ 30.300217] kasan_end_report+0x50/0x50 [ 30.304161] kasan_report+0x149/0x360 [ 30.307933] __asan_report_load8_noabort+0x14/0x20 [ 30.312827] ucma_close+0x2d7/0x2f0 [ 30.316421] ? __might_sleep+0x95/0x190 [ 30.320365] ? ucma_free_ctx+0xd90/0xd90 [ 30.324393] __fput+0x327/0x7e0 [ 30.327644] ? fput+0x140/0x140 [ 30.330896] ? _raw_spin_unlock_irq+0x27/0x70 [ 30.335370] ____fput+0x15/0x20 [ 30.338620] task_work_run+0x199/0x270 [ 30.342479] ? task_work_cancel+0x210/0x210 [ 30.346769] ? _raw_spin_unlock+0x22/0x30 [ 30.350894] ? switch_task_namespaces+0x87/0xc0 [ 30.355538] do_exit+0x9bb/0x1ad0 [ 30.358961] ? ucma_create_id+0x45b/0x620 [ 30.363079] ? mm_update_next_owner+0x930/0x930 [ 30.367714] ? ucma_create_id+0x17b/0x620 [ 30.371831] ? ucma_get_event+0xa90/0xa90 [ 30.375954] ? __might_sleep+0x95/0x190 [ 30.379897] ? kasan_check_write+0x14/0x20 [ 30.384106] ? _copy_from_user+0x99/0x110 [ 30.388221] ? ucma_write+0x11f/0x3d0 [ 30.391989] ? ucma_get_event+0xa90/0xa90 [ 30.396105] ? ucma_resolve_route+0x1a0/0x1a0 [ 30.400572] ? ucma_resolve_route+0x1a0/0x1a0 [ 30.405037] ? __vfs_write+0xf7/0x970 [ 30.408807] ? rcu_note_context_switch+0x710/0x710 [ 30.413704] ? kernel_read+0x120/0x120 [ 30.417560] ? __might_sleep+0x95/0x190 [ 30.421504] ? _cond_resched+0x14/0x30 [ 30.425362] ? __inode_security_revalidate+0xd9/0x130 [ 30.430521] ? avc_policy_seqno+0x9/0x20 [ 30.434558] ? security_file_permission+0x89/0x1e0 [ 30.439459] ? rw_verify_area+0xe5/0x2b0 [ 30.443487] ? __fdget_raw+0x20/0x20 [ 30.447169] ? vfs_write+0x224/0x510 [ 30.450853] do_group_exit+0x149/0x400 [ 30.454706] ? SyS_write+0x184/0x220 [ 30.458385] ? filp_open+0x70/0x70 [ 30.461893] ? SyS_exit+0x30/0x30 [ 30.465316] ? SyS_read+0x220/0x220 [ 30.468915] ? do_syscall_64+0xb7/0x940 [ 30.472859] ? do_group_exit+0x400/0x400 [ 30.476887] SyS_exit_group+0x1d/0x20 [ 30.480657] do_syscall_64+0x281/0x940 [ 30.484513] ? __do_page_fault+0xc90/0xc90 [ 30.488715] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 30.493438] ? syscall_return_slowpath+0x550/0x550 [ 30.498334] ? syscall_return_slowpath+0x2ac/0x550 [ 30.503232] ? prepare_exit_to_usermode+0x350/0x350 [ 30.508228] ? entry_SYSCALL_64_after_hwframe+0x52/0xb7 [ 30.513560] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 30.518373] entry_SYSCALL_64_after_hwframe+0x42/0xb7 [ 30.523527] RIP: 0033:0x43e948 [ 30.526684] RSP: 002b:00007ffeb14f01e8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 30.534366] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 000000000043e948 [ 30.541610] RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000 [ 30.548847] RBP: 00000000004be300 R08: 00000000000000e7 R09: ffffffffffffffd0 [ 30.556083] R10: 00000000004002c8 R11: 0000000000000246 R12: 0000000000000001 [ 30.563319] R13: 00000000006cc160 R14: 0000000000000000 R15: 0000000000000000 [ 30.570992] Dumping ftrace buffer: [ 30.574502] (ftrace buffer empty) [ 30.578179] Kernel Offset: disabled [ 30.581773] Rebooting in 86400 seconds..