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 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=816 sclass=netlink_route_socket pig=20086 comm=syz-executor2 Read of size 8 at addr ffff8801ce537bd0 by task syz-executor0/20093 CPU: 0 PID: 20093 Comm: syz-executor0 Not tainted 4.14.78+ #22 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 audit: type=1400 audit(1540076879.360:112): avc: denied { set_context_mgr } for pid=20105 comm="syz-executor2" scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=binder permissive=1 binder: 20105 invalid dec weak, ref 80 desc 0 s 1 w 0 binder: 20105:20106 transaction failed 29189/-22, size 0-0 line 3012 binder: undelivered TRANSACTION_ERROR: 29189 ___bpf_prog_run+0x248e/0x5c70 kernel/bpf/core.c:1012 Allocated by task 16574: 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:1943 xmit_one net/core/dev.c:3005 [inline] dev_hard_start_xmit+0xa2/0x890 net/core/dev.c:3025 __dev_queue_xmit+0x13d9/0x1f40 net/core/dev.c:3525 neigh_output include/net/neighbour.h:482 [inline] ip_finish_output2+0x972/0x1190 net/ipv4/ip_output.c:229 ip_do_fragment+0xa3b/0x1f30 net/ipv4/ip_output.c:812 ip_fragment.constprop.5+0x13b/0x1f0 net/ipv4/ip_output.c:548 ip_finish_output+0x798/0xc40 net/ipv4/ip_output.c:315 NF_HOOK_COND include/linux/netfilter.h:239 [inline] ip_mc_output+0x234/0xc20 net/ipv4/ip_output.c:390 dst_output include/net/dst.h:459 [inline] ip_local_out+0x94/0x170 net/ipv4/ip_output.c:124 ip_send_skb+0x37/0xb0 net/ipv4/ip_output.c:1417 ip_push_pending_frames+0x5e/0x80 net/ipv4/ip_output.c:1437 raw_sendmsg+0xec4/0x2470 net/ipv4/raw.c:669 inet_sendmsg+0x168/0x540 net/ipv4/af_inet.c:781 sock_sendmsg_nosec net/socket.c:645 [inline] sock_sendmsg+0xb5/0x100 net/socket.c:655 SYSC_sendto net/socket.c:1762 [inline] SyS_sendto+0x211/0x340 net/socket.c:1730 do_syscall_64+0x19b/0x4b0 arch/x86/entry/common.c:289 entry_SYSCALL_64_after_hwframe+0x42/0xb7 Freed by task 18667: 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 inet_frag_rbtree_purge+0x94/0xd0 net/ipv4/ip_fragment.c:751 inet_frag_destroy+0x1a6/0x210 net/ipv4/inet_fragment.c:148 inet_frag_put include/net/inet_frag.h:125 [inline] ipq_put net/ipv4/ip_fragment.c:163 [inline] ip_expire+0x603/0x8d0 net/ipv4/ip_fragment.c:265 call_timer_fn+0x163/0x6a0 kernel/time/timer.c:1279 expire_timers+0x1f3/0x4a0 kernel/time/timer.c:1318 __run_timers kernel/time/timer.c:1634 [inline] run_timer_softirq+0x1da/0x560 kernel/time/timer.c:1647 __do_softirq+0x215/0x997 kernel/softirq.c:288 The buggy address belongs to the object at ffff8801ce537b40 which belongs to the cache skbuff_head_cache of size 224 The buggy address is located 144 bytes inside of 224-byte region [ffff8801ce537b40, ffff8801ce537c20) The buggy address belongs to the page: page:ffffea0007394dc0 count:1 mapcount:0 mapping: (null) index:0x0 flags: 0x4000000000000100(slab) raw: 4000000000000100 0000000000000000 0000000000000000 00000001800c000c raw: 0000000000000000 0000000100000001 ffff8801d6770200 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8801ce537a80: 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc fc ffff8801ce537b00: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb >ffff8801ce537b80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8801ce537c00: fb fb fb fb fc fc fc fc fc fc fc fc fc fc fc fc ffff8801ce537c80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================