Debian GNU/Linux 9 syzkaller ttyS0 Warning: Permanently added '10.128.0.240' (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 syzkaller login: [ 33.704070] ================================================================== [ 33.711536] BUG: KASAN: use-after-free in refcount_dec_not_one+0x71/0x1d0 [ 33.718448] Read of size 4 at addr ffff8880a1410b18 by task syz-executor422/8176 [ 33.725957] [ 33.727570] CPU: 1 PID: 8176 Comm: syz-executor422 Not tainted 4.19.211-syzkaller #0 [ 33.735439] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 33.744794] Call Trace: [ 33.747398] dump_stack+0x1fc/0x2ef [ 33.751049] print_address_description.cold+0x54/0x219 [ 33.756684] kasan_report_error.cold+0x8a/0x1b9 [ 33.761370] ? refcount_dec_not_one+0x71/0x1d0 [ 33.765953] kasan_report+0x8f/0xa0 [ 33.769568] ? refcount_dec_not_one+0x71/0x1d0 [ 33.774143] refcount_dec_not_one+0x71/0x1d0 [ 33.778555] ? refcount_dec_and_test_checked+0x20/0x20 [ 33.783830] ? nbd_config_put+0x5da/0x870 [ 33.787962] refcount_dec_and_mutex_lock+0x1c/0x80 [ 33.792880] nbd_genl_connect+0x11ee/0x1630 [ 33.797190] ? nbd_xmit_timeout+0x730/0x730 [ 33.801503] ? __sanitizer_cov_trace_switch+0x4b/0x80 [ 33.806672] ? validate_nla+0x270/0x820 [ 33.810628] ? nla_parse+0x1b2/0x290 [ 33.814323] genl_family_rcv_msg+0x642/0xc40 [ 33.818714] ? genl_rcv+0x40/0x40 [ 33.822147] ? genl_rcv_msg+0x12f/0x160 [ 33.826103] ? mutex_trylock+0x1a0/0x1a0 [ 33.830170] ? __radix_tree_lookup+0x216/0x370 [ 33.834748] genl_rcv_msg+0xbf/0x160 [ 33.838442] netlink_rcv_skb+0x160/0x440 [ 33.842490] ? genl_family_rcv_msg+0xc40/0xc40 [ 33.847052] ? netlink_ack+0xae0/0xae0 [ 33.850918] ? genl_rcv+0x15/0x40 [ 33.854368] genl_rcv+0x24/0x40 [ 33.857644] netlink_unicast+0x4d5/0x690 [ 33.861697] ? netlink_sendskb+0x110/0x110 [ 33.865912] ? _copy_from_iter_full+0x229/0x7c0 [ 33.870561] ? __phys_addr_symbol+0x2c/0x70 [ 33.874864] ? __check_object_size+0x17b/0x3e0 [ 33.879516] netlink_sendmsg+0x6c3/0xc50 [ 33.883560] ? aa_af_perm+0x230/0x230 [ 33.887350] ? nlmsg_notify+0x1f0/0x1f0 [ 33.891313] ? kernel_recvmsg+0x220/0x220 [ 33.895446] ? nlmsg_notify+0x1f0/0x1f0 [ 33.899404] sock_sendmsg+0xc3/0x120 [ 33.903102] ___sys_sendmsg+0x7bb/0x8e0 [ 33.907063] ? copy_msghdr_from_user+0x440/0x440 [ 33.911811] ? apparmor_file_receive+0x160/0x160 [ 33.916553] ? __lockdep_init_map+0x100/0x5a0 [ 33.921031] ? check_preemption_disabled+0x41/0x280 [ 33.926035] ? mark_held_locks+0xf0/0xf0 [ 33.930085] ? percpu_counter_add_batch+0x126/0x180 [ 33.935084] ? alloc_empty_file+0xd7/0x170 [ 33.939298] ? errseq_sample+0x56/0x70 [ 33.943430] ? alloc_file+0x326/0x4d0 [ 33.947218] ? __fd_install+0x1b4/0x610 [ 33.951172] ? __fdget+0x1a0/0x230 [ 33.954703] __x64_sys_sendmsg+0x132/0x220 [ 33.958926] ? __sys_sendmsg+0x1b0/0x1b0 [ 33.962996] ? entry_SYSCALL_64_after_hwframe+0x3e/0xbe [ 33.968364] ? trace_hardirqs_off_caller+0x6e/0x210 [ 33.973558] ? do_syscall_64+0x21/0x620 [ 33.977532] do_syscall_64+0xf9/0x620 [ 33.981326] entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 33.986495] RIP: 0033:0x7f0c1440f959 [ 33.990190] 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 [ 34.009185] RSP: 002b:00007fff59f31f48 EFLAGS: 00000246 ORIG_RAX: 000000000000002e [ 34.016877] RAX: ffffffffffffffda RBX: 00000000000f4240 RCX: 00007f0c1440f959 [ 34.024129] RDX: 0000000000000000 RSI: 0000000020000200 RDI: 0000000000000004 [ 34.031378] RBP: 0000000000000000 R08: 0000000000000001 R09: 0000000000000001 [ 34.038633] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000008220 [ 34.045884] R13: 00007fff59f31f5c R14: 00007fff59f31f70 R15: 00007fff59f31f60 [ 34.053140] [ 34.054748] Allocated by task 8169: [ 34.058361] kmem_cache_alloc_trace+0x12f/0x380 [ 34.063024] nbd_dev_add+0x44/0x890 [ 34.066636] nbd_genl_connect+0x4cc/0x1630 [ 34.070861] genl_family_rcv_msg+0x642/0xc40 [ 34.075249] genl_rcv_msg+0xbf/0x160 [ 34.078949] netlink_rcv_skb+0x160/0x440 [ 34.082998] genl_rcv+0x24/0x40 [ 34.086261] netlink_unicast+0x4d5/0x690 [ 34.090305] netlink_sendmsg+0x6c3/0xc50 [ 34.094348] sock_sendmsg+0xc3/0x120 [ 34.098041] ___sys_sendmsg+0x7bb/0x8e0 [ 34.101995] __x64_sys_sendmsg+0x132/0x220 [ 34.106211] do_syscall_64+0xf9/0x620 [ 34.110004] entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 34.115191] [ 34.116798] Freed by task 8176: [ 34.120066] kfree+0xcc/0x210 [ 34.123161] nbd_put.part.0+0xfe/0x140 [ 34.127036] nbd_config_put+0x6a0/0x870 [ 34.130993] nbd_genl_connect+0x11bb/0x1630 [ 34.135303] genl_family_rcv_msg+0x642/0xc40 [ 34.139698] genl_rcv_msg+0xbf/0x160 [ 34.143391] netlink_rcv_skb+0x160/0x440 [ 34.147431] genl_rcv+0x24/0x40 [ 34.150691] netlink_unicast+0x4d5/0x690 [ 34.154732] netlink_sendmsg+0x6c3/0xc50 [ 34.158775] sock_sendmsg+0xc3/0x120 [ 34.162479] ___sys_sendmsg+0x7bb/0x8e0 [ 34.166436] __x64_sys_sendmsg+0x132/0x220 [ 34.170650] do_syscall_64+0xf9/0x620 [ 34.174441] entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 34.179612] [ 34.181222] The buggy address belongs to the object at ffff8880a1410a40 [ 34.181222] which belongs to the cache kmalloc-512 of size 512 [ 34.193858] The buggy address is located 216 bytes inside of [ 34.193858] 512-byte region [ffff8880a1410a40, ffff8880a1410c40) [ 34.205710] The buggy address belongs to the page: [ 34.210629] page:ffffea0002850400 count:1 mapcount:0 mapping:ffff88813bff0940 index:0x0 [ 34.218751] flags: 0xfff00000000100(slab) [ 34.222881] raw: 00fff00000000100 ffffea0002863308 ffffea00027b0dc8 ffff88813bff0940 [ 34.230744] raw: 0000000000000000 ffff8880a1410040 0000000100000006 0000000000000000 [ 34.238602] page dumped because: kasan: bad access detected [ 34.244290] [ 34.245895] Memory state around the buggy address: [ 34.250805] ffff8880a1410a00: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb [ 34.258143] ffff8880a1410a80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 34.270181] >ffff8880a1410b00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 34.277527] ^ [ 34.281653] ffff8880a1410b80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 34.288994] ffff8880a1410c00: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 34.296329] ================================================================== [ 34.303662] Disabling lock debugging due to kernel taint [ 34.312507] Kernel panic - not syncing: panic_on_warn set ... [ 34.312507] [ 34.319896] CPU: 0 PID: 8176 Comm: syz-executor422 Tainted: G B 4.19.211-syzkaller #0 [ 34.329157] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 34.338501] Call Trace: [ 34.341084] dump_stack+0x1fc/0x2ef [ 34.344710] panic+0x26a/0x50e [ 34.347894] ? __warn_printk+0xf3/0xf3 [ 34.351759] ? preempt_schedule_common+0x45/0xc0 [ 34.356492] ? ___preempt_schedule+0x16/0x18 [ 34.360896] ? trace_hardirqs_on+0x55/0x210 [ 34.365197] kasan_end_report+0x43/0x49 [ 34.369152] kasan_report_error.cold+0xa7/0x1b9 [ 34.373805] ? refcount_dec_not_one+0x71/0x1d0 [ 34.378365] kasan_report+0x8f/0xa0 [ 34.381975] ? refcount_dec_not_one+0x71/0x1d0 [ 34.386534] refcount_dec_not_one+0x71/0x1d0 [ 34.390921] ? refcount_dec_and_test_checked+0x20/0x20 [ 34.396181] ? nbd_config_put+0x5da/0x870 [ 34.400308] refcount_dec_and_mutex_lock+0x1c/0x80 [ 34.405218] nbd_genl_connect+0x11ee/0x1630 [ 34.409577] ? nbd_xmit_timeout+0x730/0x730 [ 34.413881] ? __sanitizer_cov_trace_switch+0x4b/0x80 [ 34.419050] ? validate_nla+0x270/0x820 [ 34.423002] ? nla_parse+0x1b2/0x290 [ 34.426694] genl_family_rcv_msg+0x642/0xc40 [ 34.431081] ? genl_rcv+0x40/0x40 [ 34.434512] ? genl_rcv_msg+0x12f/0x160 [ 34.438466] ? mutex_trylock+0x1a0/0x1a0 [ 34.442505] ? __radix_tree_lookup+0x216/0x370 [ 34.447065] genl_rcv_msg+0xbf/0x160 [ 34.450756] netlink_rcv_skb+0x160/0x440 [ 34.454794] ? genl_family_rcv_msg+0xc40/0xc40 [ 34.459358] ? netlink_ack+0xae0/0xae0 [ 34.463222] ? genl_rcv+0x15/0x40 [ 34.466655] genl_rcv+0x24/0x40 [ 34.469916] netlink_unicast+0x4d5/0x690 [ 34.473959] ? netlink_sendskb+0x110/0x110 [ 34.478173] ? _copy_from_iter_full+0x229/0x7c0 [ 34.482821] ? __phys_addr_symbol+0x2c/0x70 [ 34.487234] ? __check_object_size+0x17b/0x3e0 [ 34.491793] netlink_sendmsg+0x6c3/0xc50 [ 34.495834] ? aa_af_perm+0x230/0x230 [ 34.499611] ? nlmsg_notify+0x1f0/0x1f0 [ 34.503563] ? kernel_recvmsg+0x220/0x220 [ 34.507689] ? nlmsg_notify+0x1f0/0x1f0 [ 34.511643] sock_sendmsg+0xc3/0x120 [ 34.515335] ___sys_sendmsg+0x7bb/0x8e0 [ 34.519285] ? copy_msghdr_from_user+0x440/0x440 [ 34.524020] ? apparmor_file_receive+0x160/0x160 [ 34.528754] ? __lockdep_init_map+0x100/0x5a0 [ 34.533662] ? check_preemption_disabled+0x41/0x280 [ 34.539068] ? mark_held_locks+0xf0/0xf0 [ 34.543116] ? percpu_counter_add_batch+0x126/0x180 [ 34.548119] ? alloc_empty_file+0xd7/0x170 [ 34.552334] ? errseq_sample+0x56/0x70 [ 34.556204] ? alloc_file+0x326/0x4d0 [ 34.559986] ? __fd_install+0x1b4/0x610 [ 34.563939] ? __fdget+0x1a0/0x230 [ 34.567461] __x64_sys_sendmsg+0x132/0x220 [ 34.571676] ? __sys_sendmsg+0x1b0/0x1b0 [ 34.575723] ? entry_SYSCALL_64_after_hwframe+0x3e/0xbe [ 34.581067] ? trace_hardirqs_off_caller+0x6e/0x210 [ 34.586063] ? do_syscall_64+0x21/0x620 [ 34.590038] do_syscall_64+0xf9/0x620 [ 34.593831] entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 34.599006] RIP: 0033:0x7f0c1440f959 [ 34.602703] 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 [ 34.621587] RSP: 002b:00007fff59f31f48 EFLAGS: 00000246 ORIG_RAX: 000000000000002e [ 34.629275] RAX: ffffffffffffffda RBX: 00000000000f4240 RCX: 00007f0c1440f959 [ 34.636536] RDX: 0000000000000000 RSI: 0000000020000200 RDI: 0000000000000004 [ 34.643783] RBP: 0000000000000000 R08: 0000000000000001 R09: 0000000000000001 [ 34.651034] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000008220 [ 34.658282] R13: 00007fff59f31f5c R14: 00007fff59f31f70 R15: 00007fff59f31f60 [ 34.665798] Kernel Offset: disabled [ 34.669416] Rebooting in 86400 seconds..