android_kernel_xiaomi_sm7250/include/net
Kuniyuki Iwashima 7162f05f1f tcp/udp: Make early_demux back namespacified.
commit 11052589cf5c0bab3b4884d423d5f60c38fcf25d upstream.

Commit e21145a987 ("ipv4: namespacify ip_early_demux sysctl knob") made
it possible to enable/disable early_demux on a per-netns basis.  Then, we
introduced two knobs, tcp_early_demux and udp_early_demux, to switch it for
TCP/UDP in commit dddb64bcb3 ("net: Add sysctl to toggle early demux for
tcp and udp").  However, the .proc_handler() was wrong and actually
disabled us from changing the behaviour in each netns.

We can execute early_demux if net.ipv4.ip_early_demux is on and each proto
.early_demux() handler is not NULL.  When we toggle (tcp|udp)_early_demux,
the change itself is saved in each netns variable, but the .early_demux()
handler is a global variable, so the handler is switched based on the
init_net's sysctl variable.  Thus, netns (tcp|udp)_early_demux knobs have
nothing to do with the logic.  Whether we CAN execute proto .early_demux()
is always decided by init_net's sysctl knob, and whether we DO it or not is
by each netns ip_early_demux knob.

This patch namespacifies (tcp|udp)_early_demux again.  For now, the users
of the .early_demux() handler are TCP and UDP only, and they are called
directly to avoid retpoline.  So, we can remove the .early_demux() handler
from inet6?_protos and need not dereference them in ip6?_rcv_finish_core().
If another proto needs .early_demux(), we can restore it at that time.

Fixes: dddb64bcb3 ("net: Add sysctl to toggle early demux for tcp and udp")
Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Link: https://lore.kernel.org/r/20220713175207.7727-1-kuniyu@amazon.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-11-10 17:46:54 +01:00
..
9p
bluetooth Bluetooth: L2CAP: Fix use-after-free caused by l2cap_chan_put 2022-08-11 12:48:38 +02:00
caif net: caif: add proper error handling 2021-06-10 13:24:06 +02:00
iucv
netfilter netfilter: conntrack: re-fetch conntrack after insertion 2022-06-06 08:24:21 +02:00
netns net: xfrm: Localize sequence counter per network namespace 2021-04-14 08:22:34 +02:00
nfc NFC: add NCI_UNREG flag to eliminate the race 2021-12-01 09:27:43 +01:00
phonet
sctp sctp: use call_rcu to free endpoint 2022-01-05 12:34:58 +01:00
tc_act net/sched: act_pedit: really ensure the skb is writable 2022-05-18 09:42:48 +02:00
6lowpan.h
act_api.h
addrconf.h
af_ieee802154.h
af_rxrpc.h
af_unix.h net: split out functions related to registering inflight socket files 2021-07-31 08:22:37 +02:00
af_vsock.h
ah.h
arp.h ipv4: Invalidate neighbour for broadcast address upon address addition 2022-04-15 14:15:01 +02:00
atmclip.h
ax25.h ax25: fix reference count leaks of ax25_dev 2022-04-27 13:39:45 +02:00
ax88796.h
bond_3ad.h bonding: fix data-races around agg_select_timer 2022-02-23 11:58:39 +01:00
bond_alb.h bonding: make tx_rebalance_counter an atomic 2021-12-14 10:18:05 +01:00
bond_options.h
bonding.h bonding: wait for sysfs kobject destruction before freeing struct slave 2020-12-08 10:18:53 +01:00
busy_poll.h net: Fix a data-race around sysctl_net_busy_poll. 2022-09-05 10:26:30 +02:00
calipso.h
cfg80211-wext.h
cfg80211.h mac80211: properly handle A-MSDUs that start with an RFC 1042 header 2021-06-03 08:38:03 +02:00
cfg802154.h
checksum.h openvswitch: Fix setting ipv6 fields causing hw csum failure 2022-03-02 11:38:12 +01:00
cipso_ipv4.h
cls_cgroup.h
codel_impl.h
codel_qdisc.h
codel.h
compat.h
datalink.h
dcbevent.h
dcbnl.h
devlink.h
dn_dev.h
dn_fib.h
dn_neigh.h
dn_nsp.h
dn_route.h
dn.h
dsa.h net: dsa: read mac address from DT for slave device 2020-11-10 12:36:02 +01:00
dsfield.h
dst_cache.h
dst_metadata.h net: fix a memleak when uncloning an skb dst and its metadata 2022-02-16 12:51:46 +01:00
dst_ops.h
dst.h
erspan.h
esp.h esp: limit skb_page_frag_refill use to a single page 2022-07-12 16:29:00 +02:00
ethoc.h
failover.h
fib_notifier.h
fib_rules.h
firewire.h
flow_dissector.h net/sched: flower: fix parsing of ethertype following VLAN header 2022-04-20 09:12:48 +02:00
flow.h
fou.h
fq_impl.h
fq.h
garp.h
gen_stats.h
genetlink.h
geneve.h
gre.h
gro_cells.h
gtp.h
gue.h
hwbm.h
icmp.h net: icmp: pass zeroed opts from icmp{,v6}_ndo_send before sending 2021-03-04 09:39:59 +01:00
ieee80211_radiotap.h
ieee802154_netdev.h net: ieee802154: return -EINVAL for unknown addr type 2022-10-26 13:19:42 +02:00
if_inet6.h ipv6: fix locking issues with loops over idev->addr_list 2022-06-14 16:59:14 +02:00
ife.h
ila.h
inet6_connection_sock.h
inet6_hashtables.h
inet_common.h
inet_connection_sock.h tcp: relookup sock for RST+ACK packets handled by obsolete req sock 2021-04-07 12:48:47 +02:00
inet_ecn.h
inet_frag.h
inet_hashtables.h secure_seq: use the 64 bits of the siphash for port offset calculation 2022-06-06 08:24:20 +02:00
inet_sock.h tcp/dccp: Fix a data-race around sysctl_tcp_fwmark_accept. 2022-07-29 17:10:31 +02:00
inet_timewait_sock.h
inetpeer.h
ip6_checksum.h
ip6_fib.h ipv6: annotate accesses to fn->fn_sernum 2022-02-08 18:23:09 +01:00
ip6_route.h net: ipv6: fix returned variable type in ip6_skb_dst_mtu 2021-08-12 13:19:39 +02:00
ip6_tunnel.h
ip_fib.h
ip_tunnels.h ip_tunnels: Set tunnel option flag when tunnel metadata is present 2020-11-24 13:27:21 +01:00
ip_vs.h
ip.h ip: Fix a data-race around sysctl_fwmark_reflect. 2022-07-29 17:10:31 +02:00
ipcomp.h
ipconfig.h
ipv6_frag.h
ipv6.h
ipx.h
iw_handler.h
kcm.h
l3mdev.h
lag.h
lapb.h
lib80211.h
llc_c_ac.h
llc_c_ev.h
llc_c_st.h
llc_conn.h
llc_if.h
llc_pdu.h net: llc: fix skb_over_panic 2021-08-04 12:23:46 +02:00
llc_s_ac.h
llc_s_ev.h
llc_s_st.h
llc_sap.h
llc.h llc: fix out-of-bound array index in llc_sk_dev_hash() 2021-11-26 11:36:16 +01:00
lwtunnel.h
mac80211.h
mac802154.h
mip6.h
mld.h
mpls_iptunnel.h
mpls.h
mrp.h
ncsi.h
ndisc.h
neighbour.h
net_failover.h
net_namespace.h net: make get_net_ns return error if NET_NS is disabled 2021-06-30 08:48:18 -04:00
net_ratelimit.h
netevent.h
netlabel.h
netlink.h
netprio_cgroup.h
netrom.h
nexthop.h
nl802154.h net: ieee802154: handle iftypes as u32 2021-12-01 09:27:42 +01:00
nsh.h
p8022.h
page_pool.h
ping.h
pkt_cls.h
pkt_sched.h net: sched: extend Qdisc with rcu 2021-12-14 10:18:04 +01:00
pptp.h
protocol.h tcp/udp: Make early_demux back namespacified. 2022-11-10 17:46:54 +01:00
psample.h psample: Add a fwd declaration for skbuff 2021-08-26 08:36:38 -04:00
psnap.h
raw.h
rawv6.h
red.h sch_red: fix off-by-one checks in red_check_params() 2021-04-14 08:22:34 +02:00
regulatory.h
request_sock.h
rose.h
route.h
rsi_91x.h
rtnetlink.h can: dev: Move device back to init netns on owning netns delete 2021-03-30 14:37:03 +02:00
sch_generic.h net_sched: restore "mpu xxx" handling 2022-01-27 09:04:33 +01:00
scm.h
secure_seq.h secure_seq: use the 64 bits of the siphash for port offset calculation 2022-06-06 08:24:20 +02:00
seg6_hmac.h
seg6_local.h
seg6.h
slhc_vj.h
smc.h
snmp.h
sock_reuseport.h
sock.h inet: fully convert sk->sk_rx_dst to RCU rules 2022-10-26 13:19:42 +02:00
Space.h
stp.h
strparser.h
switchdev.h
tcp_states.h
tcp.h tcp/udp: Make early_demux back namespacified. 2022-11-10 17:46:54 +01:00
timewait_sock.h
tipc.h
tls.h net/tls: Protect from calling tls_dev_del for TLS RX twice 2020-12-08 10:18:52 +01:00
transp_v6.h
tso.h
tun_proto.h
udp_tunnel.h
udp.h tcp/udp: Make early_demux back namespacified. 2022-11-10 17:46:54 +01:00
udplite.h
vsock_addr.h
vxlan.h
wext.h
wimax.h
x25.h
x25device.h
xdp_sock.h
xdp.h
xfrm.h xfrm: policy: match with both mark and mask on user interfaces 2022-04-15 14:15:07 +02:00