net: create skb_gso_validate_mac_len()
authorDaniel Axtens <dja@axtens.net>
Thu, 14 Feb 2019 10:31:17 +0000 (11:31 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Feb 2019 09:20:48 +0000 (10:20 +0100)
commit785644d6731914407b87e70db00aca351a44a935
tree584631289f55fcbd4d1c1726cc98300b6f9954dd
parentdee92bc8c2761373b88f67bba87393ac50d8ceda
net: create skb_gso_validate_mac_len()

commit 2b16f048729bf35e6c28a40cbfad07239f9dcd90 upstream

If you take a GSO skb, and split it into packets, will the MAC
length (L2 + L3 + L4 headers + payload) of those packets be small
enough to fit within a given length?

Move skb_gso_mac_seglen() to skbuff.h with other related functions
like skb_gso_network_seglen() so we can use it, and then create
skb_gso_validate_mac_len to do the full calculation.

Signed-off-by: Daniel Axtens <dja@axtens.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
[jwang: cherry pick for CVE-2018-1000026]
Signed-off-by: Jack Wang <jinpu.wang@cloud.ionos.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
include/linux/skbuff.h
net/core/skbuff.c
net/sched/sch_tbf.c