================================================================== BUG: KASAN: use-after-free in ex_handler_refcount+0x135/0x170 arch/x86/mm/extable.c:57 Write of size 4 at addr ffff8880b4795908 by task systemd-udevd/11114 CPU: 1 PID: 11114 Comm: systemd-udevd Not tainted 5.4.0-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x96/0xe0 lib/dump_stack.c:118 print_address_description.constprop.4.cold.6+0x9/0x373 mm/kasan/report.c:374 __kasan_report.cold.7+0x7a/0x95 mm/kasan/report.c:506 kasan_report+0xe/0x20 mm/kasan/common.c:634 ex_handler_refcount+0x135/0x170 arch/x86/mm/extable.c:57 fixup_exception+0x8b/0xc6 arch/x86/mm/extable.c:227 do_trap_no_signal arch/x86/kernel/traps.c:207 [inline] do_trap+0x6a/0x250 arch/x86/kernel/traps.c:251 do_invalid_op+0x31/0x40 arch/x86/kernel/traps.c:291 invalid_op+0x23/0x30 arch/x86/entry/entry_64.S:1028 RIP: 0010:csum_partial_copy_generic+0x2e2c/0x9370 Code: 4c 24 08 0f 0b 48 8d 8f 28 01 00 00 0f 0b 48 8d 4f 08 0f 0b 48 8d 8b 08 02 00 00 0f 0b 48 8d 0b 0f 0b 48 8d 0b 0f 0b 48 8d 0b <0f> 0b 49 8d 8f 50 13 00 00 0f 0b 48 8d 4d 00 0f 0b 48 8d 0f 0f 0b RSP: 0018:ffff8880b4167d00 EFLAGS: 00010296 RAX: 0000000000000000 RBX: ffff8880b4795908 RCX: ffff8880b4795908 RDX: ffffed101682cf76 RSI: 0000000000000004 RDI: ffffffff8e23b220 RBP: 0000000000000000 R08: fffffbfff15ccc52 R09: fffffbfff15ccc52 R10: ffff8880b4167d00 R11: ffffffff8ae6628b R12: ffffffff8ae66280 R13: ffff888096aa0018 R14: ffff888096aa0000 R15: dffffc0000000000 nbd_put+0x1a/0x1c0 drivers/block/nbd.c:248 __blkdev_put+0x487/0x5e0 fs/block_dev.c:1867 blkdev_close+0x84/0xc0 fs/block_dev.c:1936 __fput+0x256/0x790 fs/file_table.c:280 task_work_run+0xd3/0x180 kernel/task_work.c:113 tracehook_notify_resume include/linux/tracehook.h:188 [inline] exit_to_usermode_loop+0x15d/0x200 arch/x86/entry/common.c:163 prepare_exit_to_usermode arch/x86/entry/common.c:194 [inline] syscall_return_slowpath arch/x86/entry/common.c:274 [inline] do_syscall_64+0x42f/0x4e0 arch/x86/entry/common.c:300 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x7f4b11c4f270 Code: 73 01 c3 48 8b 0d 38 7d 20 00 f7 d8 64 89 01 48 83 c8 ff c3 66 0f 1f 44 00 00 83 3d 59 c1 20 00 00 75 10 b8 03 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 31 c3 48 83 ec 08 e8 ee fb ff ff 48 89 04 24 RSP: 002b:00007ffe0a942c38 EFLAGS: 00000246 ORIG_RAX: 0000000000000003 RAX: 0000000000000000 RBX: 0000000000000007 RCX: 00007f4b11c4f270 RDX: 000000000aba9500 RSI: 0000000000000000 RDI: 0000000000000007 RBP: 00007f4b12b09710 R08: 0000000000000045 R09: 0000000000000018 R10: 0000555e95bb1928 R11: 0000000000000246 R12: 0000000000000000 R13: 0000555e95baeac0 R14: 0000000000000003 R15: 000000000000000e Allocated by task 11091: save_stack+0x19/0x80 mm/kasan/common.c:69 set_track mm/kasan/common.c:77 [inline] __kasan_kmalloc mm/kasan/common.c:510 [inline] __kasan_kmalloc.constprop.11+0xc1/0xd0 mm/kasan/common.c:483 kmalloc include/linux/slab.h:556 [inline] kzalloc include/linux/slab.h:690 [inline] nbd_dev_add+0x47/0x820 drivers/block/nbd.c:1654 nbd_genl_connect+0x4c5/0x122d drivers/block/nbd.c:1826 genl_family_rcv_msg+0x5ff/0xf40 net/netlink/genetlink.c:629 genl_rcv_msg+0xb3/0x160 net/netlink/genetlink.c:654 netlink_rcv_skb+0x119/0x340 net/netlink/af_netlink.c:2477 genl_rcv+0x1f/0x30 net/netlink/genetlink.c:665 netlink_unicast_kernel net/netlink/af_netlink.c:1302 [inline] netlink_unicast+0x3fc/0x5c0 net/netlink/af_netlink.c:1328 netlink_sendmsg+0x71e/0xb70 net/netlink/af_netlink.c:1917 sock_sendmsg_nosec net/socket.c:637 [inline] sock_sendmsg+0xac/0xf0 net/socket.c:657 ___sys_sendmsg+0x653/0x950 net/socket.c:2311 __sys_sendmsg+0xce/0x170 net/socket.c:2356 do_syscall_64+0x8e/0x4e0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 11095: save_stack+0x19/0x80 mm/kasan/common.c:69 set_track mm/kasan/common.c:77 [inline] kasan_set_free_info mm/kasan/common.c:332 [inline] __kasan_slab_free+0x124/0x170 mm/kasan/common.c:471 slab_free_hook mm/slub.c:1424 [inline] slab_free_freelist_hook+0x53/0x140 mm/slub.c:1457 slab_free mm/slub.c:3004 [inline] kfree+0xd6/0x3b0 mm/slub.c:3956 nbd_dev_remove drivers/block/nbd.c:243 [inline] nbd_put drivers/block/nbd.c:251 [inline] nbd_put+0x16f/0x1c0 drivers/block/nbd.c:246 nbd_genl_connect+0xdc3/0x122d drivers/block/nbd.c:1968 genl_family_rcv_msg+0x5ff/0xf40 net/netlink/genetlink.c:629 genl_rcv_msg+0xb3/0x160 net/netlink/genetlink.c:654 netlink_rcv_skb+0x119/0x340 net/netlink/af_netlink.c:2477 genl_rcv+0x1f/0x30 net/netlink/genetlink.c:665 netlink_unicast_kernel net/netlink/af_netlink.c:1302 [inline] netlink_unicast+0x3fc/0x5c0 net/netlink/af_netlink.c:1328 netlink_sendmsg+0x71e/0xb70 net/netlink/af_netlink.c:1917 sock_sendmsg_nosec net/socket.c:637 [inline] sock_sendmsg+0xac/0xf0 net/socket.c:657 ___sys_sendmsg+0x653/0x950 net/socket.c:2311 __sys_sendmsg+0xce/0x170 net/socket.c:2356 do_syscall_64+0x8e/0x4e0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff8880b4795800 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 264 bytes inside of 512-byte region [ffff8880b4795800, ffff8880b4795a00) The buggy address belongs to the page: page:ffffea0002d1e500 refcount:1 mapcount:0 mapping:ffff8880b5802500 index:0x0 compound_mapcount: 0 raw: 00fff00000010200 0000000000000000 0000000100000001 ffff8880b5802500 raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880b4795800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880b4795880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8880b4795900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880b4795980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880b4795a00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================