[?25l[?1c7[ ok 8[?25h[?0c. [....] Starting periodic command scheduler: cron[?25l[?1c7[ ok 8[?25h[?0c. Starting mcstransd: [....] Starting OpenBSD Secure Shell server: sshd[?25l[?1c7[ ok 8[?25h[?0c. [....] Starting file context maintaining daemon: restorecond[?25l[?1c7[ ok 8[?25h[?0c. [ 18.369310] audit: type=1400 audit(1520906110.277:6): avc: denied { map } for pid=4236 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 Debian GNU/Linux 7 syzkaller ttyS0 Warning: Permanently added '10.128.0.11' (ECDSA) to the list of known hosts. executing program syzkaller login: [ 39.599328] audit: type=1400 audit(1520906131.507:7): avc: denied { map } for pid=4254 comm="syzkaller715455" path="/root/syzkaller715455261" 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 [ 39.626518] ================================================================== [ 39.633903] BUG: KASAN: use-after-free in ucma_close+0x2d7/0x2f0 [ 39.640021] Read of size 8 at addr ffff8801ad9f10c0 by task syzkaller715455/4254 [ 39.647524] [ 39.649127] CPU: 1 PID: 4254 Comm: syzkaller715455 Not tainted 4.16.0-rc5+ #352 [ 39.656543] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 39.665866] Call Trace: [ 39.668429] dump_stack+0x194/0x24d [ 39.672030] ? arch_local_irq_restore+0x53/0x53 [ 39.676673] ? show_regs_print_info+0x18/0x18 [ 39.681148] ? ucma_close+0x2d7/0x2f0 [ 39.684926] print_address_description+0x73/0x250 [ 39.689755] ? ucma_close+0x2d7/0x2f0 [ 39.693528] kasan_report+0x23c/0x360 [ 39.697308] __asan_report_load8_noabort+0x14/0x20 [ 39.702210] ucma_close+0x2d7/0x2f0 [ 39.705813] ? __might_sleep+0x95/0x190 [ 39.709761] ? ucma_free_ctx+0xd90/0xd90 [ 39.713794] __fput+0x327/0x7e0 [ 39.717051] ? fput+0x140/0x140 [ 39.720307] ? _raw_spin_unlock_irq+0x27/0x70 [ 39.724779] ____fput+0x15/0x20 [ 39.728033] task_work_run+0x199/0x270 [ 39.731894] ? task_work_cancel+0x210/0x210 [ 39.736192] ? _raw_spin_unlock+0x22/0x30 [ 39.740313] ? switch_task_namespaces+0x87/0xc0 [ 39.744960] do_exit+0x9bb/0x1ad0 [ 39.748386] ? ucma_create_id+0x45b/0x620 [ 39.752509] ? mm_update_next_owner+0x930/0x930 [ 39.757154] ? ucma_create_id+0x17b/0x620 [ 39.761278] ? ucma_get_event+0xa90/0xa90 [ 39.765407] ? __might_sleep+0x95/0x190 [ 39.769359] ? kasan_check_write+0x14/0x20 [ 39.773568] ? _copy_from_user+0x99/0x110 [ 39.777692] ? ucma_write+0x11f/0x3d0 [ 39.781463] ? ucma_get_event+0xa90/0xa90 [ 39.785582] ? ucma_resolve_route+0x1a0/0x1a0 [ 39.790057] ? ucma_resolve_route+0x1a0/0x1a0 [ 39.794524] ? __vfs_write+0xf7/0x970 [ 39.798300] ? rcu_note_context_switch+0x710/0x710 [ 39.803205] ? kernel_read+0x120/0x120 [ 39.807066] ? __might_sleep+0x95/0x190 [ 39.811017] ? _cond_resched+0x14/0x30 [ 39.814878] ? __inode_security_revalidate+0xd9/0x130 [ 39.820053] ? avc_policy_seqno+0x9/0x20 [ 39.824101] ? security_file_permission+0x89/0x1e0 [ 39.829004] ? rw_verify_area+0xe5/0x2b0 [ 39.833035] ? __fdget_raw+0x20/0x20 [ 39.836724] ? vfs_write+0x224/0x510 [ 39.840415] do_group_exit+0x149/0x400 [ 39.844275] ? SyS_write+0x184/0x220 [ 39.847957] ? filp_open+0x70/0x70 [ 39.851467] ? SyS_exit+0x30/0x30 [ 39.854893] ? SyS_read+0x220/0x220 [ 39.858497] ? do_syscall_64+0xb7/0x940 [ 39.862445] ? do_group_exit+0x400/0x400 [ 39.866478] SyS_exit_group+0x1d/0x20 [ 39.870261] do_syscall_64+0x281/0x940 [ 39.874118] ? __do_page_fault+0xc90/0xc90 [ 39.878326] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 39.883054] ? syscall_return_slowpath+0x550/0x550 [ 39.887966] ? syscall_return_slowpath+0x2ac/0x550 [ 39.892869] ? prepare_exit_to_usermode+0x350/0x350 [ 39.897858] ? entry_SYSCALL_64_after_hwframe+0x52/0xb7 [ 39.903197] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 39.908020] entry_SYSCALL_64_after_hwframe+0x42/0xb7 [ 39.913201] RIP: 0033:0x43e948 [ 39.916362] RSP: 002b:00007ffd30e7a858 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 39.924041] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 000000000043e948 [ 39.931283] RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000 [ 39.938524] RBP: 00000000004be300 R08: 00000000000000e7 R09: ffffffffffffffd0 [ 39.945764] R10: 00000000004002c8 R11: 0000000000000246 R12: 0000000000000001 [ 39.953004] R13: 00000000006cc160 R14: 0000000000000000 R15: 0000000000000000 [ 39.960259] [ 39.961859] Allocated by task 4254: [ 39.965456] save_stack+0x43/0xd0 [ 39.968879] kasan_kmalloc+0xad/0xe0 [ 39.972565] kmem_cache_alloc_trace+0x136/0x740 [ 39.977205] ucma_alloc_ctx+0xce/0x610 [ 39.981060] ucma_create_id+0x205/0x620 [ 39.985003] ucma_write+0x2d6/0x3d0 [ 39.988601] __vfs_write+0xef/0x970 [ 39.992198] vfs_write+0x189/0x510 [ 39.995705] SyS_write+0xef/0x220 [ 39.999129] do_syscall_64+0x281/0x940 [ 40.002990] entry_SYSCALL_64_after_hwframe+0x42/0xb7 [ 40.008146] [ 40.009742] Freed by task 4254: [ 40.012994] save_stack+0x43/0xd0 [ 40.016418] __kasan_slab_free+0x11a/0x170 [ 40.020621] kasan_slab_free+0xe/0x10 [ 40.024392] kfree+0xd9/0x260 [ 40.027467] ucma_create_id+0x45b/0x620 [ 40.031411] ucma_write+0x2d6/0x3d0 [ 40.035010] __vfs_write+0xef/0x970 [ 40.038606] vfs_write+0x189/0x510 [ 40.042117] SyS_write+0xef/0x220 [ 40.045542] do_syscall_64+0x281/0x940 [ 40.049400] entry_SYSCALL_64_after_hwframe+0x42/0xb7 [ 40.054556] [ 40.056157] The buggy address belongs to the object at ffff8801ad9f1040 [ 40.056157] which belongs to the cache kmalloc-256 of size 256 [ 40.068781] The buggy address is located 128 bytes inside of [ 40.068781] 256-byte region [ffff8801ad9f1040, ffff8801ad9f1140) [ 40.080622] The buggy address belongs to the page: [ 40.085521] page:ffffea0006b67c40 count:1 mapcount:0 mapping:ffff8801ad9f1040 index:0x0 [ 40.093721] flags: 0x2fffc0000000100(slab) [ 40.097927] raw: 02fffc0000000100 ffff8801ad9f1040 0000000000000000 000000010000000c [ 40.105780] raw: ffffea0007190ca0 ffffea0006d111a0 ffff8801dac007c0 0000000000000000 [ 40.113637] page dumped because: kasan: bad access detected [ 40.119316] [ 40.120911] Memory state around the buggy address: [ 40.125809] ffff8801ad9f0f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 40.133139] ffff8801ad9f1000: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb [ 40.140468] >ffff8801ad9f1080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 40.147795] ^ [ 40.153212] ffff8801ad9f1100: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 40.160540] ffff8801ad9f1180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 40.167866] ================================================================== [ 40.175191] Disabling lock debugging due to kernel taint [ 40.180684] Kernel panic - not syncing: panic_on_warn set ... [ 40.180684] [ 40.188021] CPU: 1 PID: 4254 Comm: syzkaller715455 Tainted: G B 4.16.0-rc5+ #352 [ 40.196747] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 40.206071] Call Trace: [ 40.208632] dump_stack+0x194/0x24d [ 40.212229] ? arch_local_irq_restore+0x53/0x53 [ 40.216870] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 40.221594] ? vsnprintf+0x1ed/0x1900 [ 40.225364] ? ucma_close+0x1f0/0x2f0 [ 40.229137] panic+0x1e4/0x41c [ 40.232300] ? refcount_error_report+0x214/0x214 [ 40.237027] ? add_taint+0x1c/0x50 [ 40.240536] ? add_taint+0x1c/0x50 [ 40.244045] ? ucma_close+0x2d7/0x2f0 [ 40.247814] kasan_end_report+0x50/0x50 [ 40.251764] kasan_report+0x149/0x360 [ 40.255536] __asan_report_load8_noabort+0x14/0x20 [ 40.260433] ucma_close+0x2d7/0x2f0 [ 40.264031] ? __might_sleep+0x95/0x190 [ 40.267975] ? ucma_free_ctx+0xd90/0xd90 [ 40.272006] __fput+0x327/0x7e0 [ 40.275260] ? fput+0x140/0x140 [ 40.278508] ? _raw_spin_unlock_irq+0x27/0x70 [ 40.282976] ____fput+0x15/0x20 [ 40.286224] task_work_run+0x199/0x270 [ 40.290083] ? task_work_cancel+0x210/0x210 [ 40.294378] ? _raw_spin_unlock+0x22/0x30 [ 40.298498] ? switch_task_namespaces+0x87/0xc0 [ 40.303140] do_exit+0x9bb/0x1ad0 [ 40.306566] ? ucma_create_id+0x45b/0x620 [ 40.310682] ? mm_update_next_owner+0x930/0x930 [ 40.315319] ? ucma_create_id+0x17b/0x620 [ 40.319437] ? ucma_get_event+0xa90/0xa90 [ 40.323558] ? __might_sleep+0x95/0x190 [ 40.327503] ? kasan_check_write+0x14/0x20 [ 40.331706] ? _copy_from_user+0x99/0x110 [ 40.335824] ? ucma_write+0x11f/0x3d0 [ 40.339593] ? ucma_get_event+0xa90/0xa90 [ 40.343709] ? ucma_resolve_route+0x1a0/0x1a0 [ 40.348185] ? ucma_resolve_route+0x1a0/0x1a0 [ 40.352648] ? __vfs_write+0xf7/0x970 [ 40.356418] ? rcu_note_context_switch+0x710/0x710 [ 40.361318] ? kernel_read+0x120/0x120 [ 40.365175] ? __might_sleep+0x95/0x190 [ 40.369122] ? _cond_resched+0x14/0x30 [ 40.372982] ? __inode_security_revalidate+0xd9/0x130 [ 40.378143] ? avc_policy_seqno+0x9/0x20 [ 40.382178] ? security_file_permission+0x89/0x1e0 [ 40.387078] ? rw_verify_area+0xe5/0x2b0 [ 40.391109] ? __fdget_raw+0x20/0x20 [ 40.394792] ? vfs_write+0x224/0x510 [ 40.398476] do_group_exit+0x149/0x400 [ 40.402335] ? SyS_write+0x184/0x220 [ 40.406015] ? filp_open+0x70/0x70 [ 40.409523] ? SyS_exit+0x30/0x30 [ 40.412944] ? SyS_read+0x220/0x220 [ 40.416547] ? do_syscall_64+0xb7/0x940 [ 40.420490] ? do_group_exit+0x400/0x400 [ 40.424521] SyS_exit_group+0x1d/0x20 [ 40.428295] do_syscall_64+0x281/0x940 [ 40.432154] ? __do_page_fault+0xc90/0xc90 [ 40.436360] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 40.441088] ? syscall_return_slowpath+0x550/0x550 [ 40.445990] ? syscall_return_slowpath+0x2ac/0x550 [ 40.450891] ? prepare_exit_to_usermode+0x350/0x350 [ 40.455878] ? entry_SYSCALL_64_after_hwframe+0x52/0xb7 [ 40.461215] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 40.466032] entry_SYSCALL_64_after_hwframe+0x42/0xb7 [ 40.471190] RIP: 0033:0x43e948 [ 40.474355] RSP: 002b:00007ffd30e7a858 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 40.482037] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 000000000043e948 [ 40.489279] RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000 [ 40.496518] RBP: 00000000004be300 R08: 00000000000000e7 R09: ffffffffffffffd0 [ 40.503757] R10: 00000000004002c8 R11: 0000000000000246 R12: 0000000000000001 [ 40.510996] R13: 00000000006cc160 R14: 0000000000000000 R15: 0000000000000000 [ 40.518594] Dumping ftrace buffer: [ 40.522104] (ftrace buffer empty) [ 40.525785] Kernel Offset: disabled [ 40.529382] Rebooting in 86400 seconds..