OSDN Git Service

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)
commit0bc919d3e0b8149a60d2444c6a8e2b5974556522
tree3c4312751f45bb8cdfd151737cc84526edef195c
parent364745fbe981a4370f50274475da4675661104df
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