[ OK ] Found device /dev/ttyS0. [ OK ] Listening on Load/Save RF Kill Switch Status /dev/rfkill Watch. [ OK ] Started Serial Getty on ttyS0. [ OK ] Reached target Login Prompts. [ OK ] Reached target Multi-User System. [ OK ] Reached target Graphical Interface. Starting Update UTMP about System Runlevel Changes... [ OK ] Started Update UTMP about System Runlevel Changes. Starting Load/Save RF Kill Switch Status... [ OK ] Started Load/Save RF Kill Switch Status. Debian GNU/Linux 9 syzkaller ttyS0 Warning: Permanently added '10.128.0.178' (ECDSA) to the list of known hosts. 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 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 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 executing program executing program executing program executing program executing program executing program executing program executing program syzkaller login: [ 28.968954] ================================================================== [ 28.976424] BUG: KASAN: use-after-free in refcount_dec_not_one+0x9a/0xc0 [ 28.983247] Read of size 4 at addr ffff8880a5b0db58 by task syz-executor409/8173 [ 28.990846] [ 28.992463] CPU: 0 PID: 8173 Comm: syz-executor409 Not tainted 4.14.281-syzkaller #0 [ 29.000318] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 29.009655] Call Trace: [ 29.012240] dump_stack+0x1b2/0x281 [ 29.015875] print_address_description.cold+0x54/0x1d3 [ 29.021143] kasan_report_error.cold+0x8a/0x191 [ 29.025797] ? refcount_dec_not_one+0x9a/0xc0 [ 29.030272] __asan_report_load4_noabort+0x68/0x70 [ 29.035182] ? refcount_dec_not_one+0x9a/0xc0 [ 29.039654] refcount_dec_not_one+0x9a/0xc0 [ 29.043952] refcount_dec_and_mutex_lock+0x1a/0x60 [ 29.048859] nbd_genl_connect+0xf94/0x1400 [ 29.053080] ? nbd_xmit_timeout+0x500/0x500 [ 29.057387] ? __mutex_lock+0x356/0x1310 [ 29.061426] ? validate_nla+0x192/0x5e0 [ 29.065378] ? nla_parse+0x157/0x1f0 [ 29.069071] genl_family_rcv_msg+0x572/0xb20 [ 29.073460] ? genl_rcv+0x40/0x40 [ 29.076899] ? __ww_mutex_wakeup_for_backoff+0x210/0x210 [ 29.082335] ? trace_hardirqs_on+0x10/0x10 [ 29.086551] genl_rcv_msg+0xaf/0x140 [ 29.090245] netlink_rcv_skb+0x125/0x390 [ 29.094322] ? genl_family_rcv_msg+0xb20/0xb20 [ 29.099056] ? netlink_ack+0x9a0/0x9a0 [ 29.102934] ? lock_acquire+0x170/0x3f0 [ 29.106894] genl_rcv+0x24/0x40 [ 29.110198] netlink_unicast+0x437/0x610 [ 29.114245] ? netlink_sendskb+0xd0/0xd0 [ 29.118381] ? __check_object_size+0x179/0x230 [ 29.122951] netlink_sendmsg+0x648/0xbc0 [ 29.126993] ? nlmsg_notify+0x1b0/0x1b0 [ 29.130944] ? kernel_recvmsg+0x210/0x210 [ 29.135071] ? security_socket_sendmsg+0x83/0xb0 [ 29.139830] ? nlmsg_notify+0x1b0/0x1b0 [ 29.143789] sock_sendmsg+0xb5/0x100 [ 29.147487] ___sys_sendmsg+0x6c8/0x800 [ 29.151448] ? copy_msghdr_from_user+0x3b0/0x3b0 [ 29.156193] ? trace_hardirqs_on+0x10/0x10 [ 29.160404] ? trace_hardirqs_on+0x10/0x10 [ 29.164634] ? apparmor_file_alloc_security+0x129/0x800 [ 29.169982] ? rcu_lockdep_current_cpu_online+0xed/0x140 [ 29.175489] ? __lockdep_init_map+0x100/0x560 [ 29.179965] ? __fd_install+0x1ec/0x5c0 [ 29.183921] ? lock_acquire+0x170/0x3f0 [ 29.187873] ? lock_downgrade+0x740/0x740 [ 29.192001] ? __fdget+0x167/0x1f0 [ 29.195634] ? sockfd_lookup_light+0xb2/0x160 [ 29.200126] __sys_sendmsg+0xa3/0x120 [ 29.203913] ? SyS_shutdown+0x160/0x160 [ 29.207870] ? move_addr_to_kernel+0x60/0x60 [ 29.212263] ? __do_page_fault+0x159/0xad0 [ 29.216574] SyS_sendmsg+0x27/0x40 [ 29.220094] ? __sys_sendmsg+0x120/0x120 [ 29.224134] do_syscall_64+0x1d5/0x640 [ 29.228020] entry_SYSCALL_64_after_hwframe+0x46/0xbb [ 29.233197] RIP: 0033:0x7f16dac6b949 [ 29.236888] RSP: 002b:00007ffe912519e8 EFLAGS: 00000246 ORIG_RAX: 000000000000002e [ 29.244582] RAX: ffffffffffffffda RBX: 00000000000f4240 RCX: 00007f16dac6b949 [ 29.251842] RDX: 0000000000000000 RSI: 0000000020000240 RDI: 0000000000000004 [ 29.259091] RBP: 0000000000000000 R08: 0000000000000001 R09: 0000000000000001 [ 29.266343] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000006e9b [ 29.273602] R13: 00007ffe912519fc R14: 00007ffe91251a10 R15: 00007ffe91251a00 [ 29.280860] [ 29.282465] Allocated by task 8187: [ 29.286074] kasan_kmalloc+0xeb/0x160 [ 29.289855] kmem_cache_alloc_trace+0x131/0x3d0 [ 29.294509] nbd_dev_add+0x7c/0x800 [ 29.298117] nbd_genl_connect+0x3a4/0x1400 [ 29.302335] genl_family_rcv_msg+0x572/0xb20 [ 29.306719] genl_rcv_msg+0xaf/0x140 [ 29.310410] netlink_rcv_skb+0x125/0x390 [ 29.314446] genl_rcv+0x24/0x40 [ 29.317703] netlink_unicast+0x437/0x610 [ 29.321827] netlink_sendmsg+0x648/0xbc0 [ 29.325863] sock_sendmsg+0xb5/0x100 [ 29.329551] ___sys_sendmsg+0x6c8/0x800 [ 29.333508] __sys_sendmsg+0xa3/0x120 [ 29.337284] SyS_sendmsg+0x27/0x40 [ 29.340801] do_syscall_64+0x1d5/0x640 [ 29.344665] entry_SYSCALL_64_after_hwframe+0x46/0xbb [ 29.349826] [ 29.351427] Freed by task 8173: [ 29.354683] kasan_slab_free+0xc3/0x1a0 [ 29.358633] kfree+0xc9/0x250 [ 29.361717] nbd_put.part.0+0x100/0x140 [ 29.365664] nbd_config_put+0x62a/0x810 [ 29.369613] nbd_genl_connect+0xf6c/0x1400 [ 29.373825] genl_family_rcv_msg+0x572/0xb20 [ 29.378208] genl_rcv_msg+0xaf/0x140 [ 29.381912] netlink_rcv_skb+0x125/0x390 [ 29.385955] genl_rcv+0x24/0x40 [ 29.389210] netlink_unicast+0x437/0x610 [ 29.393246] netlink_sendmsg+0x648/0xbc0 [ 29.397281] sock_sendmsg+0xb5/0x100 [ 29.400972] ___sys_sendmsg+0x6c8/0x800 [ 29.404924] __sys_sendmsg+0xa3/0x120 [ 29.408700] SyS_sendmsg+0x27/0x40 [ 29.412215] do_syscall_64+0x1d5/0x640 [ 29.416076] entry_SYSCALL_64_after_hwframe+0x46/0xbb [ 29.421370] [ 29.422987] The buggy address belongs to the object at ffff8880a5b0da80 [ 29.422987] which belongs to the cache kmalloc-512 of size 512 [ 29.435625] The buggy address is located 216 bytes inside of [ 29.435625] 512-byte region [ffff8880a5b0da80, ffff8880a5b0dc80) [ 29.447483] The buggy address belongs to the page: [ 29.452400] page:ffffea000296c340 count:1 mapcount:0 mapping:ffff8880a5b0d080 index:0x0 [ 29.460519] flags: 0xfff00000000100(slab) [ 29.464648] raw: 00fff00000000100 ffff8880a5b0d080 0000000000000000 0000000100000006 [ 29.472508] raw: ffffea0002ab8560 ffffea00028f32e0 ffff88813fe74940 0000000000000000 [ 29.480367] page dumped because: kasan: bad access detected [ 29.486050] [ 29.487654] Memory state around the buggy address: [ 29.492559] ffff8880a5b0da00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 29.499894] ffff8880a5b0da80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 29.507239] >ffff8880a5b0db00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 29.514581] ^ [ 29.520788] ffff8880a5b0db80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 29.528131] ffff8880a5b0dc00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 29.535468] ================================================================== [ 29.542811] Disabling lock debugging due to kernel taint [ 29.549482] Kernel panic - not syncing: panic_on_warn set ... [ 29.549482] [ 29.556862] CPU: 0 PID: 8173 Comm: syz-executor409 Tainted: G B 4.14.281-syzkaller #0 [ 29.566034] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 29.575375] Call Trace: [ 29.577958] dump_stack+0x1b2/0x281 [ 29.581578] panic+0x1f9/0x42d [ 29.584763] ? add_taint.cold+0x16/0x16 [ 29.588723] ? ___preempt_schedule+0x16/0x18 [ 29.593106] kasan_end_report+0x43/0x49 [ 29.597054] kasan_report_error.cold+0xa7/0x191 [ 29.601700] ? refcount_dec_not_one+0x9a/0xc0 [ 29.606169] __asan_report_load4_noabort+0x68/0x70 [ 29.611075] ? refcount_dec_not_one+0x9a/0xc0 [ 29.615547] refcount_dec_not_one+0x9a/0xc0 [ 29.619932] refcount_dec_and_mutex_lock+0x1a/0x60 [ 29.624836] nbd_genl_connect+0xf94/0x1400 [ 29.629048] ? nbd_xmit_timeout+0x500/0x500 [ 29.633344] ? __mutex_lock+0x356/0x1310 [ 29.637385] ? validate_nla+0x192/0x5e0 [ 29.641341] ? nla_parse+0x157/0x1f0 [ 29.645033] genl_family_rcv_msg+0x572/0xb20 [ 29.649420] ? genl_rcv+0x40/0x40 [ 29.652938] ? __ww_mutex_wakeup_for_backoff+0x210/0x210 [ 29.658364] ? trace_hardirqs_on+0x10/0x10 [ 29.662583] genl_rcv_msg+0xaf/0x140 [ 29.666276] netlink_rcv_skb+0x125/0x390 [ 29.670314] ? genl_family_rcv_msg+0xb20/0xb20 [ 29.674869] ? netlink_ack+0x9a0/0x9a0 [ 29.678741] ? lock_acquire+0x170/0x3f0 [ 29.682695] genl_rcv+0x24/0x40 [ 29.685953] netlink_unicast+0x437/0x610 [ 29.689999] ? netlink_sendskb+0xd0/0xd0 [ 29.694054] ? __check_object_size+0x179/0x230 [ 29.698616] netlink_sendmsg+0x648/0xbc0 [ 29.702653] ? nlmsg_notify+0x1b0/0x1b0 [ 29.706601] ? kernel_recvmsg+0x210/0x210 [ 29.710725] ? security_socket_sendmsg+0x83/0xb0 [ 29.715454] ? nlmsg_notify+0x1b0/0x1b0 [ 29.719418] sock_sendmsg+0xb5/0x100 [ 29.723115] ___sys_sendmsg+0x6c8/0x800 [ 29.727092] ? copy_msghdr_from_user+0x3b0/0x3b0 [ 29.731822] ? trace_hardirqs_on+0x10/0x10 [ 29.736034] ? trace_hardirqs_on+0x10/0x10 [ 29.740247] ? apparmor_file_alloc_security+0x129/0x800 [ 29.745592] ? rcu_lockdep_current_cpu_online+0xed/0x140 [ 29.751021] ? __lockdep_init_map+0x100/0x560 [ 29.755499] ? __fd_install+0x1ec/0x5c0 [ 29.759451] ? lock_acquire+0x170/0x3f0 [ 29.763489] ? lock_downgrade+0x740/0x740 [ 29.767658] ? __fdget+0x167/0x1f0 [ 29.771176] ? sockfd_lookup_light+0xb2/0x160 [ 29.775645] __sys_sendmsg+0xa3/0x120 [ 29.779428] ? SyS_shutdown+0x160/0x160 [ 29.783380] ? move_addr_to_kernel+0x60/0x60 [ 29.787767] ? __do_page_fault+0x159/0xad0 [ 29.791982] SyS_sendmsg+0x27/0x40 [ 29.795499] ? __sys_sendmsg+0x120/0x120 [ 29.799538] do_syscall_64+0x1d5/0x640 [ 29.803404] entry_SYSCALL_64_after_hwframe+0x46/0xbb [ 29.808570] RIP: 0033:0x7f16dac6b949 [ 29.812261] RSP: 002b:00007ffe912519e8 EFLAGS: 00000246 ORIG_RAX: 000000000000002e [ 29.819944] RAX: ffffffffffffffda RBX: 00000000000f4240 RCX: 00007f16dac6b949 [ 29.827195] RDX: 0000000000000000 RSI: 0000000020000240 RDI: 0000000000000004 [ 29.834439] RBP: 0000000000000000 R08: 0000000000000001 R09: 0000000000000001 [ 29.841682] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000006e9b [ 29.848930] R13: 00007ffe912519fc R14: 00007ffe91251a10 R15: 00007ffe91251a00 [ 29.856348] Kernel Offset: disabled [ 29.859963] Rebooting in 86400 seconds..