netlink: 20 bytes leftover after parsing attributes in process `syz-executor.0'. ================================================================== 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 ffff8881a5133f10 by task syz-executor.0/19396 CPU: 0 PID: 19396 Comm: syz-executor.0 Not tainted 5.4.190-syzkaller-00008-g330fa791a029 #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:0x7fcbb66581f9 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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:00007fcbb57ce168 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00007fcbb676af60 RCX: 00007fcbb66581f9 RDX: 0000000000000000 RSI: 0000000020000180 RDI: 0000000000000005 RBP: 00007fcbb66b2161 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffeb14408ef R14: 00007fcbb57ce300 R15: 0000000000022000 Allocated by task 17846: 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] kmem_cache_alloc+0xd0/0x210 mm/slub.c:2842 kmem_cache_alloc_node include/linux/slab.h:427 [inline] __alloc_skb+0x78/0x4d0 net/core/skbuff.c:198 alloc_skb_fclone include/linux/skbuff.h:1110 [inline] tipc_buf_acquire net/tipc/msg.c:66 [inline] tipc_msg_build+0xea/0xfc0 net/tipc/msg.c:332 tipc_send_group_bcast+0x915/0xc20 net/tipc/socket.c:1073 __tipc_sendmsg+0x262e/0x34c0 net/tipc/socket.c:1339 tipc_sendmsg+0x51/0x70 net/tipc/socket.c:1304 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_sendmmsg+0x32b/0x640 net/socket.c:2444 __do_sys_sendmmsg net/socket.c:2473 [inline] __se_sys_sendmmsg net/socket.c:2470 [inline] __x64_sys_sendmmsg+0x9c/0xb0 net/socket.c:2470 do_syscall_64+0xcb/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Freed by task 17846: 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] kmem_cache_free+0xa9/0x1d0 mm/slub.c:3096 __skb_queue_purge include/linux/skbuff.h:2782 [inline] tipc_mcast_xmit+0x150a/0x1b50 net/tipc/bcast.c:421 tipc_send_group_bcast+0x947/0xc20 net/tipc/socket.c:1078 __tipc_sendmsg+0x262e/0x34c0 net/tipc/socket.c:1339 tipc_sendmsg+0x51/0x70 net/tipc/socket.c:1304 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_sendmmsg+0x32b/0x640 net/socket.c:2444 __do_sys_sendmmsg net/socket.c:2473 [inline] __se_sys_sendmmsg net/socket.c:2470 [inline] __x64_sys_sendmmsg+0x9c/0xb0 net/socket.c:2470 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 ffff8881a5133b80 which belongs to the cache skbuff_fclone_cache of size 488 The buggy address is located 424 bytes to the right of 488-byte region [ffff8881a5133b80, ffff8881a5133d68) The buggy address belongs to the page: page:ffffea0006944c80 refcount:1 mapcount:0 mapping:ffff8881f1ddf400 index:0x0 compound_mapcount: 0 flags: 0x8000000000010200(slab|head) raw: 8000000000010200 ffffea0006b07b80 0000000200000002 ffff8881f1ddf400 raw: 0000000000000000 00000000000c000c 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 1, migratetype Unmovable, gfp_mask 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL) 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] kmem_cache_alloc+0x100/0x210 mm/slub.c:2842 kmem_cache_alloc_node include/linux/slab.h:427 [inline] __alloc_skb+0x78/0x4d0 net/core/skbuff.c:198 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_pcp_prepare+0x1a4/0x290 mm/page_alloc.c:1233 free_unref_page_prepare mm/page_alloc.c:3085 [inline] free_unref_page_list+0xc0/0x610 mm/page_alloc.c:3154 release_pages+0xa23/0xa50 mm/swap.c:842 tlb_batch_pages_flush mm/mmu_gather.c:49 [inline] tlb_flush_mmu_free mm/mmu_gather.c:184 [inline] tlb_flush_mmu+0x77f/0x910 mm/mmu_gather.c:191 tlb_finish_mmu+0xcb/0x200 mm/mmu_gather.c:272 exit_mmap+0x2a6/0x4f0 mm/mmap.c:3176 __mmput+0x34/0x240 kernel/fork.c:1090 exit_mm kernel/exit.c:489 [inline] do_exit+0xb40/0x2b40 kernel/exit.c:799 do_group_exit+0x136/0x300 kernel/exit.c:910 get_signal+0xd99/0x13f0 kernel/signal.c:2735 do_signal+0x3b/0x540 arch/x86/kernel/signal.c:809 exit_to_usermode_loop+0xdd/0x1d0 arch/x86/entry/common.c:159 prepare_exit_to_usermode+0x17c/0x1d0 arch/x86/entry/common.c:194 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Memory state around the buggy address: ffff8881a5133e00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8881a5133e80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8881a5133f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff8881a5133f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8881a5134000: 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: 19396 Comm: syz-executor.0 Tainted: G B 5.4.190-syzkaller-00008-g330fa791a029 #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 70 34 32 fe 49 8b 2f 49 39 ef 75 10 e8 a3 c7 05 fe eb 35 90 e8 9b c7 05 fe 48 89 dd 48 89 e8 48 c1 e8 03 <42> 80 3c 28 00 74 08 48 89 ef e8 42 34 32 fe 48 8b 5d 00 48 89 ef RSP: 0018:ffff8881b195f790 EFLAGS: 00010246 RAX: 0000000000000000 RBX: 1ffff11034a267ff RCX: ffffffff835a85b0 RDX: 0000000000000000 RSI: 0000000000000008 RDI: ffff8881a5133f38 RBP: 0000000000000000 R08: ffffffff835a8383 R09: fffffbfff0d3170d R10: fffffbfff0d3170d R11: 1ffffffff0d3170c R12: ffff8881a5133f00 R13: dffffc0000000000 R14: ffff8881a5133f00 R15: ffff8881a5133f38 FS: 00007fcbb57ce700(0000) GS:ffff8881f6f00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007fc062b74218 CR3: 00000001ef63e000 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:0x7fcbb66581f9 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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:00007fcbb57ce168 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00007fcbb676af60 RCX: 00007fcbb66581f9 RDX: 0000000000000000 RSI: 0000000020000180 RDI: 0000000000000005 RBP: 00007fcbb66b2161 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffeb14408ef R14: 00007fcbb57ce300 R15: 0000000000022000 Modules linked in: ---[ end trace c7d17297e3f63d40 ]--- 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 70 34 32 fe 49 8b 2f 49 39 ef 75 10 e8 a3 c7 05 fe eb 35 90 e8 9b c7 05 fe 48 89 dd 48 89 e8 48 c1 e8 03 <42> 80 3c 28 00 74 08 48 89 ef e8 42 34 32 fe 48 8b 5d 00 48 89 ef RSP: 0018:ffff8881b195f790 EFLAGS: 00010246 RAX: 0000000000000000 RBX: 1ffff11034a267ff RCX: ffffffff835a85b0 RDX: 0000000000000000 RSI: 0000000000000008 RDI: ffff8881a5133f38 RBP: 0000000000000000 R08: ffffffff835a8383 R09: fffffbfff0d3170d R10: fffffbfff0d3170d R11: 1ffffffff0d3170c R12: ffff8881a5133f00 R13: dffffc0000000000 R14: ffff8881a5133f00 R15: ffff8881a5133f38 FS: 00007fcbb57ce700(0000) GS:ffff8881f6f00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007fc062b74218 CR3: 00000001ef63e000 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 70 34 32 fe callq 0xfe32347b b: 49 8b 2f mov (%r15),%rbp e: 49 39 ef cmp %rbp,%r15 11: 75 10 jne 0x23 13: e8 a3 c7 05 fe callq 0xfe05c7bb 18: eb 35 jmp 0x4f 1a: 90 nop 1b: e8 9b c7 05 fe callq 0xfe05c7bb 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 42 34 32 fe callq 0xfe32347b 39: 48 8b 5d 00 mov 0x0(%rbp),%rbx 3d: 48 89 ef mov %rbp,%rdi