diff options
| author | Eric Dumazet <edumazet@kernel.org> | 2026-11-13 13:46:24 +0100 |
|---|---|---|
| committer | Paolo Abeni <pabeni@redhat.com> | 2026-11-19 13:10:27 +0100 |
| commit | 13391f1a8c584e7c1addaea3fd47105d92cc724c (patch) | |
| tree | 041404b2b47c8b492fe9e3647d4148a3506fa90a /tools/perf/scripts/python/bin | |
| parent | b9b77e2430032c21cc82b7da3a0bc0d8e74e6c26 (diff) | |
sctp: use skb_set_transport_header_careful() in sctp_v6_err()
skb->transport_header is a 16-bit offset from skb->head, and U16_MAX is
reserved as the "not set" value. skb_set_transport_header() silently
truncates an offset that does not fit.
sctp_v6_err() stores @offset, computed by icmpv6_notify() from the
extension headers of the packet embedded in an ICMPv6 error. Should
the value be truncated, sctp_err_lookup() would read the SCTP header
at the wrong place.
Since commit 3744b0964d52 ("ipv6: Implement limits on extension header
parsing") a single chain is bounded to IP6_MAX_EXT_HDRS_CNT headers
(24576 bytes), so this needs a large skb->data - skb->head on top of it,
for instance after several nested decapsulations, each of them possibly
pulling its own extension header chain, since @offset is relative to
the IPv6 header embedded in the ICMPv6 error. No reproducer was written,
this is hardening.
Use skb_set_transport_header_careful() and ignore the ICMPv6 error if
the offset can not be stored. Do this before changing the network
header, so that nothing has to be restored on failure.
Fixes: 1a37e412a022 ("net: Use 16bits for *_headers fields of struct skbuff")
Cc: stable@vger.kernel.org
Signed-off-by: Eric Dumazet <edumazet@kernel.org>
Link: https://patch.msgid.link/20261113124625.4010206-5-edumazet@kernel.org
Reviewed-by: Justin Iurman <justin.iurman@gmail.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'tools/perf/scripts/python/bin')
0 files changed, 0 insertions, 0 deletions
