netlink: 20 bytes leftover after parsing attributes in process `syz-executor169'. ================================================================== BUG: KASAN: slab-out-of-bounds in test_and_clear_bit include/asm-generic/bitops-instrumented.h:185 [inline] BUG: KASAN: slab-out-of-bounds in napi_hash_del net/core/dev.c:6228 [inline] BUG: KASAN: slab-out-of-bounds in netif_napi_del+0x2c/0x7a0 net/core/dev.c:6323 Write of size 8 at addr ffff8881e2b17f10 by task syz-executor169/319 CPU: 1 PID: 319 Comm: syz-executor169 Not tainted 5.4.190-syzkaller-00060-g148e4ba7f4fc #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/29/2022 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x18e/0x1d5 lib/dump_stack.c:118 print_address_description+0x8c/0x630 mm/kasan/report.c:384 __kasan_report+0xf6/0x130 mm/kasan/report.c:516 kasan_report+0x30/0x60 mm/kasan/common.c:653 check_memory_region_inline mm/kasan/generic.c:141 [inline] check_memory_region+0x298/0x2d0 mm/kasan/generic.c:191 test_and_clear_bit include/asm-generic/bitops-instrumented.h:185 [inline] napi_hash_del net/core/dev.c:6228 [inline] netif_napi_del+0x2c/0x7a0 net/core/dev.c:6323 free_netdev+0x188/0x310 net/core/dev.c:9697 netdev_run_todo+0xa79/0xc80 net/core/dev.c:9447 rtnl_unlock net/core/rtnetlink.c:112 [inline] rtnetlink_rcv_msg+0xa49/0xb90 net/core/rtnetlink.c:5263 netlink_rcv_skb+0x190/0x3a0 net/netlink/af_netlink.c:2500 netlink_unicast_kernel net/netlink/af_netlink.c:1312 [inline] netlink_unicast+0x771/0x8d0 net/netlink/af_netlink.c:1338 netlink_sendmsg+0x913/0xb90 net/netlink/af_netlink.c:1933 sock_sendmsg_nosec net/socket.c:638 [inline] sock_sendmsg net/socket.c:658 [inline] ____sys_sendmsg+0x4ee/0x7c0 net/socket.c:2287 ___sys_sendmsg net/socket.c:2341 [inline] __sys_sendmsg+0x235/0x2f0 net/socket.c:2387 do_syscall_64+0xcb/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x7fa821351a69 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 11 15 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 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fa821303308 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00007fa8213d9428 RCX: 00007fa821351a69 RDX: 0000000000000000 RSI: 0000000020000180 RDI: 0000000000000004 RBP: 00007fa8213d9420 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007fa8213d942c R13: 00007fa8213a7064 R14: 74656e2f7665642f R15: 0000000000022000 Allocated by task 299: save_stack mm/kasan/common.c:70 [inline] set_track mm/kasan/common.c:78 [inline] __kasan_kmalloc+0x131/0x1e0 mm/kasan/common.c:529 slab_post_alloc_hook mm/slab.h:584 [inline] slab_alloc_node mm/slub.c:2829 [inline] slab_alloc mm/slub.c:2837 [inline] __kmalloc_track_caller+0xfb/0x280 mm/slub.c:4449 __kmalloc_reserve net/core/skbuff.c:142 [inline] __alloc_skb+0xb5/0x4d0 net/core/skbuff.c:210 alloc_skb_fclone include/linux/skbuff.h:1110 [inline] sk_stream_alloc_skb+0x1ee/0xa80 net/ipv4/tcp.c:887 tcp_sendmsg_locked+0xcc7/0x36d0 net/ipv4/tcp.c:1295 tcp_sendmsg+0x2c/0x40 net/ipv4/tcp.c:1445 sock_sendmsg_nosec net/socket.c:638 [inline] sock_sendmsg net/socket.c:658 [inline] sock_write_iter+0x284/0x380 net/socket.c:990 call_write_iter include/linux/fs.h:1976 [inline] new_sync_write fs/read_write.c:483 [inline] __vfs_write+0x4f9/0x6a0 fs/read_write.c:496 vfs_write+0x210/0x4f0 fs/read_write.c:558 ksys_write+0x158/0x260 fs/read_write.c:611 do_syscall_64+0xcb/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Freed by task 299: save_stack mm/kasan/common.c:70 [inline] set_track mm/kasan/common.c:78 [inline] kasan_set_free_info mm/kasan/common.c:345 [inline] __kasan_slab_free+0x178/0x240 mm/kasan/common.c:487 slab_free_hook mm/slub.c:1455 [inline] slab_free_freelist_hook+0x80/0x150 mm/slub.c:1494 slab_free mm/slub.c:3080 [inline] kfree+0xc6/0x260 mm/slub.c:4071 skb_release_all net/core/skbuff.c:675 [inline] __kfree_skb+0x55/0x170 net/core/skbuff.c:689 tcp_rtx_queue_unlink_and_free include/net/tcp.h:1834 [inline] tcp_clean_rtx_queue net/ipv4/tcp_input.c:3174 [inline] tcp_ack+0x2098/0x6140 net/ipv4/tcp_input.c:3713 tcp_rcv_established+0xba0/0x17e0 net/ipv4/tcp_input.c:5659 tcp_v4_do_rcv+0x39e/0x760 net/ipv4/tcp_ipv4.c:1584 sk_backlog_rcv include/net/sock.h:982 [inline] __release_sock+0x165/0x3f0 net/core/sock.c:2454 release_sock+0x5d/0x1a0 net/core/sock.c:2993 tcp_sendmsg+0x36/0x40 net/ipv4/tcp.c:1446 sock_sendmsg_nosec net/socket.c:638 [inline] sock_sendmsg net/socket.c:658 [inline] sock_write_iter+0x284/0x380 net/socket.c:990 call_write_iter include/linux/fs.h:1976 [inline] new_sync_write fs/read_write.c:483 [inline] __vfs_write+0x4f9/0x6a0 fs/read_write.c:496 vfs_write+0x210/0x4f0 fs/read_write.c:558 ksys_write+0x158/0x260 fs/read_write.c:611 do_syscall_64+0xcb/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x44/0xa9 The buggy address belongs to the object at ffff8881e2b17800 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 784 bytes to the right of 1024-byte region [ffff8881e2b17800, ffff8881e2b17c00) The buggy address belongs to the page: page:ffffea00078ac400 refcount:1 mapcount:0 mapping:ffff8881f5c02280 index:0x0 compound_mapcount: 0 flags: 0x8000000000010200(slab|head) raw: 8000000000010200 dead000000000100 dead000000000122 ffff8881f5c02280 raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC) set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook mm/page_alloc.c:2165 [inline] prep_new_page+0x194/0x380 mm/page_alloc.c:2171 get_page_from_freelist+0x524/0x560 mm/page_alloc.c:3794 __alloc_pages_nodemask+0x2ab/0x6f0 mm/page_alloc.c:4857 alloc_slab_page+0x39/0x3e0 mm/slub.c:343 allocate_slab mm/slub.c:1683 [inline] new_slab+0x97/0x450 mm/slub.c:1749 new_slab_objects mm/slub.c:2506 [inline] ___slab_alloc+0x320/0x4b0 mm/slub.c:2667 __slab_alloc+0x5a/0x90 mm/slub.c:2707 slab_alloc_node mm/slub.c:2792 [inline] slab_alloc mm/slub.c:2837 [inline] __kmalloc_track_caller+0x168/0x280 mm/slub.c:4449 __kmalloc_reserve net/core/skbuff.c:142 [inline] __alloc_skb+0xb5/0x4d0 net/core/skbuff.c:210 alloc_skb_fclone include/linux/skbuff.h:1110 [inline] sk_stream_alloc_skb+0x1ee/0xa80 net/ipv4/tcp.c:887 tcp_sendmsg_locked+0xcc7/0x36d0 net/ipv4/tcp.c:1295 tcp_sendmsg+0x2c/0x40 net/ipv4/tcp.c:1445 sock_sendmsg_nosec net/socket.c:638 [inline] sock_sendmsg net/socket.c:658 [inline] sock_write_iter+0x284/0x380 net/socket.c:990 call_write_iter include/linux/fs.h:1976 [inline] new_sync_write fs/read_write.c:483 [inline] __vfs_write+0x4f9/0x6a0 fs/read_write.c:496 vfs_write+0x210/0x4f0 fs/read_write.c:558 ksys_write+0x158/0x260 fs/read_write.c:611 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1176 [inline] __free_pages_ok+0x7ee/0x920 mm/page_alloc.c:1438 put_page include/linux/mm.h:1150 [inline] page_to_skb+0x62e/0x910 drivers/net/virtio_net.c:433 receive_mergeable+0x73e/0x2300 drivers/net/virtio_net.c:977 receive_buf+0x104/0x1940 drivers/net/virtio_net.c:1087 virtnet_receive drivers/net/virtio_net.c:1379 [inline] virtnet_poll+0x554/0x10b0 drivers/net/virtio_net.c:1484 napi_poll+0x195/0x670 net/core/dev.c:6352 net_rx_action+0x2dd/0x890 net/core/dev.c:6420 __do_softirq+0x23e/0x643 kernel/softirq.c:292 invoke_softirq kernel/softirq.c:373 [inline] irq_exit+0x195/0x1c0 kernel/softirq.c:413 exiting_irq arch/x86/include/asm/apic.h:538 [inline] do_IRQ+0xc4/0x1b0 arch/x86/kernel/irq.c:263 ret_from_intr+0x0/0x14 native_restore_fl arch/x86/include/asm/irqflags.h:41 [inline] arch_local_irq_restore arch/x86/include/asm/irqflags.h:84 [inline] rcu_idle_exit+0x3c4/0x450 kernel/rcu/tree.c:776 cpuidle_idle_call kernel/sched/idle.c:217 [inline] do_idle+0x45d/0x590 kernel/sched/idle.c:264 cpu_startup_entry+0x15/0x20 kernel/sched/idle.c:356 start_secondary+0x312/0x390 arch/x86/kernel/smpboot.c:264 secondary_startup_64+0xa4/0xb0 arch/x86/kernel/head_64.S:241 Memory state around the buggy address: ffff8881e2b17e00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8881e2b17e80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8881e2b17f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff8881e2b17f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8881e2b18000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ================================================================== kasan: CONFIG_KASAN_INLINE enabled kasan: GPF could be caused by NULL-ptr deref or user memory access general protection fault: 0000 [#1] PREEMPT SMP KASAN CPU: 1 PID: 319 Comm: syz-executor169 Tainted: G B 5.4.190-syzkaller-00060-g148e4ba7f4fc #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/29/2022 RIP: 0010:flush_gro_hash net/core/dev.c:6313 [inline] RIP: 0010:netif_napi_del+0x28f/0x7a0 net/core/dev.c:6328 Code: 00 74 08 4c 89 ff e8 10 3f 32 fe 49 8b 2f 49 39 ef 75 10 e8 43 d2 05 fe eb 35 90 e8 3b d2 05 fe 48 89 dd 48 89 e8 48 c1 e8 03 <42> 80 3c 28 00 74 08 48 89 ef e8 e2 3e 32 fe 48 8b 5d 00 48 89 ef RSP: 0018:ffff8881dd147790 EFLAGS: 00010246 RAX: 0000000000000000 RBX: 1ffff1103c562fff RCX: ffffffff835a7b10 RDX: 0000000000000000 RSI: 0000000000000008 RDI: ffff8881e2b17f38 RBP: 0000000000000000 R08: ffffffff835a78e3 R09: fffffbfff0d3170d R10: fffffbfff0d3170d R11: 1ffffffff0d3170c R12: ffff8881e2b17f00 R13: dffffc0000000000 R14: ffff8881e2b17f00 R15: ffff8881e2b17f38 FS: 00007fa821303700(0000) GS:ffff8881f6f00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007fa821392c10 CR3: 00000001dd008000 CR4: 00000000003406e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: free_netdev+0x188/0x310 net/core/dev.c:9697 netdev_run_todo+0xa79/0xc80 net/core/dev.c:9447 rtnl_unlock net/core/rtnetlink.c:112 [inline] rtnetlink_rcv_msg+0xa49/0xb90 net/core/rtnetlink.c:5263 netlink_rcv_skb+0x190/0x3a0 net/netlink/af_netlink.c:2500 netlink_unicast_kernel net/netlink/af_netlink.c:1312 [inline] netlink_unicast+0x771/0x8d0 net/netlink/af_netlink.c:1338 netlink_sendmsg+0x913/0xb90 net/netlink/af_netlink.c:1933 sock_sendmsg_nosec net/socket.c:638 [inline] sock_sendmsg net/socket.c:658 [inline] ____sys_sendmsg+0x4ee/0x7c0 net/socket.c:2287 ___sys_sendmsg net/socket.c:2341 [inline] __sys_sendmsg+0x235/0x2f0 net/socket.c:2387 do_syscall_64+0xcb/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x7fa821351a69 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 11 15 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 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fa821303308 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00007fa8213d9428 RCX: 00007fa821351a69 RDX: 0000000000000000 RSI: 0000000020000180 RDI: 0000000000000004 RBP: 00007fa8213d9420 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007fa8213d942c R13: 00007fa8213a7064 R14: 74656e2f7665642f R15: 0000000000022000 Modules linked in: ---[ end trace dc9f4416afdd0f49 ]--- RIP: 0010:flush_gro_hash net/core/dev.c:6313 [inline] RIP: 0010:netif_napi_del+0x28f/0x7a0 net/core/dev.c:6328 Code: 00 74 08 4c 89 ff e8 10 3f 32 fe 49 8b 2f 49 39 ef 75 10 e8 43 d2 05 fe eb 35 90 e8 3b d2 05 fe 48 89 dd 48 89 e8 48 c1 e8 03 <42> 80 3c 28 00 74 08 48 89 ef e8 e2 3e 32 fe 48 8b 5d 00 48 89 ef RSP: 0018:ffff8881dd147790 EFLAGS: 00010246 RAX: 0000000000000000 RBX: 1ffff1103c562fff RCX: ffffffff835a7b10 RDX: 0000000000000000 RSI: 0000000000000008 RDI: ffff8881e2b17f38 RBP: 0000000000000000 R08: ffffffff835a78e3 R09: fffffbfff0d3170d R10: fffffbfff0d3170d R11: 1ffffffff0d3170c R12: ffff8881e2b17f00 R13: dffffc0000000000 R14: ffff8881e2b17f00 R15: ffff8881e2b17f38 FS: 00007fa821303700(0000) GS:ffff8881f6f00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007fa821392c10 CR3: 00000001dd008000 CR4: 00000000003406e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 ---------------- Code disassembly (best guess): 0: 00 74 08 4c add %dh,0x4c(%rax,%rcx,1) 4: 89 ff mov %edi,%edi 6: e8 10 3f 32 fe callq 0xfe323f1b b: 49 8b 2f mov (%r15),%rbp e: 49 39 ef cmp %rbp,%r15 11: 75 10 jne 0x23 13: e8 43 d2 05 fe callq 0xfe05d25b 18: eb 35 jmp 0x4f 1a: 90 nop 1b: e8 3b d2 05 fe callq 0xfe05d25b 20: 48 89 dd mov %rbx,%rbp 23: 48 89 e8 mov %rbp,%rax 26: 48 c1 e8 03 shr $0x3,%rax * 2a: 42 80 3c 28 00 cmpb $0x0,(%rax,%r13,1) <-- trapping instruction 2f: 74 08 je 0x39 31: 48 89 ef mov %rbp,%rdi 34: e8 e2 3e 32 fe callq 0xfe323f1b 39: 48 8b 5d 00 mov 0x0(%rbp),%rbx 3d: 48 89 ef mov %rbp,%rdi