Debian GNU/Linux 9 syzkaller ttyS0 Warning: Permanently added '10.128.0.186' (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 syzkaller login: [ 39.142815] ================================================================== [ 39.150524] BUG: KASAN: use-after-free in refcount_dec_not_one+0x71/0x1d0 [ 39.157614] Read of size 4 at addr ffff8880aadcd858 by task syz-executor460/8216 [ 39.165235] [ 39.166941] CPU: 0 PID: 8216 Comm: syz-executor460 Not tainted 4.19.195-syzkaller #0 [ 39.175859] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 39.186017] Call Trace: [ 39.188633] dump_stack+0x1fc/0x2ef [ 39.192286] print_address_description.cold+0x54/0x219 [ 39.197576] kasan_report_error.cold+0x8a/0x1b9 [ 39.202264] ? refcount_dec_not_one+0x71/0x1d0 [ 39.206869] kasan_report+0x8f/0xa0 [ 39.210533] ? refcount_dec_not_one+0x71/0x1d0 [ 39.215232] refcount_dec_not_one+0x71/0x1d0 [ 39.219681] ? refcount_dec_and_test_checked+0x20/0x20 [ 39.225280] ? nbd_config_put+0x5da/0x870 [ 39.230173] refcount_dec_and_mutex_lock+0x1c/0x80 [ 39.235339] nbd_genl_connect+0x11ee/0x1630 [ 39.239669] ? nbd_xmit_timeout+0x730/0x730 [ 39.243991] ? __sanitizer_cov_trace_switch+0x4b/0x80 [ 39.249204] ? validate_nla+0x270/0x820 [ 39.253184] ? nla_parse+0x1b2/0x290 [ 39.256904] genl_family_rcv_msg+0x642/0xc40 [ 39.261825] ? genl_rcv+0x40/0x40 [ 39.265504] ? genl_rcv_msg+0x12f/0x160 [ 39.269664] ? mutex_trylock+0x1a0/0x1a0 [ 39.274085] ? __radix_tree_lookup+0x216/0x370 [ 39.279036] genl_rcv_msg+0xbf/0x160 [ 39.283968] netlink_rcv_skb+0x160/0x440 [ 39.288068] ? genl_family_rcv_msg+0xc40/0xc40 [ 39.292833] ? netlink_ack+0xae0/0xae0 [ 39.296825] ? genl_rcv+0x15/0x40 [ 39.300301] genl_rcv+0x24/0x40 [ 39.303801] netlink_unicast+0x4d5/0x690 [ 39.307913] ? netlink_sendskb+0x110/0x110 [ 39.312626] ? _copy_from_iter_full+0x229/0x7c0 [ 39.317336] ? __phys_addr_symbol+0x2c/0x70 [ 39.321732] ? __check_object_size+0x17b/0x3e0 [ 39.326877] netlink_sendmsg+0x6bb/0xc40 [ 39.331249] ? aa_af_perm+0x230/0x230 [ 39.335074] ? nlmsg_notify+0x1a0/0x1a0 [ 39.339261] ? kernel_recvmsg+0x220/0x220 [ 39.343507] ? nlmsg_notify+0x1a0/0x1a0 [ 39.347667] sock_sendmsg+0xc3/0x120 [ 39.351408] ___sys_sendmsg+0x7bb/0x8e0 [ 39.355578] ? copy_msghdr_from_user+0x440/0x440 [ 39.360714] ? netlink_dump+0xc10/0xc10 [ 39.365412] ? nlmsg_notify+0x1a0/0x1a0 [ 39.370117] ? security_socket_recvmsg+0x8f/0xc0 [ 39.375271] ? __sys_recvfrom+0x2cd/0x3a0 [ 39.379635] ? __ia32_sys_send+0x100/0x100 [ 39.384249] ? __fdget+0x1a0/0x230 [ 39.388077] __x64_sys_sendmsg+0x132/0x220 [ 39.392782] ? __sys_sendmsg+0x1b0/0x1b0 [ 39.396945] ? entry_SYSCALL_64_after_hwframe+0x3e/0xbe [ 39.402837] ? trace_hardirqs_off_caller+0x6e/0x210 [ 39.407870] ? do_syscall_64+0x21/0x620 [ 39.412021] do_syscall_64+0xf9/0x620 [ 39.415992] entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 39.421291] RIP: 0033:0x4406e9 [ 39.424681] Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 14 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 c0 ff ff ff f7 d8 64 89 01 48 [ 39.444488] RSP: 002b:00007ffdfa46fee8 EFLAGS: 00000246 ORIG_RAX: 000000000000002e [ 39.452630] RAX: ffffffffffffffda RBX: 0000000000009899 RCX: 00000000004406e9 [ 39.459995] RDX: 0000000000000000 RSI: 0000000020000d00 RDI: 0000000000000003 [ 39.467891] RBP: 0000000000000000 R08: 0000000000000000 R09: 00007ffdfa470088 [ 39.477225] R10: 0000000000000000 R11: 0000000000000246 R12: 00007ffdfa46fefc [ 39.485944] R13: 431bde82d7b634db R14: 00000000004ae018 R15: 00000000004004a0 [ 39.494173] [ 39.495809] Allocated by task 8210: [ 39.499616] kmem_cache_alloc_trace+0x12f/0x380 [ 39.504728] nbd_dev_add+0x44/0x890 [ 39.508735] nbd_genl_connect+0x4cc/0x1630 [ 39.513539] genl_family_rcv_msg+0x642/0xc40 [ 39.518003] genl_rcv_msg+0xbf/0x160 [ 39.521743] netlink_rcv_skb+0x160/0x440 [ 39.525905] genl_rcv+0x24/0x40 [ 39.529338] netlink_unicast+0x4d5/0x690 [ 39.533495] netlink_sendmsg+0x6bb/0xc40 [ 39.537682] sock_sendmsg+0xc3/0x120 [ 39.541400] ___sys_sendmsg+0x7bb/0x8e0 [ 39.545787] __x64_sys_sendmsg+0x132/0x220 [ 39.550389] do_syscall_64+0xf9/0x620 [ 39.554735] entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 39.560256] [ 39.561963] Freed by task 8216: [ 39.565330] kfree+0xcc/0x210 [ 39.568433] nbd_put.part.0+0xfe/0x140 [ 39.572347] nbd_config_put+0x6a0/0x870 [ 39.576339] nbd_genl_connect+0x11bb/0x1630 [ 39.580773] genl_family_rcv_msg+0x642/0xc40 [ 39.585213] genl_rcv_msg+0xbf/0x160 [ 39.589141] netlink_rcv_skb+0x160/0x440 [ 39.593651] genl_rcv+0x24/0x40 [ 39.597203] netlink_unicast+0x4d5/0x690 [ 39.601458] netlink_sendmsg+0x6bb/0xc40 [ 39.605647] sock_sendmsg+0xc3/0x120 [ 39.609364] ___sys_sendmsg+0x7bb/0x8e0 [ 39.613447] __x64_sys_sendmsg+0x132/0x220 [ 39.617785] do_syscall_64+0xf9/0x620 [ 39.621614] entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 39.626886] [ 39.628569] The buggy address belongs to the object at ffff8880aadcd780 [ 39.628569] which belongs to the cache kmalloc-512 of size 512 [ 39.641852] The buggy address is located 216 bytes inside of [ 39.641852] 512-byte region [ffff8880aadcd780, ffff8880aadcd980) [ 39.654558] The buggy address belongs to the page: [ 39.659866] page:ffffea0002ab7340 count:1 mapcount:0 mapping:ffff88813bff0940 index:0xffff8880aadcdc80 [ 39.669506] flags: 0xfff00000000100(slab) [ 39.673755] raw: 00fff00000000100 ffffea0002acbd88 ffffea0002ad5c48 ffff88813bff0940 [ 39.681935] raw: ffff8880aadcdc80 ffff8880aadcd000 0000000100000003 0000000000000000 [ 39.690116] page dumped because: kasan: bad access detected [ 39.695822] [ 39.697470] Memory state around the buggy address: [ 39.702424] ffff8880aadcd700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 39.710050] ffff8880aadcd780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 39.717500] >ffff8880aadcd800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 39.725493] ^ [ 39.731901] ffff8880aadcd880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 39.739763] ffff8880aadcd900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 39.747635] ================================================================== [ 39.755094] Disabling lock debugging due to kernel taint [ 39.770518] Kernel panic - not syncing: panic_on_warn set ... [ 39.770518] [ 39.777936] CPU: 1 PID: 8216 Comm: syz-executor460 Tainted: G B 4.19.195-syzkaller #0 [ 39.787302] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 39.796850] Call Trace: [ 39.799481] dump_stack+0x1fc/0x2ef [ 39.803268] panic+0x26a/0x50e [ 39.807807] ? __warn_printk+0xf3/0xf3 [ 39.811921] ? preempt_schedule_common+0x45/0xc0 [ 39.816688] ? ___preempt_schedule+0x16/0x18 [ 39.821195] ? trace_hardirqs_on+0x55/0x210 [ 39.825511] kasan_end_report+0x43/0x49 [ 39.829494] kasan_report_error.cold+0xa7/0x1b9 [ 39.834545] ? refcount_dec_not_one+0x71/0x1d0 [ 39.839460] kasan_report+0x8f/0xa0 [ 39.843363] ? refcount_dec_not_one+0x71/0x1d0 [ 39.847942] refcount_dec_not_one+0x71/0x1d0 [ 39.852434] ? refcount_dec_and_test_checked+0x20/0x20 [ 39.857732] ? nbd_config_put+0x5da/0x870 [ 39.862010] refcount_dec_and_mutex_lock+0x1c/0x80 [ 39.867031] nbd_genl_connect+0x11ee/0x1630 [ 39.871661] ? nbd_xmit_timeout+0x730/0x730 [ 39.876428] ? __sanitizer_cov_trace_switch+0x4b/0x80 [ 39.881769] ? validate_nla+0x270/0x820 [ 39.885965] ? nla_parse+0x1b2/0x290 [ 39.889870] genl_family_rcv_msg+0x642/0xc40 [ 39.894308] ? genl_rcv+0x40/0x40 [ 39.897750] ? genl_rcv_msg+0x12f/0x160 [ 39.901718] ? mutex_trylock+0x1a0/0x1a0 [ 39.905791] ? __radix_tree_lookup+0x216/0x370 [ 39.910558] genl_rcv_msg+0xbf/0x160 [ 39.914371] netlink_rcv_skb+0x160/0x440 [ 39.918438] ? genl_family_rcv_msg+0xc40/0xc40 [ 39.923013] ? netlink_ack+0xae0/0xae0 [ 39.926953] ? genl_rcv+0x15/0x40 [ 39.930680] genl_rcv+0x24/0x40 [ 39.934057] netlink_unicast+0x4d5/0x690 [ 39.938300] ? netlink_sendskb+0x110/0x110 [ 39.942631] ? _copy_from_iter_full+0x229/0x7c0 [ 39.947305] ? __phys_addr_symbol+0x2c/0x70 [ 39.951641] ? __check_object_size+0x17b/0x3e0 [ 39.956589] netlink_sendmsg+0x6bb/0xc40 [ 39.960666] ? aa_af_perm+0x230/0x230 [ 39.964650] ? nlmsg_notify+0x1a0/0x1a0 [ 39.968742] ? kernel_recvmsg+0x220/0x220 [ 39.972939] ? nlmsg_notify+0x1a0/0x1a0 [ 39.976948] sock_sendmsg+0xc3/0x120 [ 39.980767] ___sys_sendmsg+0x7bb/0x8e0 [ 39.984830] ? copy_msghdr_from_user+0x440/0x440 [ 39.989964] ? netlink_dump+0xc10/0xc10 [ 39.993945] ? nlmsg_notify+0x1a0/0x1a0 [ 39.998105] ? security_socket_recvmsg+0x8f/0xc0 [ 40.002968] ? __sys_recvfrom+0x2cd/0x3a0 [ 40.007129] ? __ia32_sys_send+0x100/0x100 [ 40.012051] ? __fdget+0x1a0/0x230 [ 40.015607] __x64_sys_sendmsg+0x132/0x220 [ 40.019937] ? __sys_sendmsg+0x1b0/0x1b0 [ 40.024299] ? entry_SYSCALL_64_after_hwframe+0x3e/0xbe [ 40.030076] ? trace_hardirqs_off_caller+0x6e/0x210 [ 40.035361] ? do_syscall_64+0x21/0x620 [ 40.039439] do_syscall_64+0xf9/0x620 [ 40.043446] entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 40.049334] RIP: 0033:0x4406e9 [ 40.052537] Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 14 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 c0 ff ff ff f7 d8 64 89 01 48 [ 40.072227] RSP: 002b:00007ffdfa46fee8 EFLAGS: 00000246 ORIG_RAX: 000000000000002e [ 40.080107] RAX: ffffffffffffffda RBX: 0000000000009899 RCX: 00000000004406e9 [ 40.087726] RDX: 0000000000000000 RSI: 0000000020000d00 RDI: 0000000000000003 [ 40.095188] RBP: 0000000000000000 R08: 0000000000000000 R09: 00007ffdfa470088 [ 40.102954] R10: 0000000000000000 R11: 0000000000000246 R12: 00007ffdfa46fefc [ 40.110788] R13: 431bde82d7b634db R14: 00000000004ae018 R15: 00000000004004a0 [ 40.119636] Kernel Offset: disabled [ 40.123528] Rebooting in 86400 seconds..