]> git.baikalelectronics.ru Git - kernel.git/commit
net: stricter validation of untrusted gso packets
authorWillem de Bruijn <willemb@google.com>
Mon, 4 May 2020 16:48:54 +0000 (12:48 -0400)
committerDavid S. Miller <davem@davemloft.net>
Thu, 7 May 2020 00:23:06 +0000 (17:23 -0700)
commit5297fdf1071980d17488db4c85caabb65210d65a
tree0f46c00bd05149b9747ab50c1e290a56fb7b5ee6
parentea2a5fb8a05d36608363f23b31feecf0434c7d63
net: stricter validation of untrusted gso packets

Syzkaller again found a path to a kernel crash through bad gso input:
a packet with transport header extending beyond skb_headlen(skb).

Tighten validation at kernel entry:

- Verify that the transport header lies within the linear section.

    To avoid pulling linux/tcp.h, verify just sizeof tcphdr.
    tcp_gso_segment will call pskb_may_pull (th->doff * 4) before use.

- Match the gso_type against the ip_proto found by the flow dissector.

Fixes: 09a22ba4d6d4 ("packet: Add GSO/csum offload support.")
Reported-by: syzbot <syzkaller@googlegroups.com>
Signed-off-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/virtio_net.h