audit: type=1400 audit(1538619194.036:8): avc: denied { prog_load } for pid=1778 comm="syz-executor911" scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=bpf permissive=1 ================================================================== BUG: KASAN: use-after-free in ____bpf_clone_redirect net/core/filter.c:1767 [inline] BUG: KASAN: use-after-free in bpf_clone_redirect+0x29a/0x2b0 net/core/filter.c:1758 Read of size 8 at addr ffff8801d0e2f950 by task syz-executor911/1778 CPU: 0 PID: 1778 Comm: syz-executor911 Not tainted 4.14.73+ #15 Call Trace: __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0xb9/0x11b lib/dump_stack.c:53 print_address_description+0x60/0x22b mm/kasan/report.c:252 kasan_report_error mm/kasan/report.c:351 [inline] kasan_report.cold.6+0x11b/0x2dd mm/kasan/report.c:409 ____bpf_clone_redirect net/core/filter.c:1767 [inline] bpf_clone_redirect+0x29a/0x2b0 net/core/filter.c:1758 ___bpf_prog_run+0x248e/0x5c70 kernel/bpf/core.c:1012 Allocated by task 0: save_stack mm/kasan/kasan.c:447 [inline] set_track mm/kasan/kasan.c:459 [inline] kasan_kmalloc.part.1+0x4f/0xd0 mm/kasan/kasan.c:551 slab_post_alloc_hook mm/slab.h:442 [inline] slab_alloc_node mm/slub.c:2723 [inline] slab_alloc mm/slub.c:2731 [inline] kmem_cache_alloc+0xe4/0x2b0 mm/slub.c:2736 skb_clone+0x120/0x300 net/core/skbuff.c:1278 dev_queue_xmit_nit+0x2f8/0x960 net/core/dev.c:1921 xmit_one net/core/dev.c:2983 [inline] dev_hard_start_xmit+0xa2/0x890 net/core/dev.c:3003 sch_direct_xmit+0x280/0x520 net/sched/sch_generic.c:186 __dev_xmit_skb net/core/dev.c:3196 [inline] __dev_queue_xmit+0x16fd/0x1f40 net/core/dev.c:3471 neigh_hh_output include/net/neighbour.h:472 [inline] neigh_output include/net/neighbour.h:480 [inline] ip_finish_output2+0xc56/0x1190 net/ipv4/ip_output.c:229 ip_finish_output+0x3a5/0xc40 net/ipv4/ip_output.c:317 NF_HOOK_COND include/linux/netfilter.h:239 [inline] ip_output+0x1c9/0x520 net/ipv4/ip_output.c:405 dst_output include/net/dst.h:459 [inline] ip_local_out+0x94/0x170 net/ipv4/ip_output.c:124 tcp_v4_send_synack+0x1ec/0x310 net/ipv4/tcp_ipv4.c:878 tcp_conn_request+0x17d8/0x2140 net/ipv4/tcp_input.c:6417 tcp_v4_conn_request+0xa1/0x200 net/ipv4/tcp_ipv4.c:1314 tcp_rcv_state_process+0x8f4/0x47d8 net/ipv4/tcp_input.c:5920 tcp_v4_do_rcv+0x2e8/0x6f0 net/ipv4/tcp_ipv4.c:1486 tcp_v4_rcv+0x2c09/0x3240 net/ipv4/tcp_ipv4.c:1735 ip_local_deliver_finish+0x3f1/0xaa0 net/ipv4/ip_input.c:216 NF_HOOK include/linux/netfilter.h:250 [inline] ip_local_deliver+0x374/0x450 net/ipv4/ip_input.c:257 dst_input include/net/dst.h:465 [inline] ip_rcv_finish+0x5cc/0x1490 net/ipv4/ip_input.c:397 NF_HOOK include/linux/netfilter.h:250 [inline] ip_rcv+0xa19/0x1028 net/ipv4/ip_input.c:493 __netif_receive_skb_core+0x149d/0x2d10 net/core/dev.c:4455 __netif_receive_skb+0x58/0x1f0 net/core/dev.c:4493 netif_receive_skb_internal+0xfc/0x5e0 net/core/dev.c:4566 napi_skb_finish net/core/dev.c:4927 [inline] napi_gro_receive+0x20e/0x410 net/core/dev.c:4958 receive_buf+0xa55/0x42c0 drivers/net/virtio_net.c:847 virtnet_receive drivers/net/virtio_net.c:1093 [inline] virtnet_poll+0x2af/0x910 drivers/net/virtio_net.c:1174 napi_poll net/core/dev.c:5569 [inline] net_rx_action+0x371/0xce0 net/core/dev.c:5635 __do_softirq+0x215/0x997 kernel/softirq.c:288 Freed by task 0: save_stack mm/kasan/kasan.c:447 [inline] set_track mm/kasan/kasan.c:459 [inline] kasan_slab_free+0xac/0x190 mm/kasan/kasan.c:524 slab_free_hook mm/slub.c:1389 [inline] slab_free_freelist_hook mm/slub.c:1410 [inline] slab_free mm/slub.c:2966 [inline] kmem_cache_free+0x12d/0x350 mm/slub.c:2988 kfree_skbmem+0x9e/0x100 net/core/skbuff.c:582 __kfree_skb net/core/skbuff.c:642 [inline] kfree_skb+0xd0/0x340 net/core/skbuff.c:659 packet_rcv_spkt+0xd5/0x4b0 net/packet/af_packet.c:1888 dev_queue_xmit_nit+0x6e6/0x960 net/core/dev.c:1953 xmit_one net/core/dev.c:2983 [inline] dev_hard_start_xmit+0xa2/0x890 net/core/dev.c:3003 sch_direct_xmit+0x280/0x520 net/sched/sch_generic.c:186 __dev_xmit_skb net/core/dev.c:3196 [inline] __dev_queue_xmit+0x16fd/0x1f40 net/core/dev.c:3471 neigh_hh_output include/net/neighbour.h:472 [inline] neigh_output include/net/neighbour.h:480 [inline] ip_finish_output2+0xc56/0x1190 net/ipv4/ip_output.c:229 ip_finish_output+0x3a5/0xc40 net/ipv4/ip_output.c:317 NF_HOOK_COND include/linux/netfilter.h:239 [inline] ip_output+0x1c9/0x520 net/ipv4/ip_output.c:405 dst_output include/net/dst.h:459 [inline] ip_local_out+0x94/0x170 net/ipv4/ip_output.c:124 tcp_v4_send_synack+0x1ec/0x310 net/ipv4/tcp_ipv4.c:878 tcp_conn_request+0x17d8/0x2140 net/ipv4/tcp_input.c:6417 tcp_v4_conn_request+0xa1/0x200 net/ipv4/tcp_ipv4.c:1314 tcp_rcv_state_process+0x8f4/0x47d8 net/ipv4/tcp_input.c:5920 tcp_v4_do_rcv+0x2e8/0x6f0 net/ipv4/tcp_ipv4.c:1486 tcp_v4_rcv+0x2c09/0x3240 net/ipv4/tcp_ipv4.c:1735 ip_local_deliver_finish+0x3f1/0xaa0 net/ipv4/ip_input.c:216 NF_HOOK include/linux/netfilter.h:250 [inline] ip_local_deliver+0x374/0x450 net/ipv4/ip_input.c:257 dst_input include/net/dst.h:465 [inline] ip_rcv_finish+0x5cc/0x1490 net/ipv4/ip_input.c:397 NF_HOOK include/linux/netfilter.h:250 [inline] ip_rcv+0xa19/0x1028 net/ipv4/ip_input.c:493 __netif_receive_skb_core+0x149d/0x2d10 net/core/dev.c:4455 __netif_receive_skb+0x58/0x1f0 net/core/dev.c:4493 netif_receive_skb_internal+0xfc/0x5e0 net/core/dev.c:4566 napi_skb_finish net/core/dev.c:4927 [inline] napi_gro_receive+0x20e/0x410 net/core/dev.c:4958 receive_buf+0xa55/0x42c0 drivers/net/virtio_net.c:847 virtnet_receive drivers/net/virtio_net.c:1093 [inline] virtnet_poll+0x2af/0x910 drivers/net/virtio_net.c:1174 napi_poll net/core/dev.c:5569 [inline] net_rx_action+0x371/0xce0 net/core/dev.c:5635 __do_softirq+0x215/0x997 kernel/softirq.c:288 The buggy address belongs to the object at ffff8801d0e2f8c0 which belongs to the cache skbuff_head_cache of size 224 The buggy address is located 144 bytes inside of 224-byte region [ffff8801d0e2f8c0, ffff8801d0e2f9a0) The buggy address belongs to the page: page:ffffea0007438bc0 count:1 mapcount:0 mapping: (null) index:0x0 flags: 0x4000000000000100(slab) raw: 4000000000000100 0000000000000000 0000000000000000 00000001800c000c raw: 0000000000000000 0000000100000001 ffff8801dab70200 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8801d0e2f800: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc ffff8801d0e2f880: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb >ffff8801d0e2f900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8801d0e2f980: fb fb fb fb fc fc fc fc fc fc fc fc fc fc fc fc ffff8801d0e2fa00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================