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
..
bpfilter
netfilter
netfilter: nf_conntrack_pptp: prevent buffer overflows in debug code
2020-06-03 08:21:35 +02:00
af_inet.c
net: remove empty inet_exit_net
2019-08-19 18:22:54 -07:00
ah4.c
arp.c
cipso_ipv4.c
netlabel: cope with NULL catmap
2020-05-20 08:20:08 +02:00
datagram.c
inet: stop leaking jiffies on the wire
2019-11-01 14:57:52 -07:00
devinet.c
devinet: fix memleak in inetdev_init()
2020-06-10 20:24:54 +02:00
esp4.c
xfrm: remove get_mtu indirection from xfrm_type
2019-07-01 06:16:40 +02:00
esp4_offload.c
xfrm: remove the xfrm_state_put call becofe going to out_reset
2020-06-03 08:21:32 +02:00
fib_frontend.c
ipv4: nexthop version of fib_info_nh_uses_dev
2020-06-03 08:21:37 +02:00
fib_lookup.h
fib_notifier.c
fib_rules.c
fib_semantics.c
net: Fix the arp error in some cases
2020-06-30 15:36:44 -04:00
fib_trie.c
ipv4: fix a RCU-list lock in fib_triestat_seq_show
2020-06-17 16:40:24 +02:00
fou.c
fou: Fix IPv6 netlink policy
2020-01-29 16:45:22 +01:00
gre_demux.c
gre: fix uninit-value in __iptunnel_pull_header
2020-03-18 07:17:38 +01:00
gre_offload.c
icmp.c
ip: Fix SO_MARK in RST, ACK and ICMP packets
2020-07-22 09:32:50 +02:00
igmp.c
net: fix __ip_mc_inc_group usage
2019-08-20 12:48:06 -07:00
inet_connection_sock.c
net: inet_csk: Fix so_reuseport bind-address cache in tb->fast*
2020-06-03 08:20:48 +02:00
inet_diag.c
inet_diag: return classid for all socket types
2020-03-18 07:17:38 +01:00
inet_fragment.c
inet: frags: re-introduce skb coalescing for local delivery
2019-08-08 15:55:10 -07:00
inet_hashtables.c
tcp/dccp: fix possible race __inet_lookup_established()
2020-01-04 19:19:13 +01:00
inet_timewait_sock.c
inetpeer.c
inetpeer: fix data-race in inet_putpeer / inet_putpeer
2020-01-04 19:18:39 +01:00
ip_forward.c
ipv4: Revert removal of rt_uses_gateway
2019-09-20 18:23:33 -07:00
ip_fragment.c
inet: frags: re-introduce skb coalescing for local delivery
2019-08-08 15:55:10 -07:00
ip_gre.c
net: ip_gre: Accept IFLA_INFO_DATA-less configuration
2020-04-01 11:01:46 +02:00
ip_input.c
netfilter: drop bridge nf reset from nf_reset
2019-10-01 18:42:15 +02:00
ip_options.c
ip_output.c
ip: Fix SO_MARK in RST, ACK and ICMP packets
2020-07-22 09:32:50 +02:00
ip_sockglue.c
ip_tunnel.c
ip_tunnel: fix use-after-free in ip_tunnel_lookup()
2020-06-30 15:36:46 -04:00
ip_tunnel_core.c
ip_vti.c
ip_vti: receive ipip packet by calling ip_tunnel_rcv
2020-06-03 08:21:34 +02:00
ipcomp.c
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec-next
2019-07-05 15:01:15 -07:00
ipconfig.c
ipip.c
net: ipip: fix wrong address family in init error path
2020-06-03 08:20:52 +02:00
ipmr.c
net: don't return invalid table id error when we fall back to PF_UNSPEC
2020-06-03 08:20:41 +02:00
ipmr_base.c
Kconfig
vti[6]: fix packet tx through bpf_redirect() in XinY cases
2020-04-01 11:02:05 +02:00
Makefile
metrics.c
netfilter.c
netlink.c
nexthop.c
nexthops: don't modify published nexthop groups
2020-06-03 08:21:37 +02:00
ping.c
ipv4: fill fl4_icmp_{type,code} in ping_v4_sendmsg
2020-07-22 09:32:47 +02:00
proc.c
protocol.c
raw.c
netfilter: drop bridge nf reset from nf_reset
2019-10-01 18:42:15 +02:00
raw_diag.c
inet_diag: return classid for all socket types
2020-03-18 07:17:38 +01:00
route.c
net: revert "net: get rid of an signed integer overflow in ip_idents_reserve()"
2020-06-03 08:21:00 +02:00
syncookies.c
sysctl_net_ipv4.c
net/ipv4: fix sysctl max for fib_multipath_hash_policy
2019-11-18 17:25:36 -08:00
tcp.c
tcp: md5: allow changing MD5 keys in all socket states
2020-07-22 09:32:49 +02:00
tcp_bbr.c
tcp_bbr: improve arithmetic division in bbr_update_bw()
2020-01-29 16:45:21 +01:00
tcp_bic.c
tcp_bpf.c
bpf/sockmap: Fix kernel panic at __tcp_bpf_recvmsg
2020-06-24 17:50:42 +02:00
tcp_cdg.c
tcp_cong.c
tcp: make sure listeners don't initialize congestion-control state
2020-07-22 09:32:48 +02:00
tcp_cubic.c
tcp_cubic: fix spurious HYSTART_DELAY exit upon drop in min RTT
2020-06-30 15:36:47 -04:00
tcp_dctcp.c
tcp_dctcp.h
tcp_diag.c
tcp: annotate tp->write_seq lockless reads
2019-10-13 10:13:08 -07:00
tcp_fastopen.c
tcp: add rcu protection around tp->fastopen_rsk
2019-10-13 10:13:08 -07:00
tcp_highspeed.c
tcp_htcp.c
tcp_hybla.c
tcp_illinois.c
tcp_input.c
tcp: fix SO_RCVLOWAT possible hangs under high mem pressure
2020-07-22 09:32:48 +02:00
tcp_ipv4.c
tcp: md5: refine tcp_md5_do_add()/tcp_md5_hash_key() barriers
2020-07-22 09:32:49 +02:00
tcp_lp.c
tcp_metrics.c
tcp_minisocks.c
tcp: annotate tp->snd_nxt lockless reads
2019-10-13 10:13:08 -07:00
tcp_nv.c
tcp_offload.c
tcp_output.c
tcp: md5: do not send silly options in SYNCOOKIES
2020-07-22 09:32:49 +02:00
tcp_rate.c
tcp_recovery.c
tcp_scalable.c
tcp_timer.c
tcp: add rcu protection around tp->fastopen_rsk
2019-10-13 10:13:08 -07:00
tcp_ulp.c
bpf: Sockmap/tls, push write_space updates through ulp updates
2020-01-23 08:22:45 +01:00
tcp_vegas.c
tcp_vegas.h
tcp_veno.c
tcp_westwood.c
tcp_yeah.c
tunnel4.c
udp.c
udp: rehash on disconnect
2020-03-05 16:43:33 +01:00
udp_diag.c
inet_diag: return classid for all socket types
2020-03-18 07:17:38 +01:00
udp_impl.h
udp_offload.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
2019-06-22 08:59:24 -04:00
udp_tunnel.c
udplite.c
xfrm4_input.c
xfrm4_output.c
xfrm: Always set XFRM_TRANSFORMED in xfrm{4,6}_output_finish
2020-04-29 16:33:11 +02:00
xfrm4_policy.c
net: add bool confirm_neigh parameter for dst_ops.update_pmtu
2020-01-04 19:18:58 +01:00
xfrm4_protocol.c
xfrm4_state.c
xfrm4_tunnel.c