Debian GNU/Linux 9 syzkaller ttyS0 Warning: Permanently added '10.128.0.158' (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 syzkaller login: [ 29.053960] ================================================================== [ 29.061443] BUG: KASAN: use-after-free in ex_handler_refcount+0x164/0x1a0 [ 29.068353] Write of size 4 at addr ffff8880b30548d8 by task systemd-udevd/8107 [ 29.075776] [ 29.077387] CPU: 0 PID: 8107 Comm: systemd-udevd Not tainted 4.14.288-syzkaller #0 [ 29.085084] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/29/2022 [ 29.094415] Call Trace: [ 29.096982] dump_stack+0x1b2/0x281 [ 29.100606] print_address_description.cold+0x54/0x1d3 [ 29.105864] kasan_report_error.cold+0x8a/0x191 [ 29.110514] ? ex_handler_refcount+0x164/0x1a0 [ 29.115084] __asan_report_store4_noabort+0x68/0x70 [ 29.120090] ? ex_handler_refcount+0x164/0x1a0 [ 29.124652] ex_handler_refcount+0x164/0x1a0 [ 29.129045] ? ex_handler_clear_fs+0xb0/0xb0 [ 29.133445] fixup_exception+0x8a/0xd0 [ 29.137311] do_trap+0x61/0x250 [ 29.140568] ? do_error_trap+0x1d0/0x2d0 [ 29.144628] do_error_trap+0x132/0x2d0 [ 29.148495] ? math_error+0x2d0/0x2d0 [ 29.152270] ? flags_string.cold+0x1b38/0x6c27 [ 29.156833] ? __mutex_lock+0x360/0x1310 [ 29.160881] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 29.165701] invalid_op+0x1b/0x40 [ 29.169219] RIP: 0010:flags_string.cold+0x1b38/0x6c27 [ 29.174386] RSP: 0018:ffff8880b1affcd0 EFLAGS: 00010296 [ 29.179732] RAX: 0000000000000000 RBX: ffff8880b30548d8 RCX: ffff8880b30548d8 [ 29.186997] RDX: 0000000000000004 RSI: 0000000000000003 RDI: 0000000000000001 [ 29.194244] RBP: ffffffff89510660 R08: 0000000000000000 R09: 0000000000000002 [ 29.201507] R10: 0000000000000000 R11: ffff8880b11a05c0 R12: 0000000000000000 [ 29.208753] R13: ffff88808df2f704 R14: ffffed1011be5f2e R15: dffffc0000000000 [ 29.216013] nbd_release+0xf3/0x150 [ 29.219620] ? nbd_ioctl+0xac0/0xac0 [ 29.223311] __blkdev_put+0x5aa/0x800 [ 29.227099] ? revalidate_disk+0x1f0/0x1f0 [ 29.231324] ? locks_remove_file+0x2cd/0x420 [ 29.235720] ? blkdev_put+0x75/0x4c0 [ 29.239496] ? blkdev_put+0x4c0/0x4c0 [ 29.243272] blkdev_close+0x86/0xb0 [ 29.246876] __fput+0x25f/0x7a0 [ 29.250136] task_work_run+0x11f/0x190 [ 29.254010] exit_to_usermode_loop+0x1ad/0x200 [ 29.258674] do_syscall_64+0x4a3/0x640 [ 29.262546] entry_SYSCALL_64_after_hwframe+0x46/0xbb [ 29.267713] RIP: 0033:0x7fad8023b270 [ 29.271425] RSP: 002b:00007ffe6506d0a8 EFLAGS: 00000246 ORIG_RAX: 0000000000000003 [ 29.279111] RAX: 0000000000000000 RBX: 0000000000000007 RCX: 00007fad8023b270 [ 29.286360] RDX: 000000000aba9500 RSI: 0000000000000000 RDI: 0000000000000007 [ 29.293606] RBP: 00007fad810f5710 R08: 0000000000000045 R09: 0000000000000018 [ 29.300853] R10: 00005654738ee9e8 R11: 0000000000000246 R12: 0000000000000000 [ 29.308101] R13: 00005654738ef6e0 R14: 0000000000000003 R15: 000000000000000e [ 29.315441] [ 29.317098] Allocated by task 8081: [ 29.320705] kasan_kmalloc+0xeb/0x160 [ 29.324511] kmem_cache_alloc_trace+0x131/0x3d0 [ 29.329171] nbd_dev_add+0x7c/0x800 [ 29.332782] nbd_genl_connect+0x3a4/0x13e0 [ 29.336993] genl_family_rcv_msg+0x572/0xb20 [ 29.341379] genl_rcv_msg+0xaf/0x140 [ 29.345091] netlink_rcv_skb+0x125/0x390 [ 29.349135] genl_rcv+0x24/0x40 [ 29.352395] netlink_unicast+0x437/0x610 [ 29.356520] netlink_sendmsg+0x648/0xbc0 [ 29.360553] sock_sendmsg+0xb5/0x100 [ 29.364344] ___sys_sendmsg+0x6c8/0x800 [ 29.368293] __sys_sendmsg+0xa3/0x120 [ 29.372075] SyS_sendmsg+0x27/0x40 [ 29.375599] do_syscall_64+0x1d5/0x640 [ 29.379485] entry_SYSCALL_64_after_hwframe+0x46/0xbb [ 29.384647] [ 29.386261] Freed by task 8090: [ 29.389531] kasan_slab_free+0xc3/0x1a0 [ 29.393488] kfree+0xc9/0x250 [ 29.396570] nbd_put.part.0+0x100/0x140 [ 29.400522] nbd_genl_connect+0xcf6/0x13e0 [ 29.404734] genl_family_rcv_msg+0x572/0xb20 [ 29.409129] genl_rcv_msg+0xaf/0x140 [ 29.412828] netlink_rcv_skb+0x125/0x390 [ 29.416870] genl_rcv+0x24/0x40 [ 29.420156] netlink_unicast+0x437/0x610 [ 29.424386] netlink_sendmsg+0x648/0xbc0 [ 29.428421] sock_sendmsg+0xb5/0x100 [ 29.432111] ___sys_sendmsg+0x6c8/0x800 [ 29.436063] __sys_sendmsg+0xa3/0x120 [ 29.439845] SyS_sendmsg+0x27/0x40 [ 29.443381] do_syscall_64+0x1d5/0x640 [ 29.447246] entry_SYSCALL_64_after_hwframe+0x46/0xbb [ 29.452407] [ 29.454012] The buggy address belongs to the object at ffff8880b3054800 [ 29.454012] which belongs to the cache kmalloc-512 of size 512 [ 29.466639] The buggy address is located 216 bytes inside of [ 29.466639] 512-byte region [ffff8880b3054800, ffff8880b3054a00) [ 29.478486] The buggy address belongs to the page: [ 29.483396] page:ffffea0002cc1500 count:1 mapcount:0 mapping:ffff8880b3054080 index:0x0 [ 29.491518] flags: 0xfff00000000100(slab) [ 29.495640] raw: 00fff00000000100 ffff8880b3054080 0000000000000000 0000000100000006 [ 29.503494] raw: ffffea0002cdffa0 ffffea0002775ca0 ffff88813fe74940 0000000000000000 [ 29.511346] page dumped because: kasan: bad access detected [ 29.517040] [ 29.518644] Memory state around the buggy address: [ 29.523558] ffff8880b3054780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 29.530893] ffff8880b3054800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 29.538333] >ffff8880b3054880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 29.545722] ^ [ 29.551940] ffff8880b3054900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 29.559289] ffff8880b3054980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 29.567241] ================================================================== [ 29.574587] Disabling lock debugging due to kernel taint [ 29.583843] Kernel panic - not syncing: panic_on_warn set ... [ 29.583843] [ 29.591214] CPU: 0 PID: 8107 Comm: systemd-udevd Tainted: G B 4.14.288-syzkaller #0 executing program [ 29.600171] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/29/2022 [ 29.609514] Call Trace: [ 29.612088] dump_stack+0x1b2/0x281 [ 29.615857] panic+0x1f9/0x42d [ 29.619046] ? add_taint.cold+0x16/0x16 [ 29.623275] ? ___preempt_schedule+0x16/0x18 [ 29.627661] kasan_end_report+0x43/0x49 [ 29.631612] kasan_report_error.cold+0xa7/0x191 [ 29.636263] ? ex_handler_refcount+0x164/0x1a0 [ 29.640822] __asan_report_store4_noabort+0x68/0x70 [ 29.645813] ? ex_handler_refcount+0x164/0x1a0 [ 29.650459] ex_handler_refcount+0x164/0x1a0 [ 29.654845] ? ex_handler_clear_fs+0xb0/0xb0 [ 29.659233] fixup_exception+0x8a/0xd0 [ 29.663096] do_trap+0x61/0x250 [ 29.666361] ? do_error_trap+0x1d0/0x2d0 [ 29.670411] do_error_trap+0x132/0x2d0 [ 29.674281] ? math_error+0x2d0/0x2d0 [ 29.678057] ? flags_string.cold+0x1b38/0x6c27 [ 29.682611] ? __mutex_lock+0x360/0x1310 [ 29.686647] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 29.691462] invalid_op+0x1b/0x40 [ 29.694888] RIP: 0010:flags_string.cold+0x1b38/0x6c27 [ 29.700058] RSP: 0018:ffff8880b1affcd0 EFLAGS: 00010296 [ 29.705432] RAX: 0000000000000000 RBX: ffff8880b30548d8 RCX: ffff8880b30548d8 [ 29.712696] RDX: 0000000000000004 RSI: 0000000000000003 RDI: 0000000000000001 [ 29.719939] RBP: ffffffff89510660 R08: 0000000000000000 R09: 0000000000000002 [ 29.727273] R10: 0000000000000000 R11: ffff8880b11a05c0 R12: 0000000000000000 [ 29.734522] R13: ffff88808df2f704 R14: ffffed1011be5f2e R15: dffffc0000000000 [ 29.741779] nbd_release+0xf3/0x150 [ 29.745383] ? nbd_ioctl+0xac0/0xac0 [ 29.749072] __blkdev_put+0x5aa/0x800 [ 29.752858] ? revalidate_disk+0x1f0/0x1f0 [ 29.757072] ? locks_remove_file+0x2cd/0x420 [ 29.761462] ? blkdev_put+0x75/0x4c0 [ 29.765153] ? blkdev_put+0x4c0/0x4c0 [ 29.768932] blkdev_close+0x86/0xb0 [ 29.772534] __fput+0x25f/0x7a0 [ 29.775790] task_work_run+0x11f/0x190 [ 29.779673] exit_to_usermode_loop+0x1ad/0x200 [ 29.784232] do_syscall_64+0x4a3/0x640 [ 29.788111] entry_SYSCALL_64_after_hwframe+0x46/0xbb [ 29.793549] RIP: 0033:0x7fad8023b270 [ 29.797237] RSP: 002b:00007ffe6506d0a8 EFLAGS: 00000246 ORIG_RAX: 0000000000000003 [ 29.805096] RAX: 0000000000000000 RBX: 0000000000000007 RCX: 00007fad8023b270 [ 29.812530] RDX: 000000000aba9500 RSI: 0000000000000000 RDI: 0000000000000007 [ 29.819792] RBP: 00007fad810f5710 R08: 0000000000000045 R09: 0000000000000018 [ 29.827068] R10: 00005654738ee9e8 R11: 0000000000000246 R12: 0000000000000000 [ 29.834311] R13: 00005654738ef6e0 R14: 0000000000000003 R15: 000000000000000e [ 29.841715] Kernel Offset: disabled [ 29.845319] Rebooting in 86400 seconds..