Willem de Bruijn
36d60eba86
ip: Fix SO_MARK in RST, ACK and ICMP packets
...
[ Upstream commit 0da7536fb47f51df89ccfcb1fa09f249d9accec5 ]
When no full socket is available, skbs are sent over a per-netns
control socket. Its sk_mark is temporarily adjusted to match that
of the real (request or timewait) socket or to reflect an incoming
skb, so that the outgoing skb inherits this in __ip_make_skb.
Introduction of the socket cookie mark field broke this. Now the
skb is set through the cookie and cork:
<caller> # init sockc.mark from sk_mark or cmsg
ip_append_data
ip_setup_cork # convert sockc.mark to cork mark
ip_push_pending_frames
ip_finish_skb
__ip_make_skb # set skb->mark to cork mark
But I missed these special control sockets. Update all callers of
__ip(6)_make_skb that were originally missed.
For IPv6, the same two icmp(v6) paths are affected. The third
case is not, as commit 92e55f412c ("tcp: don't annotate
mark on control socket from tcp_v6_send_response()") replaced
the ctl_sk->sk_mark with passing the mark field directly as a
function argument. That commit predates the commit that
introduced the bug.
Fixes: c6af0c227a ("ip: support SO_MARK cmsg")
Signed-off-by: Willem de Bruijn <[email protected] >
Reported-by: Martin KaFai Lau <[email protected] >
Reviewed-by: Martin KaFai Lau <[email protected] >
Signed-off-by: David S. Miller <[email protected] >
Signed-off-by: Greg Kroah-Hartman <[email protected] >
2020-07-22 09:32:50 +02:00
..
ila
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152
2019-05-30 11:26:32 -07:00
netfilter
netfilter: drop bridge nf reset from nf_reset
2019-10-01 18:42:15 +02:00
addrconf.c
ipv6: don't auto-add link-local address to lag ports
2020-04-13 10:48:02 +02:00
addrconf_core.c
net: ipv6_stub: use ip6_dst_lookup_flow instead of ip6_dst_lookup
2019-12-18 16:08:42 +01:00
addrlabel.c
af_inet6.c
net: ipv6_stub: use ip6_dst_lookup_flow instead of ip6_dst_lookup
2019-12-18 16:08:42 +01:00
ah6.c
ipv6: Use ipv6_authlen for len
2019-07-11 14:43:25 -07:00
anycast.c
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152
2019-05-30 11:26:32 -07:00
calipso.c
netlabel: cope with NULL catmap
2020-05-20 08:20:08 +02:00
datagram.c
net: ipv6: add net argument to ip6_dst_lookup_flow
2019-12-18 16:08:40 +01:00
esp6.c
xfrm: remove get_mtu indirection from xfrm_type
2019-07-01 06:16:40 +02:00
esp6_offload.c
esp6: get the right proto for transport mode in esp6_gso_encap
2020-06-03 08:21:35 +02:00
exthdrs.c
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152
2019-05-30 11:26:32 -07:00
exthdrs_core.c
ipv6: remove printk
2019-07-27 14:23:48 -07:00
exthdrs_offload.c
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152
2019-05-30 11:26:32 -07:00
fib6_notifier.c
fib6_rules.c
ipv6: do not free rt if FIB_LOOKUP_NOREF is set on suppress rule
2019-09-26 09:34:25 +02:00
fou6.c
icmp.c
ip: Fix SO_MARK in RST, ACK and ICMP packets
2020-07-22 09:32:50 +02:00
inet6_connection_sock.c
net: add bool confirm_neigh parameter for dst_ops.update_pmtu
2020-01-04 19:18:58 +01:00
inet6_hashtables.c
net: annotate accesses to sk->sk_incoming_cpu
2019-10-30 13:24:25 -07:00
ip6_checksum.c
ip6_fib.c
net: don't return invalid table id error when we fall back to PF_UNSPEC
2020-06-03 08:20:41 +02:00
ip6_flowlabel.c
ipv6: fix static key imbalance in fl_create()
2019-07-11 14:43:25 -07:00
ip6_gre.c
ip6_gre: fix use-after-free in ip6gre_tunnel_lookup()
2020-06-30 15:36:46 -04:00
ip6_icmp.c
ip6_input.c
ipv6: drop incoming packets having a v4mapped source address
2019-10-03 11:40:21 -04:00
ip6_offload.c
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152
2019-05-30 11:26:32 -07:00
ip6_offload.h
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152
2019-05-30 11:26:32 -07:00
ip6_output.c
net: ipv6: add net argument to ip6_dst_lookup_flow
2019-12-18 16:08:40 +01:00
ip6_tunnel.c
net, ip6_tunnel: fix namespaces move
2020-01-29 16:45:20 +01:00
ip6_udp_tunnel.c
ip6_vti.c
vti6: Fix memory leak of skb if input policy check fails
2020-04-01 11:02:12 +02:00
ip6mr.c
net: don't return invalid table id error when we fall back to PF_UNSPEC
2020-06-03 08:20:41 +02:00
ipcomp6.c
xfrm: remove type and offload_type map from xfrm_state_afinfo
2019-06-06 08:34:50 +02:00
ipv6_sockglue.c
ipv6: fix IPV6_ADDRFORM operation logic
2020-06-17 16:40:19 +02:00
Kconfig
Makefile
mcast.c
mld: fix memory leak in ipv6_mc_destroy_dev()
2020-06-30 15:36:43 -04:00
mcast_snoop.c
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 343
2019-06-05 17:37:07 +02:00
mip6.c
xfrm: remove type and offload_type map from xfrm_state_afinfo
2019-06-06 08:34:50 +02:00
ndisc.c
net-ipv6-ndisc: add support for RFC7710 RA Captive Portal Identifier
2019-07-22 12:10:54 -07:00
netfilter.c
net: ensure correct skb->tstamp in various fragmenters
2019-10-18 10:02:37 -07:00
output_core.c
ping.c
ipv6: Fix the link time qualifier of 'ping_v6_proc_exit_net()'
2019-09-12 11:20:33 +01:00
proc.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
2019-06-07 11:00:14 -07:00
protocol.c
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152
2019-05-30 11:26:32 -07:00
raw.c
net: ipv6: add net argument to ip6_dst_lookup_flow
2019-12-18 16:08:40 +01:00
reassembly.c
inet: frags: re-introduce skb coalescing for local delivery
2019-08-08 15:55:10 -07:00
route.c
ipv6: Fix use of anycast address with loopback
2020-07-22 09:32:47 +02:00
seg6.c
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152
2019-05-30 11:26:32 -07:00
seg6_hmac.c
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152
2019-05-30 11:26:32 -07:00
seg6_iptunnel.c
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152
2019-05-30 11:26:32 -07:00
seg6_local.c
ipv6: sr: remove SKB_GSO_IPXIP6 on End.D* actions
2020-01-29 16:45:20 +01:00
sit.c
sit: do not confirm neighbor when do pmtu update
2020-01-04 19:19:04 +01:00
syncookies.c
net: ipv6: add net argument to ip6_dst_lookup_flow
2019-12-18 16:08:40 +01:00
sysctl_net_ipv6.c
proc/sysctl: add shared variables for range check
2019-07-18 17:08:07 -07:00
tcp_ipv6.c
net: ipv6: add net argument to ip6_dst_lookup_flow
2019-12-18 16:08:40 +01:00
tcpv6_offload.c
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152
2019-05-30 11:26:32 -07:00
tunnel6.c
udp.c
net: annotate accesses to sk->sk_incoming_cpu
2019-10-30 13:24:25 -07:00
udp_impl.h
udp_offload.c
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152
2019-05-30 11:26:32 -07:00
udplite.c
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152
2019-05-30 11:26:32 -07:00
xfrm6_input.c
xfrm6_output.c
xfrm: Always set XFRM_TRANSFORMED in xfrm{4,6}_output_finish
2020-04-29 16:33:11 +02:00
xfrm6_policy.c
net: add bool confirm_neigh parameter for dst_ops.update_pmtu
2020-01-04 19:18:58 +01:00
xfrm6_protocol.c
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152
2019-05-30 11:26:32 -07:00
xfrm6_state.c
xfrm: remove eth_proto value from xfrm_state_afinfo
2019-06-06 08:34:50 +02:00
xfrm6_tunnel.c