]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: rpl: fix rpl header size calculation
authorAlexander Aring <aahringo@redhat.com>
Mon, 17 Apr 2023 13:00:52 +0000 (09:00 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 Apr 2023 12:29:58 +0000 (14:29 +0200)
commit191642f5cfb38c0e44fb4783a37530bae15b8f8e
tree3e4c1e2d4483143e4f8609d2bfe79bc3ad0f8fcc
parentea471045145923d164ce4a5ffacbefa1c8bd8550
net: rpl: fix rpl header size calculation

[ Upstream commit 4e006c7a6dac0ead4c1bf606000aa90a372fc253 ]

This patch fixes a missing 8 byte for the header size calculation. The
ipv6_rpl_srh_size() is used to check a skb_pull() on skb->data which
points to skb_transport_header(). Currently we only check on the
calculated addresses fields using CmprI and CmprE fields, see:

https://www.rfc-editor.org/rfc/rfc6554#section-3

there is however a missing 8 byte inside the calculation which stands
for the fields before the addresses field. Those 8 bytes are represented
by sizeof(struct ipv6_rpl_sr_hdr) expression.

Fixes: 8610c7c6e3bd ("net: ipv6: add support for rpl sr exthdr")
Signed-off-by: Alexander Aring <aahringo@redhat.com>
Reported-by: maxpl0it <maxpl0it@protonmail.com>
Reviewed-by: David Ahern <dsahern@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/ipv6/rpl.c