attempt to access beyond end of device loop2: rw=1, want=186, limit=16 loop0: rw=2049, want=41, limit=16 ================================================================== loop4: rw=2049, want=98, limit=16 BUG: KASAN: use-after-free in __read_once_size include/linux/compiler.h:263 [inline] BUG: KASAN: use-after-free in dev_queue_xmit_nit+0x87e/0xa20 net/core/dev.c:2004 Read of size 8 at addr ffff888097f9b330 by task syz-executor.1/12026 CPU: 1 PID: 12026 Comm: syz-executor.1 Not tainted 4.19.211-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/22/2022 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1fc/0x2ef lib/dump_stack.c:118 print_address_description.cold+0x54/0x219 mm/kasan/report.c:256 kasan_report_error.cold+0x8a/0x1b9 mm/kasan/report.c:354 kasan_report mm/kasan/report.c:412 [inline] __asan_report_load8_noabort+0x88/0x90 mm/kasan/report.c:433 __read_once_size include/linux/compiler.h:263 [inline] dev_queue_xmit_nit+0x87e/0xa20 net/core/dev.c:2004 xmit_one net/core/dev.c:3252 [inline] dev_hard_start_xmit+0xaa/0x920 net/core/dev.c:3272 sch_direct_xmit+0x2d6/0xf70 net/sched/sch_generic.c:332 attempt to access beyond end of device qdisc_restart net/sched/sch_generic.c:395 [inline] __qdisc_run+0x4d0/0x1640 net/sched/sch_generic.c:403 attempt to access beyond end of device qdisc_run include/net/pkt_sched.h:120 [inline] __dev_xmit_skb net/core/dev.c:3451 [inline] __dev_queue_xmit+0x2102/0x2e00 net/core/dev.c:3807 loop2: rw=1, want=187, limit=16 attempt to access beyond end of device neigh_hh_output include/net/neighbour.h:491 [inline] neigh_output include/net/neighbour.h:499 [inline] ip_finish_output2+0xb6d/0x15a0 net/ipv4/ip_output.c:230 ip_finish_output+0xae9/0x10b0 net/ipv4/ip_output.c:318 NF_HOOK_COND include/linux/netfilter.h:278 [inline] ip_output+0x203/0x5f0 net/ipv4/ip_output.c:406 loop0: rw=2049, want=42, limit=16 dst_output include/net/dst.h:455 [inline] ip_local_out+0xaf/0x170 net/ipv4/ip_output.c:125 __ip_queue_xmit+0x91e/0x1c10 net/ipv4/ip_output.c:507 attempt to access beyond end of device __tcp_transmit_skb+0x1b9c/0x3400 net/ipv4/tcp_output.c:1148 loop2: rw=1, want=188, limit=16 __tcp_send_ack.part.0+0x3d9/0x5c0 net/ipv4/tcp_output.c:3643 __tcp_send_ack net/ipv4/tcp_output.c:3649 [inline] tcp_send_ack+0x7d/0xa0 net/ipv4/tcp_output.c:3649 __tcp_ack_snd_check+0x152/0x890 net/ipv4/tcp_input.c:5213 attempt to access beyond end of device tcp_rcv_established+0x18f9/0x1ef0 net/ipv4/tcp_input.c:5646 tcp_v4_do_rcv+0x5d6/0x870 net/ipv4/tcp_ipv4.c:1547 tcp_v4_rcv+0x2c03/0x3b80 net/ipv4/tcp_ipv4.c:1832 loop4: rw=2049, want=99, limit=16 ip_local_deliver_finish+0x495/0xc00 net/ipv4/ip_input.c:215 loop0: rw=2049, want=43, limit=16 NF_HOOK include/linux/netfilter.h:289 [inline] ip_local_deliver+0x188/0x500 net/ipv4/ip_input.c:256 dst_input include/net/dst.h:461 [inline] ip_rcv_finish+0x1ca/0x2e0 net/ipv4/ip_input.c:414 NF_HOOK include/linux/netfilter.h:289 [inline] ip_rcv+0xca/0x3c0 net/ipv4/ip_input.c:524 attempt to access beyond end of device __netif_receive_skb_one_core+0x114/0x180 net/core/dev.c:4954 attempt to access beyond end of device __netif_receive_skb+0x27/0x1c0 net/core/dev.c:5066 netif_receive_skb_internal+0xf0/0x3f0 net/core/dev.c:5156 napi_skb_finish net/core/dev.c:5601 [inline] napi_gro_receive+0x2e6/0x450 net/core/dev.c:5632 receive_buf+0xc2c/0x6780 drivers/net/virtio_net.c:1088 loop2: rw=1, want=189, limit=16 loop4: rw=2049, want=100, limit=16 attempt to access beyond end of device virtnet_receive drivers/net/virtio_net.c:1352 [inline] virtnet_poll+0x568/0xe00 drivers/net/virtio_net.c:1457 attempt to access beyond end of device napi_poll net/core/dev.c:6280 [inline] net_rx_action+0x4ac/0xfb0 net/core/dev.c:6346 __do_softirq+0x265/0x980 kernel/softirq.c:292 invoke_softirq kernel/softirq.c:372 [inline] irq_exit+0x215/0x260 kernel/softirq.c:412 exiting_irq arch/x86/include/asm/apic.h:536 [inline] do_IRQ+0x10c/0x1c0 arch/x86/kernel/irq.c:258 common_interrupt+0xf/0xf arch/x86/entry/entry_64.S:670 RIP: 0010:__raw_spin_unlock_irq include/linux/spinlock_api_smp.h:169 [inline] RIP: 0010:_raw_spin_unlock_irq+0x50/0x80 kernel/locking/spinlock.c:192 Code: c0 98 82 f1 89 48 ba 00 00 00 00 00 fc ff df 48 c1 e8 03 80 3c 10 00 75 31 48 83 3d 01 31 d8 01 00 74 25 fb 66 0f 1f 44 00 00 01 00 00 00 e8 26 1b 28 f9 65 8b 05 9f 8d e8 77 85 c0 74 02 5d RSP: 0018:ffff8880547c73e0 EFLAGS: 00000286 ORIG_RAX: ffffffffffffffd5 RAX: 1ffffffff13e3053 RBX: ffff88809fc80040 RCX: 1ffff11013f90122 RDX: dffffc0000000000 RSI: ffff88809fc80918 RDI: ffff88809fc808c4 RBP: ffff8880ba12b0c0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: ffff8880ba12b0c0 R13: ffff8880ab8ce5c0 R14: 0000000000000000 R15: 0000000000000001 finish_lock_switch kernel/sched/core.c:2578 [inline] finish_task_switch+0x146/0x760 kernel/sched/core.c:2678 context_switch kernel/sched/core.c:2831 [inline] __schedule+0x88f/0x2040 kernel/sched/core.c:3517 preempt_schedule_irq+0xb0/0x140 kernel/sched/core.c:3744 retint_kernel+0x1b/0x2d loop4: rw=2049, want=101, limit=16 RIP: 0010:__rcu_read_unlock+0x150/0x160 kernel/rcu/tree_plugin.h:428 Code: 89 ef e8 93 f7 46 00 e9 3f ff ff ff 48 89 ef e8 56 fa 46 00 e9 67 ff ff ff e8 7c f7 46 00 eb 97 48 89 ef e8 42 fa 46 00 eb b4 <48> 89 df e8 e8 ee ff ff eb 8d 66 0f 1f 44 00 00 41 57 48 8d b7 c8 RSP: 0018:ffff8880547c75f0 EFLAGS: 00000202 ORIG_RAX: ffffffffffffff13 RAX: 0000000000000001 RBX: ffff88809fc80040 RCX: ffffc90007852000 RDX: 0000000000000000 RSI: ffffffff81d86cc1 RDI: ffff88809fc803b4 RBP: ffff88809fc803b0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000001 R11: 0000000000000000 R12: ffff8880ae2b4a80 R13: 0000000000000000 R14: ffff88823513cb40 R15: 0000000000000000 rcu_read_unlock include/linux/rcupdate.h:680 [inline] ext4_get_group_desc+0x1d6/0x4e0 fs/ext4/balloc.c:284 recently_deleted fs/ext4/ialloc.c:680 [inline] find_inode_bit+0x1a0/0x520 fs/ext4/ialloc.c:724 __ext4_new_inode+0x160c/0x5a20 fs/ext4/ialloc.c:916 ext4_create+0x29e/0x5f0 fs/ext4/namei.c:2517 loop0: rw=2049, want=120, limit=16 lookup_open+0x893/0x1a20 fs/namei.c:3235 do_last fs/namei.c:3327 [inline] path_openat+0x1094/0x2df0 fs/namei.c:3537 attempt to access beyond end of device do_filp_open+0x18c/0x3f0 fs/namei.c:3567 attempt to access beyond end of device do_sys_open+0x3b3/0x520 fs/open.c:1085 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x7f7032bb9209 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:00007f703152e168 EFLAGS: 00000246 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 00007f7032ccbf60 RCX: 00007f7032bb9209 RDX: 000000000000275a RSI: 00000000200001c0 RDI: ffffffffffffff9c RBP: 00007f7032c13161 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffcd10b36ff R14: 00007f703152e300 R15: 0000000000022000 Allocated by task 12025: __do_kmalloc mm/slab.c:3727 [inline] __kmalloc+0x15a/0x3c0 mm/slab.c:3736 kmalloc include/linux/slab.h:520 [inline] sk_prot_alloc+0x1e2/0x2d0 net/core/sock.c:1483 sk_alloc+0x36/0xec0 net/core/sock.c:1537 packet_create+0x117/0x850 net/packet/af_packet.c:3259 __sock_create+0x3d8/0x740 net/socket.c:1365 sock_create net/socket.c:1416 [inline] __sys_socket+0xef/0x200 net/socket.c:1458 __do_sys_socket net/socket.c:1467 [inline] __se_sys_socket net/socket.c:1465 [inline] __x64_sys_socket+0x6f/0xb0 net/socket.c:1465 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 12019: __cache_free mm/slab.c:3503 [inline] kfree+0xcc/0x210 mm/slab.c:3822 sk_prot_free net/core/sock.c:1520 [inline] __sk_destruct+0x684/0x8a0 net/core/sock.c:1602 sk_destruct net/core/sock.c:1617 [inline] __sk_free+0x165/0x3b0 net/core/sock.c:1628 sk_free+0x3b/0x50 net/core/sock.c:1639 sock_put include/net/sock.h:1713 [inline] packet_release+0x890/0xb70 net/packet/af_packet.c:3088 __sock_release+0xcd/0x2a0 net/socket.c:599 sock_close+0x15/0x20 net/socket.c:1214 __fput+0x2ce/0x890 fs/file_table.c:278 task_work_run+0x148/0x1c0 kernel/task_work.c:113 tracehook_notify_resume include/linux/tracehook.h:193 [inline] exit_to_usermode_loop+0x251/0x2a0 arch/x86/entry/common.c:167 prepare_exit_to_usermode arch/x86/entry/common.c:198 [inline] syscall_return_slowpath arch/x86/entry/common.c:271 [inline] do_syscall_64+0x538/0x620 arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff888097f9ab00 which belongs to the cache kmalloc-4096 of size 4096 The buggy address is located 2096 bytes inside of 4096-byte region [ffff888097f9ab00, ffff888097f9bb00) The buggy address belongs to the page: page:ffffea00025fe680 count:1 mapcount:0 mapping:ffff88813bff0dc0 index:0x0 compound_mapcount: 0 flags: 0xfff00000008100(slab|head) raw: 00fff00000008100 ffffea0002a6f388 ffffea000235df88 ffff88813bff0dc0 raw: 0000000000000000 ffff888097f9ab00 0000000100000001 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888097f9b200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888097f9b280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888097f9b300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888097f9b380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888097f9b400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ---------------- Code disassembly (best guess), 5 bytes skipped: 0: 48 ba 00 00 00 00 00 movabs $0xdffffc0000000000,%rdx 7: fc ff df a: 48 c1 e8 03 shr $0x3,%rax e: 80 3c 10 00 cmpb $0x0,(%rax,%rdx,1) 12: 75 31 jne 0x45 14: 48 83 3d 01 31 d8 01 cmpq $0x0,0x1d83101(%rip) # 0x1d8311d 1b: 00 1c: 74 25 je 0x43 1e: fb sti 1f: 66 0f 1f 44 00 00 nopw 0x0(%rax,%rax,1) * 25: bf 01 00 00 00 mov $0x1,%edi <-- trapping instruction 2a: e8 26 1b 28 f9 callq 0xf9281b55 2f: 65 8b 05 9f 8d e8 77 mov %gs:0x77e88d9f(%rip),%eax # 0x77e88dd5 36: 85 c0 test %eax,%eax 38: 74 02 je 0x3c 3a: 5d pop %rbp