WSL2-Linux-Kernel/net/netfilter
Felix Fietkau 0ff90b6c20 netfilter: nf_flow_offload: fix use-after-free and a resource leak
flow_offload_del frees the flow, so all associated resource must be
freed before.

Since the ct entry in struct flow_offload_entry was allocated by
flow_offload_alloc, it should be freed by flow_offload_free to take care
of the error handling path when flow_offload_add fails.

While at it, make flow_offload_del static, since it should never be
called directly, only from the gc step

Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2018-02-07 11:55:52 +01:00
..
ipset Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf 2018-02-01 14:41:46 -05:00
ipvs Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2018-01-31 14:31:10 -08:00
Kconfig netfilter: flowtable infrastructure depends on NETFILTER_INGRESS 2018-02-02 13:21:48 +01:00
Makefile netfilter: nf_tables: flow offload expression 2018-01-08 18:11:10 +01:00
core.c netfilter: core: return EBUSY in case NAT hook is already in use 2018-01-10 15:32:16 +01:00
nf_conncount.c netfilter: return booleans instead of integers 2018-01-19 14:02:18 +01:00
nf_conntrack_acct.c
nf_conntrack_amanda.c
nf_conntrack_broadcast.c
nf_conntrack_core.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2018-01-31 14:31:10 -08:00
nf_conntrack_ecache.c
nf_conntrack_expect.c netfilter: delete /proc THIS_MODULE references 2018-01-19 14:10:53 +01:00
nf_conntrack_extend.c net: Replace NF_CT_ASSERT() with WARN_ON(). 2017-09-04 13:25:19 +02:00
nf_conntrack_ftp.c
nf_conntrack_h323_asn1.c netfilter: nf_conntrack_h323: Remove unwanted comments. 2018-01-08 18:01:05 +01:00
nf_conntrack_h323_main.c netfilter: move route indirection to struct nf_ipv6_ops 2018-01-08 18:01:26 +01:00
nf_conntrack_h323_types.c
nf_conntrack_helper.c
nf_conntrack_irc.c
nf_conntrack_l3proto_generic.c
nf_conntrack_labels.c
nf_conntrack_netbios_ns.c
nf_conntrack_netlink.c netfilter: remove messages print and boot/module load time 2018-01-19 18:39:49 +01:00
nf_conntrack_pptp.c
nf_conntrack_proto.c netfilter: conntrack: constify list of builtin trackers 2018-01-08 16:47:14 +01:00
nf_conntrack_proto_dccp.c netfilter: conntrack: l4 protocol trackers can be const 2018-01-08 18:00:54 +01:00
nf_conntrack_proto_generic.c netfilter: conntrack: timeouts can be const 2018-01-08 18:01:02 +01:00
nf_conntrack_proto_gre.c netfilter: conntrack: timeouts can be const 2018-01-08 18:01:02 +01:00
nf_conntrack_proto_sctp.c netfilter: conntrack: timeouts can be const 2018-01-08 18:01:02 +01:00
nf_conntrack_proto_tcp.c netfilter: nf_conntrack: add IPS_OFFLOAD status bit 2018-01-08 18:11:05 +01:00
nf_conntrack_proto_udp.c netfilter: conntrack: timeouts can be const 2018-01-08 18:01:02 +01:00
nf_conntrack_sane.c
nf_conntrack_seqadj.c
nf_conntrack_sip.c
nf_conntrack_snmp.c
nf_conntrack_standalone.c netfilter: delete /proc THIS_MODULE references 2018-01-19 14:10:53 +01:00
nf_conntrack_tftp.c
nf_conntrack_timeout.c
nf_conntrack_timestamp.c
nf_dup_netdev.c
nf_flow_table.c netfilter: nf_flow_offload: fix use-after-free and a resource leak 2018-02-07 11:55:52 +01:00
nf_flow_table_inet.c netfilter: nf_tables: fix flowtable free 2018-02-07 00:58:57 +01:00
nf_internals.h netfilter: core: remove synchronize_net call if nfqueue is used 2018-01-08 18:01:06 +01:00
nf_log.c netfilter: delete /proc THIS_MODULE references 2018-01-19 14:10:53 +01:00
nf_log_common.c
nf_log_netdev.c
nf_nat_amanda.c
nf_nat_core.c netfilter: nat: use test_and_clear_bit when deleting ct from bysource list 2017-10-24 17:54:47 +02:00
nf_nat_ftp.c treewide: Fix function prototypes for module_param_call() 2017-10-31 15:30:37 +01:00
nf_nat_helper.c
nf_nat_irc.c treewide: Fix function prototypes for module_param_call() 2017-10-31 15:30:37 +01:00
nf_nat_proto_common.c
nf_nat_proto_dccp.c
nf_nat_proto_sctp.c
nf_nat_proto_tcp.c
nf_nat_proto_udp.c
nf_nat_proto_unknown.c
nf_nat_redirect.c net: Replace NF_CT_ASSERT() with WARN_ON(). 2017-09-04 13:25:19 +02:00
nf_nat_sip.c
nf_nat_tftp.c
nf_queue.c netfilter: remove duplicated include 2018-01-10 15:32:15 +01:00
nf_sockopt.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
nf_synproxy_core.c netfilter: delete /proc THIS_MODULE references 2018-01-19 14:10:53 +01:00
nf_tables_api.c netfilter: nf_tables: fix flowtable free 2018-02-07 00:58:57 +01:00
nf_tables_core.c
nf_tables_inet.c netfilter: nf_tables: get rid of struct nft_af_info abstraction 2018-01-10 15:32:11 +01:00
nf_tables_netdev.c netfilter: nf_tables: get rid of struct nft_af_info abstraction 2018-01-10 15:32:11 +01:00
nf_tables_trace.c
nfnetlink.c netfilter: remove messages print and boot/module load time 2018-01-19 18:39:49 +01:00
nfnetlink_acct.c netfilter: remove messages print and boot/module load time 2018-01-19 18:39:49 +01:00
nfnetlink_cthelper.c netfilter: nfnetlink_cthelper: Add missing permission checks 2017-12-04 11:30:09 +01:00
nfnetlink_cttimeout.c netfilter: remove messages print and boot/module load time 2018-01-19 18:39:49 +01:00
nfnetlink_log.c netfilter: delete /proc THIS_MODULE references 2018-01-19 14:10:53 +01:00
nfnetlink_queue.c netfilter: delete /proc THIS_MODULE references 2018-01-19 14:10:53 +01:00
nft_bitwise.c
nft_byteorder.c
nft_cmp.c netfilter: mark expected switch fall-throughs 2018-01-08 18:01:01 +01:00
nft_compat.c netfilter: remove messages print and boot/module load time 2018-01-19 18:39:49 +01:00
nft_counter.c netfilter: nf_tables: add select_ops for stateful objects 2017-09-04 13:25:09 +02:00
nft_ct.c netfilter: nf_tables: add single table list for all families 2018-01-10 15:32:08 +01:00
nft_dup_netdev.c
nft_dynset.c netfilter: nf_tables: Fix trailing semicolon 2018-01-19 14:10:04 +01:00
nft_exthdr.c netfilter: exthdr: add missign attributes to policy 2017-12-11 13:46:04 +01:00
nft_fib.c
nft_fib_inet.c
nft_fib_netdev.c
nft_flow_offload.c netfilter: nft_flow_offload: move flowtable cleanup routines to nf_flow_table 2018-02-07 00:58:57 +01:00
nft_fwd_netdev.c
nft_hash.c
nft_immediate.c
nft_limit.c netfilter: nft_limit: add stateful object type 2017-09-04 13:25:16 +02:00
nft_log.c netfilter: nf_tables: add single table list for all families 2018-01-10 15:32:08 +01:00
nft_lookup.c
nft_masq.c netfilter: nf_tables: add single table list for all families 2018-01-10 15:32:08 +01:00
nft_meta.c netfilter: nf_tables: add single table list for all families 2018-01-10 15:32:08 +01:00
nft_nat.c netfilter: nf_tables: add single table list for all families 2018-01-10 15:32:08 +01:00
nft_numgen.c
nft_objref.c netfilter: nf_tables: add select_ops for stateful objects 2017-09-04 13:25:09 +02:00
nft_payload.c
nft_queue.c
nft_quota.c netfilter: nf_tables: add select_ops for stateful objects 2017-09-04 13:25:09 +02:00
nft_range.c
nft_redir.c netfilter: nf_tables: add single table list for all families 2018-01-10 15:32:08 +01:00
nft_reject.c
nft_reject_inet.c
nft_rt.c netfilter: move route indirection to struct nf_ipv6_ops 2018-01-08 18:01:26 +01:00
nft_set_bitmap.c netfilter: nf_tables: get set elements via netlink 2017-11-07 01:00:31 +01:00
nft_set_hash.c rhashtable: Change rhashtable_walk_start to return void 2017-12-11 09:58:38 -05:00
nft_set_rbtree.c netfilter: nf_tables: get set elements via netlink 2017-11-07 01:00:31 +01:00
utils.c netfilter: move reroute indirection to struct nf_ipv6_ops 2018-01-08 18:10:53 +01:00
x_tables.c netfilter: x_tables: make allocation less aggressive 2018-02-02 12:45:16 +01:00
xt_AUDIT.c
xt_CHECKSUM.c
xt_CLASSIFY.c
xt_CONNSECMARK.c
xt_CT.c
xt_DSCP.c
xt_HL.c
xt_HMARK.c
xt_IDLETIMER.c netfilter: x_tables: fix pointer leaks to userspace 2018-01-31 14:59:24 +01:00
xt_LED.c netfilter: x_tables: fix pointer leaks to userspace 2018-01-31 14:59:24 +01:00
xt_LOG.c
xt_NETMAP.c net: Replace NF_CT_ASSERT() with WARN_ON(). 2017-09-04 13:25:19 +02:00
xt_NFLOG.c
xt_NFQUEUE.c
xt_RATEEST.c netfilter: xt_RATEEST: acquire xt_rateest_mutex for hash insert 2018-02-07 00:58:57 +01:00
xt_REDIRECT.c
xt_SECMARK.c
xt_TCPMSS.c netfilter: move route indirection to struct nf_ipv6_ops 2018-01-08 18:01:26 +01:00
xt_TCPOPTSTRIP.c
xt_TEE.c
xt_TPROXY.c
xt_TRACE.c
xt_addrtype.c netfilter: move route indirection to struct nf_ipv6_ops 2018-01-08 18:01:26 +01:00
xt_bpf.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2018-01-06 17:13:21 -08:00
xt_cgroup.c netfilter: xt_cgroup: initialize info->priv in cgroup_mt_check_v1() 2018-02-02 18:26:37 +01:00
xt_cluster.c
xt_comment.c
xt_connbytes.c
xt_connlabel.c
xt_connlimit.c netfilter: connlimit: split xt_connlimit into front and backend 2018-01-08 18:01:22 +01:00
xt_connmark.c
xt_conntrack.c
xt_cpu.c
xt_dccp.c
xt_devgroup.c
xt_dscp.c
xt_ecn.c
xt_esp.c
xt_hashlimit.c netfilter: delete /proc THIS_MODULE references 2018-01-19 14:10:53 +01:00
xt_helper.c
xt_hl.c
xt_ipcomp.c netfilter: return booleans instead of integers 2018-01-19 14:02:18 +01:00
xt_iprange.c
xt_ipvs.c
xt_l2tp.c
xt_length.c
xt_limit.c netfilter: x_tables: fix pointer leaks to userspace 2018-01-31 14:59:24 +01:00
xt_mac.c
xt_mark.c
xt_multiport.c
xt_nat.c net: Replace NF_CT_ASSERT() with WARN_ON(). 2017-09-04 13:25:19 +02:00
xt_nfacct.c netfilter: x_tables: fix pointer leaks to userspace 2018-01-31 14:59:24 +01:00
xt_osf.c netfilter: xt_osf: Add missing permission checks 2017-12-06 09:01:18 +01:00
xt_owner.c
xt_physdev.c
xt_pkttype.c
xt_policy.c xfrm: Move child route linkage into xfrm_dst. 2017-11-30 09:54:26 -05:00
xt_quota.c
xt_rateest.c
xt_realm.c
xt_recent.c
xt_repldata.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
xt_sctp.c
xt_set.c netfilter: ipset: Fix "don't update counters" mode when counters used at the matching 2018-01-08 18:11:12 +01:00
xt_socket.c netfilter: xt_socket: Restore mark from full sockets only 2017-09-26 20:04:34 +02:00
xt_state.c
xt_statistic.c netfilter: x_tables: fix pointer leaks to userspace 2018-01-31 14:59:24 +01:00
xt_string.c
xt_tcpmss.c
xt_tcpudp.c
xt_time.c
xt_u32.c