OSDN Git Service

gso: validate gso_type in GSO handlers
authorWillem de Bruijn <willemb@google.com>
Fri, 19 Jan 2018 14:29:18 +0000 (09:29 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 31 Jan 2018 13:03:47 +0000 (14:03 +0100)
commitdd7e1cbd26183e4b8c816fb8b9ecc6356b0cb19d
tree685b975da61719ddf5425beab47eb446530c650e
parent8af27b14b9c9028ad486b7f73c7466164d20ae40
gso: validate gso_type in GSO handlers

[ Upstream commit 121d57af308d0cf943f08f4738d24d3966c38cd9 ]

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/<001a1137452496ffc305617e5fe0@google.com>
Reported-by: syzbot+fee64147a25aecd48055@syzkaller.appspotmail.com
Signed-off-by: Willem de Bruijn <willemb@google.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Reviewed-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/ipv4/esp4_offload.c
net/ipv4/tcp_offload.c
net/ipv4/udp_offload.c
net/ipv6/esp6_offload.c
net/ipv6/tcpv6_offload.c
net/ipv6/udp_offload.c
net/sctp/offload.c