OrangePi_CM5/net/netfilter
Florian Westphal 842a9bbbef netfilter: nft_socket: only do sk lookups when indev is available
commit 743b83f15d4069ea57c3e40996bf4a1077e0cdc1 upstream.

Check if the incoming interface is available and NFT_BREAK
in case neither skb->sk nor input device are set.

Because nf_sk_lookup_slow*() assume packet headers are in the
'in' direction, use in postrouting is not going to yield a meaningful
result.  Same is true for the forward chain, so restrict the use
to prerouting, input and output.

Use in output work if a socket is already attached to the skb.

Fixes: 554ced0a6e ("netfilter: nf_tables: add support for native socket matching")
Reported-and-tested-by: Topi Miettinen <toiwoton@gmail.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-05-09 09:05:08 +02:00
..
ipset netfilter: ipset: Fix oversized kvmalloc() calls 2021-10-06 15:56:03 +02:00
ipvs ipvs: correctly print the memory size of ip_vs_conn_tab 2022-05-09 09:05:02 +02:00
Kconfig netfilter: Kconfig: use 'default y' instead of 'm' for bool config option 2021-10-27 09:56:53 +02:00
Makefile
…
core.c netfilter: fix use-after-free in __nf_register_net_hook() 2022-03-08 19:09:32 +01:00
nf_conncount.c
…
nf_conntrack_acct.c
…
nf_conntrack_amanda.c
…
nf_conntrack_broadcast.c
…
nf_conntrack_core.c netfilter: conntrack: don't increment invalid counter on NF_REPEAT 2022-02-01 17:25:45 +01:00
nf_conntrack_ecache.c
…
nf_conntrack_expect.c
…
nf_conntrack_extend.c
…
nf_conntrack_ftp.c
…
nf_conntrack_h323_asn1.c
…
nf_conntrack_h323_main.c
…
nf_conntrack_h323_types.c
…
nf_conntrack_helper.c
…
nf_conntrack_irc.c
…
nf_conntrack_labels.c
…
nf_conntrack_netbios_ns.c
…
nf_conntrack_netlink.c netfilter: ctnetlink: disable helper autoassign 2022-02-16 12:54:24 +01:00
nf_conntrack_pptp.c
…
nf_conntrack_proto.c netfilter: conntrack: unregister ipv4 sockopts on error unwind 2021-06-10 13:39:13 +02:00
nf_conntrack_proto_dccp.c netfilter: Fix fall-through warnings for Clang 2021-09-22 12:28:03 +02:00
nf_conntrack_proto_generic.c
…
nf_conntrack_proto_gre.c netfilter: conntrack: Fix gre tunneling over ipv6 2021-04-10 13:36:08 +02:00
nf_conntrack_proto_icmp.c
…
nf_conntrack_proto_icmpv6.c
…
nf_conntrack_proto_sctp.c netfilter: conntrack: don't refresh sctp entries in closed state 2022-02-23 12:01:05 +01:00
nf_conntrack_proto_tcp.c netfilter: nf_conntrack_tcp: preserve liberal flag in tcp options 2022-04-08 14:40:28 +02:00
nf_conntrack_proto_udp.c netfilter: conntrack: set on IPS_ASSURED if flows enters internal stream state 2021-11-18 14:04:01 +01:00
nf_conntrack_sane.c
…
nf_conntrack_seqadj.c
…
nf_conntrack_sip.c
…
nf_conntrack_snmp.c
…
nf_conntrack_standalone.c netfilter: conntrack: Make global sysctls readonly in non-init netns 2021-05-07 11:04:31 +02:00
nf_conntrack_tftp.c
…
nf_conntrack_timeout.c
…
nf_conntrack_timestamp.c
…
nf_dup_netdev.c
…
nf_flow_table_core.c netfilter: conntrack: annotate data-races around ct->timeout 2021-12-14 11:32:37 +01:00
nf_flow_table_inet.c
…
nf_flow_table_ip.c
…
nf_flow_table_offload.c netfilter: flowtable: fix IPv6 tunnel addr match 2021-12-01 09:19:02 +01:00
nf_internals.h
…
nf_log.c
…
nf_log_common.c
…
nf_log_netdev.c
…
nf_nat_amanda.c
…
nf_nat_core.c
…
nf_nat_ftp.c
…
nf_nat_helper.c
…
nf_nat_irc.c
…
nf_nat_masquerade.c netfilter: nf_nat_masquerade: defer conntrack walk to work queue 2021-10-17 10:43:32 +02:00
nf_nat_proto.c
…
nf_nat_redirect.c
…
nf_nat_sip.c
…
nf_nat_tftp.c
…
nf_queue.c netfilter: nf_queue: handle socket prefetch 2022-03-08 19:09:33 +01:00
nf_sockopt.c
…
nf_synproxy_core.c netfilter: synproxy: Fix out of bounds when parsing TCP options 2021-06-23 14:42:43 +02:00
nf_tables_api.c netfilter: nf_tables: fix memory leak during stateful obj update 2022-03-02 11:42:50 +01:00
nf_tables_core.c netfilter: nf_tables: initialize registers in nft_do_chain() 2022-03-28 09:57:09 +02:00
nf_tables_offload.c netfilter: nf_tables_offload: incorrect flow offload action array size 2022-03-02 11:42:47 +01:00
nf_tables_trace.c
…
nfnetlink.c
…
nfnetlink_acct.c
…
nfnetlink_cthelper.c netfilter: nfnetlink_cthelper: hit EBUSY on updates if size mismatches 2021-06-10 13:39:19 +02:00
nfnetlink_cttimeout.c
…
nfnetlink_log.c netfilter: fix regression in looped (broad|multi)cast's MAC handling 2021-12-29 12:25:55 +01:00
nfnetlink_osf.c netfilter: nfnetlink_osf: Fix a missing skb_header_pointer() NULL check 2021-05-19 10:13:08 +02:00
nfnetlink_queue.c netfilter: nf_queue: fix possible use-after-free 2022-03-08 19:09:33 +01:00
nft_bitwise.c
…
nft_byteorder.c
…
nft_chain_filter.c
…
nft_chain_nat.c
…
nft_chain_route.c
…
nft_cmp.c netfilter: nftables_offload: VLAN id needs host byteorder in flow dissector 2021-05-14 09:50:40 +02:00
nft_compat.c
…
nft_connlimit.c
…
nft_counter.c
…
nft_ct.c netfilter: nft_ct: protect nft_ct_pcpu_template_refcnt with mutex 2021-09-22 12:28:03 +02:00
nft_dup_netdev.c netfilter: nf_tables_offload: incorrect flow offload action array size 2022-03-02 11:42:47 +01:00
nft_dynset.c netfilter: nft_dynset: relax superfluous check on set updates 2021-11-18 14:04:06 +01:00
nft_exthdr.c netfilter: nft_exthdr: check for IPv6 packet before further processing 2021-07-14 16:56:22 +02:00
nft_fib.c
…
nft_fib_inet.c
…
nft_fib_netdev.c
…
nft_flow_offload.c
…
nft_fwd_netdev.c netfilter: nf_tables_offload: incorrect flow offload action array size 2022-03-02 11:42:47 +01:00
nft_hash.c
…
nft_immediate.c netfilter: nf_tables_offload: incorrect flow offload action array size 2022-03-02 11:42:47 +01:00
nft_limit.c netfilter: nft_limit: avoid possible divide error in nft_limit_init 2021-04-21 13:00:56 +02:00
nft_log.c
…
nft_lookup.c
…
nft_masq.c
…
nft_meta.c
…
nft_nat.c netfilter: nft_nat: allow to specify layer 4 protocol NAT only 2021-08-04 12:46:42 +02:00
nft_numgen.c
…
nft_objref.c
…
nft_osf.c netfilter: nft_osf: check for TCP packet before further processing 2021-07-14 16:56:22 +02:00
nft_payload.c netfilter: nft_payload: do not update layer 4 checksum when mangling fragments 2022-02-01 17:25:40 +01:00
nft_queue.c
…
nft_quota.c
…
nft_range.c
…
nft_redir.c
…
nft_reject.c
…
nft_reject_inet.c
…
nft_rt.c
…
nft_set_bitmap.c
…
nft_set_hash.c netfilter: nftables: avoid potential overflows on 32bit arches 2021-09-12 08:58:27 +02:00
nft_set_pipapo.c netfilter: nft_set_pipapo: allocate pcpu scratch maps on clone 2022-01-27 10:54:01 +01:00
nft_set_pipapo.h netfilter: nft_set_pipapo_avx2: Add irq_fpu_usable() check, fallback to non-AVX2 version 2021-06-03 09:00:28 +02:00
nft_set_pipapo_avx2.c nft_set_pipapo: Fix bucket load in AVX2 lookup routine for six 8-bit groups 2021-12-14 11:32:34 +01:00
nft_set_pipapo_avx2.h
…
nft_set_rbtree.c netfilter: nft_set_rbtree: overlap detection with element re-addition after deletion 2022-05-09 09:05:02 +02:00
nft_socket.c netfilter: nft_socket: only do sk lookups when indev is available 2022-05-09 09:05:08 +02:00
nft_synproxy.c netfilter: nft_synproxy: unregister hooks on init error path 2022-02-23 12:01:01 +01:00
nft_tproxy.c netfilter: nft_tproxy: restrict support to TCP and UDP transport protocols 2021-07-14 16:56:22 +02:00
nft_tunnel.c
…
nft_xfrm.c
…
utils.c
…
x_tables.c netfilter: x_tables: fix compat match/target pad out-of-bound write 2021-04-16 11:43:21 +02: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: xt_IDLETIMER: fix panic that occurs when timer_type has garbage value 2021-10-27 09:56:47 +02:00
xt_LED.c
…
xt_LOG.c
…
xt_MASQUERADE.c
…
xt_NETMAP.c
…
xt_NFLOG.c
…
xt_NFQUEUE.c
…
xt_RATEEST.c
…
xt_REDIRECT.c
…
xt_SECMARK.c netfilter: xt_SECMARK: add new revision to fix structure layout 2021-05-19 10:13:06 +02:00
xt_TCPMSS.c
…
xt_TCPOPTSTRIP.c
…
xt_TEE.c
…
xt_TPROXY.c
…
xt_TRACE.c
…
xt_addrtype.c
…
xt_bpf.c
…
xt_cgroup.c
…
xt_cluster.c
…
xt_comment.c
…
xt_connbytes.c
…
xt_connlabel.c
…
xt_connlimit.c
…
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
…
xt_helper.c
…
xt_hl.c
…
xt_ipcomp.c
…
xt_iprange.c
…
xt_ipvs.c
…
xt_l2tp.c
…
xt_length.c
…
xt_limit.c
…
xt_mac.c
…
xt_mark.c
…
xt_multiport.c
…
xt_nat.c
…
xt_nfacct.c
…
xt_osf.c
…
xt_owner.c
…
xt_physdev.c
…
xt_pkttype.c
…
xt_policy.c
…
xt_quota.c
…
xt_rateest.c
…
xt_realm.c
…
xt_recent.c
…
xt_repldata.h
…
xt_sctp.c
…
xt_set.c
…
xt_socket.c
…
xt_state.c
…
xt_statistic.c
…
xt_string.c
…
xt_tcpmss.c
…
xt_tcpudp.c
…
xt_time.c
…
xt_u32.c
…