================================================================== BUG: KASAN: use-after-free in ____bpf_clone_redirect net/core/filter.c:1768 [inline] BUG: KASAN: use-after-free in bpf_clone_redirect+0x2a7/0x2b0 net/core/filter.c:1759 Read of size 8 at addr ffff88818c871a90 by task syz-executor.0/18296 CPU: 1 PID: 18296 Comm: syz-executor.0 Not tainted 4.14.139+ #36 Call Trace: __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0xca/0x134 lib/dump_stack.c:53 print_address_description+0x60/0x226 mm/kasan/report.c:187 __kasan_report.cold+0x1a/0x41 mm/kasan/report.c:316 ____bpf_clone_redirect net/core/filter.c:1768 [inline] bpf_clone_redirect+0x2a7/0x2b0 net/core/filter.c:1759 ___bpf_prog_run+0x2478/0x5510 kernel/bpf/core.c:1033 Allocated by task 17112: save_stack mm/kasan/common.c:76 [inline] set_track mm/kasan/common.c:85 [inline] __kasan_kmalloc.part.0+0x53/0xc0 mm/kasan/common.c:495 slab_post_alloc_hook mm/slab.h:439 [inline] slab_alloc_node mm/slub.c:2758 [inline] slab_alloc mm/slub.c:2766 [inline] kmem_cache_alloc+0xd2/0x2e0 mm/slub.c:2771 __build_skb+0x30/0x2f0 net/core/skbuff.c:281 __napi_alloc_skb+0x1e1/0x320 net/core/skbuff.c:486 napi_alloc_skb include/linux/skbuff.h:2674 [inline] page_to_skb+0xaf/0x6e0 drivers/net/virtio_net.c:323 receive_mergeable drivers/net/virtio_net.c:719 [inline] receive_buf+0x17a5/0x4310 drivers/net/virtio_net.c:824 virtnet_receive drivers/net/virtio_net.c:1098 [inline] virtnet_poll+0x4e6/0x9f0 drivers/net/virtio_net.c:1189 napi_poll net/core/dev.c:5598 [inline] net_rx_action+0x366/0xcd0 net/core/dev.c:5664 __do_softirq+0x234/0x9ec kernel/softirq.c:288 Freed by task 17112: save_stack mm/kasan/common.c:76 [inline] set_track mm/kasan/common.c:85 [inline] __kasan_slab_free+0x164/0x210 mm/kasan/common.c:457 slab_free_hook mm/slub.c:1403 [inline] slab_free_freelist_hook mm/slub.c:1430 [inline] slab_free mm/slub.c:3005 [inline] kmem_cache_free+0xcb/0x340 mm/slub.c:3021 kfree_skb_partial net/core/skbuff.c:4778 [inline] kfree_skb_partial+0x2c/0x50 net/core/skbuff.c:4774 tcp_rcv_established+0x12d8/0x1610 net/ipv4/tcp_input.c:5535 tcp_v4_do_rcv+0x568/0x700 net/ipv4/tcp_ipv4.c:1467 tcp_v4_rcv+0x23e9/0x3230 net/ipv4/tcp_ipv4.c:1741 ip_local_deliver_finish+0x3a3/0xa30 net/ipv4/ip_input.c:216 NF_HOOK include/linux/netfilter.h:250 [inline] ip_local_deliver+0x373/0x450 net/ipv4/ip_input.c:257 dst_input include/net/dst.h:468 [inline] ip_rcv_finish+0x4ed/0x1610 net/ipv4/ip_input.c:396 NF_HOOK include/linux/netfilter.h:250 [inline] ip_rcv+0xa30/0xf55 net/ipv4/ip_input.c:493 __netif_receive_skb_core+0x13ad/0x2cf0 net/core/dev.c:4477 __netif_receive_skb+0x66/0x210 net/core/dev.c:4515 netif_receive_skb_internal+0x11f/0x5f0 net/core/dev.c:4588 napi_skb_finish net/core/dev.c:4949 [inline] napi_gro_receive+0x206/0x410 net/core/dev.c:4980 receive_buf+0x503/0x4310 drivers/net/virtio_net.c:852 virtnet_receive drivers/net/virtio_net.c:1098 [inline] virtnet_poll+0x4e6/0x9f0 drivers/net/virtio_net.c:1189 napi_poll net/core/dev.c:5598 [inline] net_rx_action+0x366/0xcd0 net/core/dev.c:5664 __do_softirq+0x234/0x9ec kernel/softirq.c:288 The buggy address belongs to the object at ffff88818c871a00 which belongs to the cache skbuff_head_cache of size 224 The buggy address is located 144 bytes inside of 224-byte region [ffff88818c871a00, ffff88818c871ae0) The buggy address belongs to the page: page:ffffea0006321c40 count:1 mapcount:0 mapping: (null) index:0x0 flags: 0x4000000000000200(slab) raw: 4000000000000200 0000000000000000 0000000000000000 00000001800c000c raw: 0000000000000000 0000000900000001 ffff8881dab70200 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88818c871980: fb fb fb fb fc fc fc fc fc fc fc fc fc fc fc fc ffff88818c871a00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88818c871a80: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc ^ ffff88818c871b00: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb ffff88818c871b80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================