]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: only adjust gso_size on bytestream protocols
authorWillem de Bruijn <willemb@google.com>
Thu, 7 Feb 2019 19:54:16 +0000 (14:54 -0500)
committerAlexei Starovoitov <ast@kernel.org>
Mon, 11 Feb 2019 03:57:34 +0000 (19:57 -0800)
commitedec43af39e5bfde1ff7f27b08adcaa2390ab26e
tree80309f233c9c0c374e9c8b9832f21fc44b8590c4
parent3f94b89e18fdf6a019347b3884158eac2c3bdf78
bpf: only adjust gso_size on bytestream protocols

bpf_skb_change_proto and bpf_skb_adjust_room change skb header length.
For GSO packets they adjust gso_size to maintain the same MTU.

The gso size can only be safely adjusted on bytestream protocols.
Commit ff2ca95de440 ("bpf: fix bpf_skb_adjust_net/bpf_skb_proto_xlat
to deal with gso sctp skbs") excluded SKB_GSO_SCTP.

Since then type SKB_GSO_UDP_L4 has been added, whose contents are one
gso_size unit per datagram. Also exclude these.

Move from a blacklist to a whitelist check to future proof against
additional such new GSO types, e.g., for fraglist based GRO.

Fixes: a388728846a0 ("udp: generate gso with UDP_SEGMENT")
Signed-off-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
include/linux/skbuff.h
net/core/filter.c