linux/include/net
sewookseo e22aa14866 net: Find dst with sk's xfrm policy not ctl_sk
If we set XFRM security policy by calling setsockopt with option
IPV6_XFRM_POLICY, the policy will be stored in 'sock_policy' in 'sock'
struct. However tcp_v6_send_response doesn't look up dst_entry with the
actual socket but looks up with tcp control socket. This may cause a
problem that a RST packet is sent without ESP encryption & peer's TCP
socket can't receive it.
This patch will make the function look up dest_entry with actual socket,
if the socket has XFRM policy(sock_policy), so that the TCP response
packet via this function can be encrypted, & aligned on the encrypted
TCP socket.

Tested: We encountered this problem when a TCP socket which is encrypted
in ESP transport mode encryption, receives challenge ACK at SYN_SENT
state. After receiving challenge ACK, TCP needs to send RST to
establish the socket at next SYN try. But the RST was not encrypted &
peer TCP socket still remains on ESTABLISHED state.
So we verified this with test step as below.
[Test step]
1. Making a TCP state mismatch between client(IDLE) & server(ESTABLISHED).
2. Client tries a new connection on the same TCP ports(src & dst).
3. Server will return challenge ACK instead of SYN,ACK.
4. Client will send RST to server to clear the SOCKET.
5. Client will retransmit SYN to server on the same TCP ports.
[Expected result]
The TCP connection should be established.

Cc: Maciej Żenczykowski <maze@google.com>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Steffen Klassert <steffen.klassert@secunet.com>
Cc: Sehee Lee <seheele@google.com>
Signed-off-by: Sewook Seo <sewookseo@google.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2022-07-11 13:39:56 +01:00
..
9p
bluetooth bluetooth: don't use bitmaps for random flag accesses 2022-06-05 16:28:41 -07:00
caif
iucv
netfilter netfilter: nf_tables: avoid skb access on nf_stolen 2022-06-27 19:22:54 +02:00
netns af_unix: Define a per-netns hash table. 2022-06-22 12:59:43 +01:00
nfc
phonet
sctp
tc_act Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-05-12 16:15:30 -07:00
6lowpan.h
Space.h
act_api.h
addrconf.h
af_ieee802154.h
af_rxrpc.h
af_unix.h af_unix: Remove unix_table_locks. 2022-06-22 12:59:43 +01:00
af_vsock.h
ah.h
amt.h amt: fix typo in amt 2022-05-25 21:36:16 -07:00
arp.h
atmclip.h
ax25.h ax25: Fix ax25 session cleanup problems 2022-06-02 10:37:57 +02:00
ax88796.h
bareudp.h
bond_3ad.h
bond_alb.h
bond_options.h Bonding: add per-port priority for failover re-selection 2022-06-24 11:27:59 +01:00
bonding.h Bonding: add per-port priority for failover re-selection 2022-06-24 11:27:59 +01:00
bpf_sk_storage.h
busy_poll.h
calipso.h
cfg80211-wext.h
cfg80211.h net: wrap the wireless pointers in struct net_device in an ifdef 2022-05-22 21:51:54 +01:00
cfg802154.h net: wrap the wireless pointers in struct net_device in an ifdef 2022-05-22 21:51:54 +01:00
checksum.h
cipso_ipv4.h
cls_cgroup.h
codel.h
codel_impl.h
codel_qdisc.h
compat.h
datalink.h
dcbevent.h
dcbnl.h
devlink.h Revert "Merge branch 'mlxsw-line-card-model'" 2022-05-05 15:47:23 -07:00
dn.h
dn_dev.h
dn_fib.h
dn_neigh.h
dn_nsp.h
dn_route.h
dropreason.h net: dropreason: reformat the comment fo skb drop reasons 2022-06-07 12:51:41 +02:00
dsa.h net: dsa: tag_ksz: add tag handling for Microchip LAN937x 2022-07-02 16:34:05 +01:00
dsfield.h
dst.h
dst_cache.h
dst_metadata.h
dst_ops.h
erspan.h
esp.h
espintcp.h
ethoc.h
failover.h
fib_notifier.h
fib_rules.h
firewire.h
flow.h
flow_dissector.h
flow_offload.h net/sched: act_police: allow 'continue' action offload 2022-07-06 12:44:39 +01:00
fou.h
fq.h
fq_impl.h
garp.h
gen_stats.h
genetlink.h
geneve.h
gre.h
gro.h
gro_cells.h
gtp.h
gue.h
hwbm.h
icmp.h
ieee80211_radiotap.h
ieee802154_netdev.h
if_inet6.h
ife.h
ila.h
inet6_connection_sock.h
inet6_hashtables.h ipv6: add READ_ONCE(sk->sk_bound_dev_if) in INET6_MATCH() 2022-05-16 10:31:06 +01:00
inet_common.h
inet_connection_sock.h Revert "net: Add a second bind table hashed by port and address" 2022-06-16 11:07:59 -07:00
inet_dscp.h
inet_ecn.h
inet_frag.h
inet_hashtables.h Revert "net: Add a second bind table hashed by port and address" 2022-06-16 11:07:59 -07:00
inet_sock.h sock: redo the psock vs ULP protection check 2022-06-23 10:08:30 +02:00
inet_timewait_sock.h Revert "tcp/dccp: get rid of inet_twsk_purge()" 2022-05-13 12:24:12 +01:00
inetpeer.h
ioam6.h
ip.h Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-05-19 11:23:59 -07:00
ip6_checksum.h
ip6_fib.h
ip6_route.h
ip6_tunnel.h
ip_fib.h
ip_tunnels.h net: adopt u64_stats_t in struct pcpu_sw_netstats 2022-06-09 21:53:11 -07:00
ip_vs.h
ipcomp.h
ipconfig.h
ipv6.h ipv6: Fix signed integer overflow in __ip6_append_data 2022-06-08 10:56:43 -07:00
ipv6_frag.h
ipv6_stubs.h
iw_handler.h
kcm.h
l3mdev.h
lag.h
lapb.h
lib80211.h
llc.h
llc_c_ac.h
llc_c_ev.h
llc_c_st.h
llc_conn.h
llc_if.h
llc_pdu.h
llc_s_ac.h
llc_s_ev.h
llc_s_st.h
llc_sap.h
lwtunnel.h
mac80211.h wifi: mac80211: remove cipher scheme support 2022-06-10 15:35:53 +02:00
mac802154.h
macsec.h
mctp.h
mctpdevice.h
mip6.h
mld.h
mpls.h
mpls_iptunnel.h
mptcp.h mptcp: move MPTCPOPT_HMAC_LEN to net/mptcp.h 2022-07-09 12:19:23 +01:00
mrp.h
ncsi.h
ndisc.h
neighbour.h net, neigh: introduce interval_probe_time_ms for periodic probe 2022-06-30 13:14:35 +02:00
net_debug.h net: add CONFIG_DEBUG_NET 2022-05-11 12:43:10 +01:00
net_failover.h
net_namespace.h af_unix: Define a per-netns hash table. 2022-06-22 12:59:43 +01:00
net_ratelimit.h
net_trackers.h
netevent.h
netlabel.h
netlink.h
netprio_cgroup.h
netrom.h
nexthop.h
nl802154.h
nsh.h
p8022.h
page_pool.h
pie.h
ping.h
pkt_cls.h
pkt_sched.h net: sched: provide shim definitions for taprio_offload_{get,free} 2022-07-05 17:50:38 -07:00
pptp.h
protocol.h
psample.h
psnap.h
raw.h raw: complete rcu conversion 2022-06-21 11:38:29 +02:00
rawv6.h raw: convert raw sockets to RCU 2022-06-19 10:00:02 +01:00
red.h
regulatory.h
request_sock.h
rose.h
route.h
rpl.h
rsi_91x.h
rtnetlink.h
rtnh.h
sch_generic.h net: sched: add barrier to fix packet stuck problem for lockless qdisc 2022-05-31 20:39:28 -07:00
scm.h
secure_seq.h secure_seq: use the 64 bits of the siphash for port offset calculation 2022-05-04 19:22:20 -07:00
seg6.h
seg6_hmac.h
seg6_local.h
selftests.h
slhc_vj.h
smc.h
snmp.h
sock.h net: remove SK_RECLAIM_THRESHOLD and SK_RECLAIM_CHUNK 2022-07-01 13:25:00 +01:00
sock_reuseport.h
stp.h
strparser.h strparser: pad sk_skb_cb to avoid straddling cachelines 2022-07-08 18:38:44 -07:00
switchdev.h net: switchdev: add reminder near struct switchdev_notifier_fdb_info 2022-06-29 20:37:36 -07:00
tcp.h net: Introduce a new proto_ops ->read_skb() 2022-06-20 14:05:52 +02:00
tcp_states.h
timewait_sock.h
tipc.h
tls.h tls: create an internal header 2022-07-08 18:38:45 -07:00
tls_toe.h
transp_v6.h
tso.h
tun_proto.h
udp.h net: Introduce a new proto_ops ->read_skb() 2022-06-20 14:05:52 +02:00
udp_tunnel.h
udplite.h
vsock_addr.h
vxlan.h
wext.h
x25.h
x25device.h
xdp.h
xdp_priv.h
xdp_sock.h
xdp_sock_drv.h
xfrm.h net: Find dst with sk's xfrm policy not ctl_sk 2022-07-11 13:39:56 +01:00
xsk_buff_pool.h