commit | 121d57af308d0cf943f08f4738d24d3966c38cd9 | [log] [tgz] |
---|---|---|
author | Willem de Bruijn <[email protected]> | Fri Jan 19 09:29:18 2018 -0500 |
committer | David S. Miller <[email protected]> | Mon Jan 22 16:01:30 2018 -0500 |
tree | 6089dfcad08b4d02fe8e8082f2d278a5cbec05a3 | |
parent | 7c68d1a6b4db9012790af7ac0f0fdc0d2083422a [diff] [blame] |
gso: validate gso_type in GSO handlers Validate gso_type during segmentation as SKB_GSO_DODGY sources may pass packets where the gso_type does not match the contents. Syzkaller was able to enter the SCTP gso handler with a packet of gso_type SKB_GSO_TCPV4. On entry of transport layer gso handlers, verify that the gso_type matches the transport protocol. Fixes: 90017accff61 ("sctp: Add GSO support") Link: http://lkml.kernel.org/r/<[email protected]> Reported-by: [email protected] Signed-off-by: Willem de Bruijn <[email protected]> Acked-by: Jason Wang <[email protected]> Reviewed-by: Marcelo Ricardo Leitner <[email protected]> Signed-off-by: David S. Miller <[email protected]>
diff --git a/net/ipv4/esp4_offload.c b/net/ipv4/esp4_offload.c index b1338e57..29b333a 100644 --- a/net/ipv4/esp4_offload.c +++ b/net/ipv4/esp4_offload.c
@@ -122,6 +122,9 @@ static struct sk_buff *esp4_gso_segment(struct sk_buff *skb, if (!xo) goto out; + if (!(skb_shinfo(skb)->gso_type & SKB_GSO_ESP)) + goto out; + seq = xo->seq.low; x = skb->sp->xvec[skb->sp->len - 1];