]> git.baikalelectronics.ru Git - kernel.git/commit
netfilter: nft_exthdr: Fix for unsafe packet data read
authorPhil Sutter <phil@nwl.cc>
Tue, 8 Jun 2021 09:40:57 +0000 (11:40 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Wed, 9 Jun 2021 00:42:52 +0000 (02:42 +0200)
commit356fb85f08ade50a93550cf34edda748bc45f003
treebf2d722476e0f24697c80ca97d77172fe4caea26
parent4d45a1287f09e862dc242d05fb53601d617ac10e
netfilter: nft_exthdr: Fix for unsafe packet data read

While iterating through an SCTP packet's chunks, skb_header_pointer() is
called for the minimum expected chunk header size. If (that part of) the
skbuff is non-linear, the following memcpy() may read data past
temporary buffer '_sch'. Use skb_copy_bits() instead which does the
right thing in this situation.

Fixes: c13c90f3f4319 ("netfilter: nft_exthdr: Support SCTP chunks")
Suggested-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Phil Sutter <phil@nwl.cc>
Reviewed-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nft_exthdr.c