]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
Fix write to cloned skb in ipv6_hop_ioam()
authorJustin Iurman <justin.iurman@uliege.be>
Mon, 19 Feb 2024 13:52:54 +0000 (14:52 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 1 Mar 2024 12:35:10 +0000 (13:35 +0100)
commit8fbc19196dbe710e2f54fad7fbb10d2fa8353832
treefb33efc2795b7f0610620a6c85ce879c20c9cb26
parent0a9f558c72c47472c38c05fcb72c70abb9104277
Fix write to cloned skb in ipv6_hop_ioam()

[ Upstream commit f198d933c2e4f8f89e0620fbaf1ea7eac384a0eb ]

ioam6_fill_trace_data() writes inside the skb payload without ensuring
it's writeable (e.g., not cloned). This function is called both from the
input and output path. The output path (ioam6_iptunnel) already does the
check. This commit provides a fix for the input path, inside
ipv6_hop_ioam(). It also updates ip6_parse_tlv() to refresh the network
header pointer ("nh") when returning from ipv6_hop_ioam().

Fixes: 9ee11f0fff20 ("ipv6: ioam: Data plane support for Pre-allocated Trace")
Reported-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Justin Iurman <justin.iurman@uliege.be>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/ipv6/exthdrs.c