[?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. [ 17.901769] audit: type=1400 audit(1520869965.057:6): avc: denied { map } for pid=4203 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.10.7' (ECDSA) to the list of known hosts. executing program syzkaller login: [ 24.241828] audit: type=1400 audit(1520869971.397:7): avc: denied { map } for pid=4217 comm="syzkaller394993" path="/root/syzkaller394993807" 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.248687] ================================================================== [ 24.275148] BUG: KASAN: use-after-free in ucma_close+0x2d7/0x2f0 [ 24.281264] Read of size 8 at addr ffff8801b12ab740 by task syzkaller394993/4217 [ 24.288765] [ 24.290368] CPU: 1 PID: 4217 Comm: syzkaller394993 Not tainted 4.16.0-rc5+ #351 [ 24.297782] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 24.307115] Call Trace: [ 24.309687] dump_stack+0x194/0x24d [ 24.313289] ? arch_local_irq_restore+0x53/0x53 [ 24.317932] ? show_regs_print_info+0x18/0x18 [ 24.322406] ? ucma_close+0x2d7/0x2f0 [ 24.326182] print_address_description+0x73/0x250 [ 24.331009] ? ucma_close+0x2d7/0x2f0 [ 24.334790] kasan_report+0x23c/0x360 [ 24.338565] __asan_report_load8_noabort+0x14/0x20 [ 24.343475] ucma_close+0x2d7/0x2f0 [ 24.347080] ? __might_sleep+0x95/0x190 [ 24.351035] ? ucma_free_ctx+0xd90/0xd90 [ 24.355082] __fput+0x327/0x7e0 [ 24.358342] ? fput+0x140/0x140 [ 24.361598] ? _raw_spin_unlock_irq+0x27/0x70 [ 24.366069] ____fput+0x15/0x20 [ 24.369321] task_work_run+0x199/0x270 [ 24.373182] ? task_work_cancel+0x210/0x210 [ 24.377477] ? _raw_spin_unlock+0x22/0x30 [ 24.381609] ? switch_task_namespaces+0x87/0xc0 [ 24.386268] do_exit+0x9bb/0x1ad0 [ 24.389693] ? ucma_create_id+0x45b/0x620 [ 24.393819] ? mm_update_next_owner+0x930/0x930 [ 24.398466] ? ucma_create_id+0x17b/0x620 [ 24.402585] ? ucma_get_event+0xa90/0xa90 [ 24.406723] ? __might_sleep+0x95/0x190 [ 24.410674] ? kasan_check_write+0x14/0x20 [ 24.414885] ? _copy_from_user+0x99/0x110 [ 24.419026] ? ucma_write+0x11f/0x3d0 [ 24.422806] ? ucma_get_event+0xa90/0xa90 [ 24.426927] ? ucma_resolve_route+0x1a0/0x1a0 [ 24.431402] ? ucma_resolve_route+0x1a0/0x1a0 [ 24.435870] ? __vfs_write+0xf7/0x970 [ 24.439644] ? rcu_note_context_switch+0x710/0x710 [ 24.444546] ? kernel_read+0x120/0x120 [ 24.448407] ? __might_sleep+0x95/0x190 [ 24.452359] ? _cond_resched+0x14/0x30 [ 24.456219] ? __inode_security_revalidate+0xd9/0x130 [ 24.461380] ? avc_policy_seqno+0x9/0x20 [ 24.465420] ? security_file_permission+0x89/0x1e0 [ 24.470324] ? rw_verify_area+0xe5/0x2b0 [ 24.474357] ? __fdget_raw+0x20/0x20 [ 24.478059] ? vfs_write+0x224/0x510 [ 24.481751] do_group_exit+0x149/0x400 [ 24.485608] ? SyS_write+0x184/0x220 [ 24.489291] ? filp_open+0x70/0x70 [ 24.492804] ? SyS_exit+0x30/0x30 [ 24.496228] ? SyS_read+0x220/0x220 [ 24.499831] ? do_syscall_64+0xb7/0x940 [ 24.503778] ? do_group_exit+0x400/0x400 [ 24.507813] SyS_exit_group+0x1d/0x20 [ 24.511585] do_syscall_64+0x281/0x940 [ 24.515449] ? trace_event_raw_event_sys_exit+0x260/0x260 [ 24.520958] ? syscall_return_slowpath+0x550/0x550 [ 24.525859] ? syscall_return_slowpath+0x2ac/0x550 [ 24.530768] ? entry_SYSCALL_64_after_hwframe+0x52/0xb7 [ 24.536110] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 24.540929] entry_SYSCALL_64_after_hwframe+0x42/0xb7 [ 24.546090] RIP: 0033:0x43e918 [ 24.549250] RSP: 002b:00007ffe617d2a18 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 24.556929] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 000000000043e918 [ 24.564171] RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000 [ 24.571414] RBP: 00000000004be2c0 R08: 00000000000000e7 R09: ffffffffffffffd0 [ 24.578657] R10: 00000000004002c8 R11: 0000000000000246 R12: 0000000000000001 [ 24.585899] R13: 00000000006cc160 R14: 0000000000000000 R15: 0000000000000000 [ 24.593153] [ 24.594752] Allocated by task 4217: [ 24.598351] save_stack+0x43/0xd0 [ 24.601773] kasan_kmalloc+0xad/0xe0 [ 24.605460] kmem_cache_alloc_trace+0x136/0x740 [ 24.610101] ucma_alloc_ctx+0xce/0x610 [ 24.613959] ucma_create_id+0x205/0x620 [ 24.617904] ucma_write+0x2d6/0x3d0 [ 24.621500] __vfs_write+0xef/0x970 [ 24.625097] vfs_write+0x189/0x510 [ 24.628606] SyS_write+0xef/0x220 [ 24.632033] do_syscall_64+0x281/0x940 [ 24.635892] entry_SYSCALL_64_after_hwframe+0x42/0xb7 [ 24.641049] [ 24.642645] Freed by task 4217: [ 24.645894] save_stack+0x43/0xd0 [ 24.649319] __kasan_slab_free+0x11a/0x170 [ 24.653523] kasan_slab_free+0xe/0x10 [ 24.657293] kfree+0xd9/0x260 [ 24.660368] ucma_create_id+0x45b/0x620 [ 24.664311] ucma_write+0x2d6/0x3d0 [ 24.667906] __vfs_write+0xef/0x970 [ 24.671503] vfs_write+0x189/0x510 [ 24.675017] SyS_write+0xef/0x220 [ 24.678451] do_syscall_64+0x281/0x940 [ 24.682308] entry_SYSCALL_64_after_hwframe+0x42/0xb7 [ 24.687466] [ 24.689066] The buggy address belongs to the object at ffff8801b12ab6c0 [ 24.689066] which belongs to the cache kmalloc-256 of size 256 [ 24.701700] The buggy address is located 128 bytes inside of [ 24.701700] 256-byte region [ffff8801b12ab6c0, ffff8801b12ab7c0) [ 24.713541] The buggy address belongs to the page: [ 24.718440] page:ffffea0006c4aac0 count:1 mapcount:0 mapping:ffff8801b12ab080 index:0x0 [ 24.726552] flags: 0x2fffc0000000100(slab) [ 24.730758] raw: 02fffc0000000100 ffff8801b12ab080 0000000000000000 000000010000000c [ 24.738622] raw: ffffea0006c392e0 ffffea0006c59ee0 ffff8801dac007c0 0000000000000000 [ 24.746471] page dumped because: kasan: bad access detected [ 24.752149] [ 24.753745] Memory state around the buggy address: [ 24.758642] ffff8801b12ab600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 24.765980] ffff8801b12ab680: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb [ 24.773311] >ffff8801b12ab700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 24.780638] ^ [ 24.786057] ffff8801b12ab780: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 24.793385] ffff8801b12ab800: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 24.800711] ================================================================== [ 24.808039] Disabling lock debugging due to kernel taint [ 24.813617] Kernel panic - not syncing: panic_on_warn set ... [ 24.813617] [ 24.820963] CPU: 1 PID: 4217 Comm: syzkaller394993 Tainted: G B 4.16.0-rc5+ #351 [ 24.829678] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 24.839000] Call Trace: [ 24.841566] dump_stack+0x194/0x24d [ 24.845163] ? arch_local_irq_restore+0x53/0x53 [ 24.849804] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 24.854529] ? vsnprintf+0x1ed/0x1900 [ 24.858302] ? ucma_close+0x240/0x2f0 [ 24.862073] panic+0x1e4/0x41c [ 24.865234] ? refcount_error_report+0x214/0x214 [ 24.869961] ? add_taint+0x1c/0x50 [ 24.873474] ? add_taint+0x1c/0x50 [ 24.876983] ? ucma_close+0x2d7/0x2f0 [ 24.880754] kasan_end_report+0x50/0x50 [ 24.884701] kasan_report+0x149/0x360 [ 24.888472] __asan_report_load8_noabort+0x14/0x20 [ 24.893369] ucma_close+0x2d7/0x2f0 [ 24.896965] ? __might_sleep+0x95/0x190 [ 24.900907] ? ucma_free_ctx+0xd90/0xd90 [ 24.904939] __fput+0x327/0x7e0 [ 24.908190] ? fput+0x140/0x140 [ 24.911444] ? _raw_spin_unlock_irq+0x27/0x70 [ 24.915911] ____fput+0x15/0x20 [ 24.919161] task_work_run+0x199/0x270 [ 24.923023] ? task_work_cancel+0x210/0x210 [ 24.927314] ? _raw_spin_unlock+0x22/0x30 [ 24.931432] ? switch_task_namespaces+0x87/0xc0 [ 24.936076] do_exit+0x9bb/0x1ad0 [ 24.939497] ? ucma_create_id+0x45b/0x620 [ 24.943617] ? mm_update_next_owner+0x930/0x930 [ 24.948255] ? ucma_create_id+0x17b/0x620 [ 24.952373] ? ucma_get_event+0xa90/0xa90 [ 24.956492] ? __might_sleep+0x95/0x190 [ 24.960439] ? kasan_check_write+0x14/0x20 [ 24.964647] ? _copy_from_user+0x99/0x110 [ 24.968764] ? ucma_write+0x11f/0x3d0 [ 24.972533] ? ucma_get_event+0xa90/0xa90 [ 24.976649] ? ucma_resolve_route+0x1a0/0x1a0 [ 24.981117] ? ucma_resolve_route+0x1a0/0x1a0 [ 24.985580] ? __vfs_write+0xf7/0x970 [ 24.989354] ? rcu_note_context_switch+0x710/0x710 [ 24.994252] ? kernel_read+0x120/0x120 [ 24.998108] ? __might_sleep+0x95/0x190 [ 25.002053] ? _cond_resched+0x14/0x30 [ 25.005912] ? __inode_security_revalidate+0xd9/0x130 [ 25.011070] ? avc_policy_seqno+0x9/0x20 [ 25.015105] ? security_file_permission+0x89/0x1e0 [ 25.020003] ? rw_verify_area+0xe5/0x2b0 [ 25.024038] ? __fdget_raw+0x20/0x20 [ 25.027721] ? vfs_write+0x224/0x510 [ 25.031408] do_group_exit+0x149/0x400 [ 25.035266] ? SyS_write+0x184/0x220 [ 25.038948] ? filp_open+0x70/0x70 [ 25.042457] ? SyS_exit+0x30/0x30 [ 25.045879] ? SyS_read+0x220/0x220 [ 25.049476] ? do_syscall_64+0xb7/0x940 [ 25.053421] ? do_group_exit+0x400/0x400 [ 25.057452] SyS_exit_group+0x1d/0x20 [ 25.061220] do_syscall_64+0x281/0x940 [ 25.065079] ? trace_event_raw_event_sys_exit+0x260/0x260 [ 25.070587] ? syscall_return_slowpath+0x550/0x550 [ 25.075485] ? syscall_return_slowpath+0x2ac/0x550 [ 25.080389] ? entry_SYSCALL_64_after_hwframe+0x52/0xb7 [ 25.085734] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 25.090550] entry_SYSCALL_64_after_hwframe+0x42/0xb7 [ 25.095708] RIP: 0033:0x43e918 [ 25.098866] RSP: 002b:00007ffe617d2a18 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 25.106542] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 000000000043e918 [ 25.113786] RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000 [ 25.121031] RBP: 00000000004be2c0 R08: 00000000000000e7 R09: ffffffffffffffd0 [ 25.128272] R10: 00000000004002c8 R11: 0000000000000246 R12: 0000000000000001 [ 25.135521] R13: 00000000006cc160 R14: 0000000000000000 R15: 0000000000000000 [ 25.143210] Dumping ftrace buffer: [ 25.146727] (ftrace buffer empty) [ 25.150415] Kernel Offset: disabled [ 25.154014] Rebooting in 86400 seconds..