[....] 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.780286] random: sshd: uninitialized urandom read (32 bytes read) [ 23.337080] audit: type=1400 audit(1538217543.767:6): avc: denied { map } for pid=1766 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 [ 23.369714] random: sshd: uninitialized urandom read (32 bytes read) [ 23.850372] random: sshd: uninitialized urandom read (32 bytes read) [ 24.005616] random: sshd: uninitialized urandom read (32 bytes read) Warning: Permanently added '10.128.0.5' (ECDSA) to the list of known hosts. [ 29.654083] random: sshd: uninitialized urandom read (32 bytes read) executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program [ 29.752277] audit: type=1400 audit(1538217550.187:7): avc: denied { map } for pid=1778 comm="syz-executor044" path="/root/syz-executor044566506" 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.768557] raw_sendmsg: syz-executor044 forgot to set AF_INET. Fix it! executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program [ 29.926068] ================================================================== [ 29.933506] BUG: KASAN: use-after-free in ip_cmsg_recv_offset+0xcc6/0xde0 [ 29.940426] Read of size 4 at addr ffff8801d21ce020 by task syz-executor044/1827 [ 29.948049] [ 29.949665] CPU: 1 PID: 1827 Comm: syz-executor044 Not tainted 4.14.72+ #11 [ 29.956847] Call Trace: [ 29.959417] dump_stack+0xb9/0x11b [ 29.962951] print_address_description+0x60/0x22b [ 29.967785] kasan_report.cold.6+0x11b/0x2dd executing program executing program executing program [ 29.972180] ? ip_cmsg_recv_offset+0xcc6/0xde0 [ 29.976765] ip_cmsg_recv_offset+0xcc6/0xde0 [ 29.981181] ? ip_send_unicast_reply+0xc60/0xc60 [ 29.985929] ? __might_fault+0x104/0x1b0 [ 29.989970] ? lock_downgrade+0x560/0x560 [ 29.994114] ? copyout+0xa0/0xc0 [ 29.997466] ? copy_page_to_iter+0x421/0xd40 [ 30.001859] ? skb_copy_datagram_iter+0x1a3/0x900 [ 30.006802] raw_recvmsg+0x552/0x6d0 [ 30.010504] ? raw_bind+0x440/0x440 [ 30.014118] inet_recvmsg+0x147/0x560 [ 30.017903] ? inet_stream_connect+0xa0/0xa0 executing program executing program executing program executing program executing program [ 30.022308] ? security_socket_recvmsg+0x91/0xc0 [ 30.027070] ? inet_stream_connect+0xa0/0xa0 [ 30.031477] sock_recvmsg+0xc0/0x100 [ 30.035192] sock_read_iter+0x239/0x340 [ 30.039150] ? sock_recvmsg+0x100/0x100 [ 30.043151] ? __fsnotify_parent+0xb1/0x300 [ 30.047488] do_iter_readv_writev+0x473/0x560 [ 30.051980] ? clone_verify_area+0x1e0/0x1e0 [ 30.056585] ? security_file_permission+0x88/0x1e0 [ 30.061514] do_iter_read+0x212/0x580 [ 30.065303] ? inet_sendmsg+0x16f/0x540 [ 30.069256] vfs_readv+0xe6/0x150 executing program executing program [ 30.072691] ? compat_rw_copy_check_uvector+0x320/0x320 [ 30.078041] ? lock_downgrade+0x560/0x560 [ 30.082187] ? lock_acquire+0x10f/0x380 [ 30.086141] ? check_preemption_disabled+0x34/0x160 [ 30.091142] ? __fget+0x22b/0x3a0 [ 30.094597] do_readv+0xcc/0x240 [ 30.097961] ? vfs_readv+0x150/0x150 [ 30.101662] ? do_syscall_64+0x43/0x4b0 [ 30.105633] ? do_preadv+0x230/0x230 [ 30.109346] do_syscall_64+0x19b/0x4b0 [ 30.113231] entry_SYSCALL_64_after_hwframe+0x42/0xb7 [ 30.118511] RIP: 0033:0x446579 executing program executing program executing program executing program [ 30.121679] RSP: 002b:00007f033dba0da8 EFLAGS: 00000293 ORIG_RAX: 0000000000000013 [ 30.129363] RAX: ffffffffffffffda RBX: 00000000006dbc28 RCX: 0000000000446579 [ 30.136620] RDX: 0000000000000001 RSI: 0000000020000500 RDI: 0000000000000003 [ 30.144084] RBP: 00000000006dbc20 R08: 000000000000006e R09: 0000000000000000 [ 30.151444] R10: 000000000000006e R11: 0000000000000293 R12: 00000000006dbc2c [ 30.158707] R13: 00000000004ae620 R14: 0000000020001300 R15: 0000000000000000 [ 30.165980] [ 30.167587] Allocated by task 1820: [ 30.171207] kasan_kmalloc.part.1+0x4f/0xd0 executing program executing program executing program [ 30.175524] __kmalloc_track_caller+0x104/0x300 [ 30.180182] __kmalloc_reserve.isra.8+0x2f/0xc0 [ 30.184830] __alloc_skb+0x105/0x550 [ 30.188535] sock_wmalloc+0xa5/0xf0 [ 30.192145] __ip_append_data.isra.2+0x1983/0x2020 [ 30.197162] ip_append_data.part.4+0xd8/0x150 [ 30.201635] ip_append_data+0x5a/0x80 [ 30.205413] raw_sendmsg+0xa33/0x2470 [ 30.209227] inet_sendmsg+0x168/0x540 [ 30.213040] sock_sendmsg+0xb5/0x100 [ 30.216762] SyS_sendto+0x211/0x340 [ 30.220390] do_syscall_64+0x19b/0x4b0 executing program executing program [ 30.224270] entry_SYSCALL_64_after_hwframe+0x42/0xb7 [ 30.229437] [ 30.231063] Freed by task 1827: [ 30.234325] kasan_slab_free+0xac/0x190 [ 30.238278] kfree+0xf5/0x310 [ 30.241365] skb_free_head+0x83/0xa0 [ 30.245064] pskb_expand_head+0x553/0xb30 [ 30.249191] __pskb_pull_tail+0xca/0x1500 [ 30.253323] ip_cmsg_recv_offset+0xbe2/0xde0 [ 30.257722] raw_recvmsg+0x552/0x6d0 [ 30.261427] inet_recvmsg+0x147/0x560 [ 30.265224] sock_recvmsg+0xc0/0x100 [ 30.268930] sock_read_iter+0x239/0x340 [ 30.272897] do_iter_readv_writev+0x473/0x560 executing program executing program executing program [ 30.277371] do_iter_read+0x212/0x580 [ 30.281156] vfs_readv+0xe6/0x150 [ 30.284600] do_readv+0xcc/0x240 [ 30.287961] do_syscall_64+0x19b/0x4b0 [ 30.291838] entry_SYSCALL_64_after_hwframe+0x42/0xb7 [ 30.297010] [ 30.298646] The buggy address belongs to the object at ffff8801d21ce000 [ 30.298646] which belongs to the cache kmalloc-512 of size 512 [ 30.311392] The buggy address is located 32 bytes inside of [ 30.311392] 512-byte region [ffff8801d21ce000, ffff8801d21ce200) executing program executing program executing program executing program executing program [ 30.323257] The buggy address belongs to the page: [ 30.328175] page:ffffea0007487380 count:1 mapcount:0 mapping: (null) index:0x0 compound_mapcount: 0 [ 30.338127] flags: 0x4000000000008100(slab|head) [ 30.342884] raw: 4000000000008100 0000000000000000 0000000000000000 00000001000c000c [ 30.351074] raw: ffffea000748f000 0000000400000004 ffff8801da802c00 0000000000000000 [ 30.358934] page dumped because: kasan: bad access detected [ 30.364716] [ 30.366326] Memory state around the buggy address: executing program executing program executing program executing program [ 30.371299] ffff8801d21cdf00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 30.378647] ffff8801d21cdf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 30.386011] >ffff8801d21ce000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 30.393367] ^ [ 30.397787] ffff8801d21ce080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 30.405167] ffff8801d21ce100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 30.412502] ================================================================== [ 30.419840] Disabling lock debugging due to kernel taint executing program executing program executing program executing program [ 30.426571] Kernel panic - not syncing: panic_on_warn set ... [ 30.426571] [ 30.433950] CPU: 1 PID: 1827 Comm: syz-executor044 Tainted: G B 4.14.72+ #11 [ 30.442248] Call Trace: [ 30.444838] dump_stack+0xb9/0x11b [ 30.448380] panic+0x1bf/0x3a4 [ 30.451573] ? add_taint.cold.4+0x16/0x16 [ 30.455706] ? ___preempt_schedule+0x16/0x18 [ 30.460107] kasan_end_report+0x43/0x49 [ 30.464075] kasan_report.cold.6+0x77/0x2dd [ 30.468378] ? ip_cmsg_recv_offset+0xcc6/0xde0 [ 30.472943] ip_cmsg_recv_offset+0xcc6/0xde0 executing program executing program executing program [ 30.477440] ? ip_send_unicast_reply+0xc60/0xc60 [ 30.482189] ? __might_fault+0x104/0x1b0 [ 30.486305] ? lock_downgrade+0x560/0x560 [ 30.490442] ? copyout+0xa0/0xc0 [ 30.493791] ? copy_page_to_iter+0x421/0xd40 [ 30.498193] ? skb_copy_datagram_iter+0x1a3/0x900 [ 30.503046] raw_recvmsg+0x552/0x6d0 [ 30.506753] ? raw_bind+0x440/0x440 [ 30.510367] inet_recvmsg+0x147/0x560 [ 30.514165] ? inet_stream_connect+0xa0/0xa0 [ 30.518555] ? security_socket_recvmsg+0x91/0xc0 [ 30.523290] ? inet_stream_connect+0xa0/0xa0 executing program executing program executing program [ 30.527677] sock_recvmsg+0xc0/0x100 [ 30.531481] sock_read_iter+0x239/0x340 [ 30.535452] ? sock_recvmsg+0x100/0x100 [ 30.539407] ? __fsnotify_parent+0xb1/0x300 [ 30.543736] do_iter_readv_writev+0x473/0x560 [ 30.548220] ? clone_verify_area+0x1e0/0x1e0 [ 30.552620] ? security_file_permission+0x88/0x1e0 [ 30.557539] do_iter_read+0x212/0x580 [ 30.561334] ? inet_sendmsg+0x16f/0x540 [ 30.565289] vfs_readv+0xe6/0x150 [ 30.568731] ? compat_rw_copy_check_uvector+0x320/0x320 [ 30.574095] ? lock_downgrade+0x560/0x560 executing program executing program executing program [ 30.578230] ? lock_acquire+0x10f/0x380 [ 30.582184] ? check_preemption_disabled+0x34/0x160 [ 30.587190] ? __fget+0x22b/0x3a0 [ 30.590628] do_readv+0xcc/0x240 [ 30.594082] ? vfs_readv+0x150/0x150 [ 30.597786] ? do_syscall_64+0x43/0x4b0 [ 30.601752] ? do_preadv+0x230/0x230 [ 30.605550] do_syscall_64+0x19b/0x4b0 [ 30.609434] entry_SYSCALL_64_after_hwframe+0x42/0xb7 [ 30.614611] RIP: 0033:0x446579 [ 30.617779] RSP: 002b:00007f033dba0da8 EFLAGS: 00000293 ORIG_RAX: 0000000000000013 executing program executing program executing program [ 30.625575] RAX: ffffffffffffffda RBX: 00000000006dbc28 RCX: 0000000000446579 [ 30.632830] RDX: 0000000000000001 RSI: 0000000020000500 RDI: 0000000000000003 [ 30.640079] RBP: 00000000006dbc20 R08: 000000000000006e R09: 0000000000000000 [ 30.647339] R10: 000000000000006e R11: 0000000000000293 R12: 00000000006dbc2c [ 30.654598] R13: 00000000004ae620 R14: 0000000020001300 R15: 0000000000000000 [ 30.662256] Kernel Offset: 0x12e00000 from 0xffffffff81000000 (relocation range: 0xffffffff80000000-0xffffffffbfffffff) [ 30.673165] Rebooting in 86400 seconds..