diff options
| author | Vasily Averin <vvs@virtuozzo.com> | 2020-12-14 22:07:39 +0300 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-01-17 13:57:55 +0100 |
| commit | 031a414b80a9cbfa0a6d3f334e7299f6bfb1654b (patch) | |
| tree | 83849bbff3651176dcfee31d2169ed82d353656e /Makefile | |
| parent | b390ee66253c3fe89d481c93871f32a3712d49ac (diff) | |
| download | linux-031a414b80a9cbfa0a6d3f334e7299f6bfb1654b.tar.gz linux-031a414b80a9cbfa0a6d3f334e7299f6bfb1654b.tar.bz2 linux-031a414b80a9cbfa0a6d3f334e7299f6bfb1654b.zip | |
net: drop bogus skb with CHECKSUM_PARTIAL and offset beyond end of trimmed packet
commit 54970a2fbb673f090b7f02d7f57b10b2e0707155 upstream.
syzbot reproduces BUG_ON in skb_checksum_help():
tun creates (bogus) skb with huge partial-checksummed area and
small ip packet inside. Then ip_rcv trims the skb based on size
of internal ip packet, after that csum offset points beyond of
trimmed skb. Then checksum_tg() called via netfilter hook
triggers BUG_ON:
offset = skb_checksum_start_offset(skb);
BUG_ON(offset >= skb_headlen(skb));
To work around the problem this patch forces pskb_trim_rcsum_slow()
to return -EINVAL in described scenario. It allows its callers to
drop such kind of packets.
Link: https://syzkaller.appspot.com/bug?id=b419a5ca95062664fe1a60b764621eb4526e2cd0
Reported-by: syzbot+7010af67ced6105e5ab6@syzkaller.appspotmail.com
Signed-off-by: Vasily Averin <vvs@virtuozzo.com>
Acked-by: Willem de Bruijn <willemb@google.com>
Link: https://lore.kernel.org/r/1b2494af-2c56-8ee2-7bc0-923fcad1cdf8@virtuozzo.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'Makefile')
0 files changed, 0 insertions, 0 deletions
