[?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. [ 18.215952] audit: type=1400 audit(1521019225.904:6): avc: denied { map } for pid=4153 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.49' (ECDSA) to the list of known hosts. executing program syzkaller login: [ 24.605978] audit: type=1400 audit(1521019232.294:7): avc: denied { map } for pid=4167 comm="syzkaller903705" path="/root/syzkaller903705025" 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.611471] ================================================================== [ 24.639310] BUG: KASAN: use-after-free in ucma_close+0x2d7/0x2f0 [ 24.645428] Read of size 8 at addr ffff8801cbc46380 by task syzkaller903705/4167 [ 24.652932] [ 24.654535] CPU: 1 PID: 4167 Comm: syzkaller903705 Not tainted 4.16.0-rc5+ #352 [ 24.661950] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 24.671275] Call Trace: [ 24.673850] dump_stack+0x194/0x24d [ 24.677453] ? arch_local_irq_restore+0x53/0x53 [ 24.682095] ? show_regs_print_info+0x18/0x18 [ 24.686580] ? ucma_close+0x2d7/0x2f0 [ 24.690357] print_address_description+0x73/0x250 [ 24.695175] ? ucma_close+0x2d7/0x2f0 [ 24.698959] kasan_report+0x23c/0x360 [ 24.702736] __asan_report_load8_noabort+0x14/0x20 [ 24.707638] ucma_close+0x2d7/0x2f0 [ 24.711241] ? __might_sleep+0x95/0x190 [ 24.715189] ? ucma_free_ctx+0xd90/0xd90 [ 24.719226] __fput+0x327/0x7e0 [ 24.722484] ? fput+0x140/0x140 [ 24.725739] ? _raw_spin_unlock_irq+0x27/0x70 [ 24.730223] ____fput+0x15/0x20 [ 24.733487] task_work_run+0x199/0x270 [ 24.737350] ? task_work_cancel+0x210/0x210 [ 24.741652] ? _raw_spin_unlock+0x22/0x30 [ 24.745772] ? switch_task_namespaces+0x87/0xc0 [ 24.750420] do_exit+0x9bb/0x1ad0 [ 24.753847] ? ucma_create_id+0x45b/0x620 [ 24.757972] ? mm_update_next_owner+0x930/0x930 [ 24.762626] ? ucma_create_id+0x17b/0x620 [ 24.766747] ? ucma_get_event+0xa90/0xa90 [ 24.770877] ? __might_sleep+0x95/0x190 [ 24.774829] ? kasan_check_write+0x14/0x20 [ 24.779040] ? _copy_from_user+0x99/0x110 [ 24.783162] ? ucma_write+0x11f/0x3d0 [ 24.786936] ? ucma_get_event+0xa90/0xa90 [ 24.791055] ? ucma_resolve_route+0x1a0/0x1a0 [ 24.795531] ? ucma_resolve_route+0x1a0/0x1a0 [ 24.799997] ? __vfs_write+0xf7/0x970 [ 24.803792] ? rcu_note_context_switch+0x710/0x710 [ 24.808698] ? kernel_read+0x120/0x120 [ 24.812560] ? __might_sleep+0x95/0x190 [ 24.816522] ? _cond_resched+0x14/0x30 [ 24.820381] ? __inode_security_revalidate+0xd9/0x130 [ 24.825545] ? avc_policy_seqno+0x9/0x20 [ 24.829585] ? security_file_permission+0x89/0x1e0 [ 24.834492] ? rw_verify_area+0xe5/0x2b0 [ 24.838522] ? __fdget_raw+0x20/0x20 [ 24.842210] ? vfs_write+0x224/0x510 [ 24.845899] do_group_exit+0x149/0x400 [ 24.849757] ? SyS_write+0x184/0x220 [ 24.853450] ? filp_open+0x70/0x70 [ 24.856965] ? SyS_exit+0x30/0x30 [ 24.860391] ? SyS_read+0x220/0x220 [ 24.863993] ? do_syscall_64+0xb7/0x940 [ 24.867955] ? do_group_exit+0x400/0x400 [ 24.871998] SyS_exit_group+0x1d/0x20 [ 24.875778] do_syscall_64+0x281/0x940 [ 24.879636] ? __do_page_fault+0xc90/0xc90 [ 24.883844] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 24.888572] ? syscall_return_slowpath+0x550/0x550 [ 24.893474] ? syscall_return_slowpath+0x2ac/0x550 [ 24.898377] ? prepare_exit_to_usermode+0x350/0x350 [ 24.903370] ? entry_SYSCALL_64_after_hwframe+0x52/0xb7 [ 24.908710] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 24.913531] entry_SYSCALL_64_after_hwframe+0x42/0xb7 [ 24.918703] RIP: 0033:0x43e918 [ 24.921866] RSP: 002b:00007ffdc41c89b8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 24.929547] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 000000000043e918 [ 24.936791] RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000 [ 24.944039] RBP: 00000000004be2c0 R08: 00000000000000e7 R09: ffffffffffffffd0 [ 24.951299] R10: 00000000004002c8 R11: 0000000000000246 R12: 0000000000000001 [ 24.958539] R13: 00000000006cc160 R14: 0000000000000000 R15: 0000000000000000 [ 24.965810] [ 24.967412] Allocated by task 4167: [ 24.971013] save_stack+0x43/0xd0 [ 24.974437] kasan_kmalloc+0xad/0xe0 [ 24.978122] kmem_cache_alloc_trace+0x136/0x740 [ 24.982760] ucma_alloc_ctx+0xce/0x610 [ 24.986617] ucma_create_id+0x205/0x620 [ 24.990562] ucma_write+0x2d6/0x3d0 [ 24.994159] __vfs_write+0xef/0x970 [ 24.997754] vfs_write+0x189/0x510 [ 25.001264] SyS_write+0xef/0x220 [ 25.004693] do_syscall_64+0x281/0x940 [ 25.009343] entry_SYSCALL_64_after_hwframe+0x42/0xb7 [ 25.014512] [ 25.016112] Freed by task 4167: [ 25.019366] save_stack+0x43/0xd0 [ 25.022793] __kasan_slab_free+0x11a/0x170 [ 25.026997] kasan_slab_free+0xe/0x10 [ 25.030768] kfree+0xd9/0x260 [ 25.033846] ucma_create_id+0x45b/0x620 [ 25.037803] ucma_write+0x2d6/0x3d0 [ 25.041412] __vfs_write+0xef/0x970 [ 25.045034] vfs_write+0x189/0x510 [ 25.048546] SyS_write+0xef/0x220 [ 25.051971] do_syscall_64+0x281/0x940 [ 25.055831] entry_SYSCALL_64_after_hwframe+0x42/0xb7 [ 25.060987] [ 25.062586] The buggy address belongs to the object at ffff8801cbc46300 [ 25.062586] which belongs to the cache kmalloc-256 of size 256 [ 25.075213] The buggy address is located 128 bytes inside of [ 25.075213] 256-byte region [ffff8801cbc46300, ffff8801cbc46400) [ 25.087059] The buggy address belongs to the page: [ 25.091967] page:ffffea00072f1180 count:1 mapcount:0 mapping:ffff8801cbc46080 index:0x0 [ 25.100098] flags: 0x2fffc0000000100(slab) [ 25.104317] raw: 02fffc0000000100 ffff8801cbc46080 0000000000000000 000000010000000c [ 25.112180] raw: ffffea00072effe0 ffffea00072c0620 ffff8801dac007c0 0000000000000000 [ 25.120033] page dumped because: kasan: bad access detected [ 25.125720] [ 25.127319] Memory state around the buggy address: [ 25.132226] ffff8801cbc46280: 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc fc [ 25.139566] ffff8801cbc46300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 25.146897] >ffff8801cbc46380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 25.154227] ^ [ 25.157564] ffff8801cbc46400: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb [ 25.164893] ffff8801cbc46480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 25.172219] ================================================================== [ 25.179549] Disabling lock debugging due to kernel taint [ 25.185260] Kernel panic - not syncing: panic_on_warn set ... [ 25.185260] [ 25.192629] CPU: 1 PID: 4167 Comm: syzkaller903705 Tainted: G B 4.16.0-rc5+ #352 [ 25.201350] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 25.210673] Call Trace: [ 25.213234] dump_stack+0x194/0x24d [ 25.216834] ? arch_local_irq_restore+0x53/0x53 [ 25.221475] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 25.226201] ? vsnprintf+0x1ed/0x1900 [ 25.229972] ? ucma_close+0x1f0/0x2f0 [ 25.233743] panic+0x1e4/0x41c [ 25.236906] ? refcount_error_report+0x214/0x214 [ 25.241641] ? add_taint+0x1c/0x50 [ 25.245151] ? add_taint+0x1c/0x50 [ 25.248661] ? ucma_close+0x2d7/0x2f0 [ 25.252433] kasan_end_report+0x50/0x50 [ 25.256377] kasan_report+0x149/0x360 [ 25.260149] __asan_report_load8_noabort+0x14/0x20 [ 25.265057] ucma_close+0x2d7/0x2f0 [ 25.268655] ? __might_sleep+0x95/0x190 [ 25.272599] ? ucma_free_ctx+0xd90/0xd90 [ 25.276630] __fput+0x327/0x7e0 [ 25.279882] ? fput+0x140/0x140 [ 25.283131] ? _raw_spin_unlock_irq+0x27/0x70 [ 25.287599] ____fput+0x15/0x20 [ 25.290849] task_work_run+0x199/0x270 [ 25.294707] ? task_work_cancel+0x210/0x210 [ 25.298998] ? _raw_spin_unlock+0x22/0x30 [ 25.303120] ? switch_task_namespaces+0x87/0xc0 [ 25.307762] do_exit+0x9bb/0x1ad0 [ 25.311183] ? ucma_create_id+0x45b/0x620 [ 25.315312] ? mm_update_next_owner+0x930/0x930 [ 25.319951] ? ucma_create_id+0x17b/0x620 [ 25.324077] ? ucma_get_event+0xa90/0xa90 [ 25.328198] ? __might_sleep+0x95/0x190 [ 25.332146] ? kasan_check_write+0x14/0x20 [ 25.336368] ? _copy_from_user+0x99/0x110 [ 25.340496] ? ucma_write+0x11f/0x3d0 [ 25.344273] ? ucma_get_event+0xa90/0xa90 [ 25.348486] ? ucma_resolve_route+0x1a0/0x1a0 [ 25.352967] ? ucma_resolve_route+0x1a0/0x1a0 [ 25.357433] ? __vfs_write+0xf7/0x970 [ 25.361215] ? rcu_note_context_switch+0x710/0x710 [ 25.366118] ? kernel_read+0x120/0x120 [ 25.369975] ? __might_sleep+0x95/0x190 [ 25.373923] ? _cond_resched+0x14/0x30 [ 25.377795] ? __inode_security_revalidate+0xd9/0x130 [ 25.382954] ? avc_policy_seqno+0x9/0x20 [ 25.386989] ? security_file_permission+0x89/0x1e0 [ 25.391891] ? rw_verify_area+0xe5/0x2b0 [ 25.395931] ? __fdget_raw+0x20/0x20 [ 25.399622] ? vfs_write+0x224/0x510 [ 25.403307] do_group_exit+0x149/0x400 [ 25.407172] ? SyS_write+0x184/0x220 [ 25.410854] ? filp_open+0x70/0x70 [ 25.414363] ? SyS_exit+0x30/0x30 [ 25.417786] ? SyS_read+0x220/0x220 [ 25.421384] ? do_syscall_64+0xb7/0x940 [ 25.425328] ? do_group_exit+0x400/0x400 [ 25.429362] SyS_exit_group+0x1d/0x20 [ 25.433146] do_syscall_64+0x281/0x940 [ 25.437005] ? __do_page_fault+0xc90/0xc90 [ 25.441214] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 25.445940] ? syscall_return_slowpath+0x550/0x550 [ 25.450848] ? syscall_return_slowpath+0x2ac/0x550 [ 25.455757] ? prepare_exit_to_usermode+0x350/0x350 [ 25.460762] ? entry_SYSCALL_64_after_hwframe+0x52/0xb7 [ 25.466099] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 25.470925] entry_SYSCALL_64_after_hwframe+0x42/0xb7 [ 25.476086] RIP: 0033:0x43e918 [ 25.479245] RSP: 002b:00007ffdc41c89b8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 25.486922] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 000000000043e918 [ 25.494162] RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000 [ 25.501401] RBP: 00000000004be2c0 R08: 00000000000000e7 R09: ffffffffffffffd0 [ 25.508648] R10: 00000000004002c8 R11: 0000000000000246 R12: 0000000000000001 [ 25.515888] R13: 00000000006cc160 R14: 0000000000000000 R15: 0000000000000000 [ 25.523591] Dumping ftrace buffer: [ 25.527113] (ftrace buffer empty) [ 25.530804] Kernel Offset: disabled [ 25.534404] Rebooting in 86400 seconds..