linux/net/ipv6
Mathieu Xhonneux ccc12b11c5 ipv6: sr: fix TLVs not being copied using setsockopt
Function ipv6_push_rthdr4 allows to add an IPv6 Segment Routing Header
to a socket through setsockopt, but the current implementation doesn't
copy possible TLVs at the end of the SRH received from userspace.

Therefore, the execution of the following branch if (sr_has_hmac(sr_phdr))
{ ... } will never complete since the len and type fields of a possible
HMAC TLV are not copied, hence seg6_get_tlv_hmac will return an error,
and the HMAC will not be computed.

This commit adds a memcpy in case TLVs have been appended to the SRH.

Fixes: a149e7c7ce ("ipv6: sr: add support for SRH injection through setsockopt")
Acked-by: David Lebrun <dlebrun@google.com>
Signed-off-by: Mathieu Xhonneux <m.xhonneux@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-10 16:03:55 -05:00
..
ila
netfilter netfilter: ip6t_MASQUERADE: add dependency on conntrack module 2017-12-11 17:04:50 +01:00
Kconfig
Makefile
addrconf.c treewide: setup_timer() -> timer_setup() 2017-11-21 15:57:07 -08:00
addrconf_core.c
addrlabel.c
af_inet6.c net: reevalulate autoflowlabel setting after sysctl setting 2017-12-21 13:07:20 -05:00
ah6.c
anycast.c
calipso.c
datagram.c
esp6.c
esp6_offload.c
exthdrs.c ipv6: sr: fix TLVs not being copied using setsockopt 2018-01-10 16:03:55 -05:00
exthdrs_core.c
exthdrs_offload.c
fib6_notifier.c
fib6_rules.c
fou6.c
icmp.c
inet6_connection_sock.c
inet6_hashtables.c
ip6_checksum.c
ip6_fib.c ipv6: remove null_entry before adding default route 2018-01-09 12:33:55 -05:00
ip6_flowlabel.c treewide: Switch DEFINE_TIMER callbacks to struct timer_list * 2017-11-21 15:57:05 -08:00
ip6_gre.c ip6_gre: fix device features for ioctl setup 2017-12-26 12:21:19 -05:00
ip6_icmp.c
ip6_input.c
ip6_offload.c
ip6_offload.h
ip6_output.c ipv6: fix possible mem leaks in ipv6_make_skb() 2018-01-10 16:01:25 -05:00
ip6_tunnel.c ip6_tunnel: allow ip6gre dev mtu to be set below 1280 2018-01-02 12:36:14 -05:00
ip6_udp_tunnel.c
ip6_vti.c
ip6mr.c treewide: setup_timer() -> timer_setup() 2017-11-21 15:57:07 -08:00
ipcomp6.c
ipv6_sockglue.c net: reevalulate autoflowlabel setting after sysctl setting 2017-12-21 13:07:20 -05:00
mcast.c ipv6: mcast: better catch silly mtu values 2017-12-13 13:13:15 -05:00
mcast_snoop.c
mip6.c
ndisc.c
netfilter.c
output_core.c net: accept UFO datagrams from tuntap and packet 2017-11-24 01:37:35 +09:00
ping.c
proc.c
protocol.c
raw.c
reassembly.c
route.c ipv6: Honor specified parameters in fibmatch lookup 2017-12-21 11:51:06 -05:00
seg6.c
seg6_hmac.c
seg6_iptunnel.c
seg6_local.c
sit.c sit: update frag_off info 2017-11-30 10:25:41 -05:00
syncookies.c
sysctl_net_ipv6.c
tcp_ipv6.c tcp md5sig: Use skb's saddr when replying to an incoming segment 2017-12-12 11:15:42 -05:00
tcpv6_offload.c
tunnel6.c
udp.c
udp_impl.h
udp_offload.c net: accept UFO datagrams from tuntap and packet 2017-11-24 01:37:35 +09:00
udplite.c
xfrm6_input.c xfrm: Reinject transport-mode packets through tasklet 2017-12-19 08:23:21 +01:00
xfrm6_mode_beet.c
xfrm6_mode_ro.c
xfrm6_mode_transport.c
xfrm6_mode_tunnel.c
xfrm6_output.c
xfrm6_policy.c
xfrm6_protocol.c
xfrm6_state.c
xfrm6_tunnel.c