]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: Support all gso types in bpf_skb_change_proto()
authorMaciej Żenczykowski <maze@google.com>
Thu, 17 Jun 2021 00:09:52 +0000 (17:09 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Thu, 24 Jun 2021 13:57:44 +0000 (15:57 +0200)
commite04d3a688480942e5a288af1cefadae68a49c1f5
tree3c4312751f45bb8cdfd151737cc84526edef195c
parent9d5426f4ff6813cca0fd182ec8587b43f23458d9
bpf: Support all gso types in bpf_skb_change_proto()

Since we no longer modify gso_size, it is now theoretically
safe to not set SKB_GSO_DODGY and reset gso_segs to zero.

This also means the skb_is_gso_tcp() check should no longer
be necessary.

Unfortunately we cannot remove the skb_{decrease,increase}_gso_size()
helpers, as they are still used elsewhere:

  bpf_skb_net_grow() without BPF_F_ADJ_ROOM_FIXED_GSO
  bpf_skb_net_shrink() without BPF_F_ADJ_ROOM_FIXED_GSO
  net/core/lwt_bpf.c's handle_gso_type()

Signed-off-by: Maciej Żenczykowski <maze@google.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Cc: Dongseok Yi <dseok.yi@samsung.com>
Cc: Willem de Bruijn <willemb@google.com>
Link: https://lore.kernel.org/bpf/20210617000953.2787453-3-zenczykowski@gmail.com
net/core/filter.c