Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0c214393 authored by Mathieu Xhonneux's avatar Mathieu Xhonneux Committed by Greg Kroah-Hartman
Browse files

ipv6: sr: fix TLVs not being copied using setsockopt




[ Upstream commit ccc12b11 ]

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: a149e7c7 ("ipv6: sr: add support for SRH injection through setsockopt")
Acked-by: default avatarDavid Lebrun <dlebrun@google.com>
Signed-off-by: default avatarMathieu Xhonneux <m.xhonneux@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 71e7f85e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment