aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWillem de Bruijn <willemb@google.com>2019-04-12 09:30:48 -0400
committerDaniel Borkmann <daniel@iogearbox.net>2019-04-16 03:56:20 -0400
commit43537b8e2dc515e037e855504db3f6c7cf73c79f (patch)
tree942457b168dbd56db51eeaeaa76fb792e09149b0
parentbfb35c27c65fce60a12e188135ae1344d1b89e24 (diff)
bpf: reserve flags in bpf_skb_net_shrink
The ENCAP flags in bpf_skb_adjust_room are ignored on decap with bpf_skb_net_shrink. Reserve these bits for future use. Fixes: 868d523535c2d ("bpf: add bpf_skb_adjust_room encap flags") Signed-off-by: Willem de Bruijn <willemb@google.com> Reviewed-by: Alan Maguire <alan.maguire@oracle.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
-rw-r--r--net/core/filter.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/core/filter.c b/net/core/filter.c
index 95a27fdf9a40..bd1f51907b83 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -3069,6 +3069,9 @@ static int bpf_skb_net_shrink(struct sk_buff *skb, u32 off, u32 len_diff,
3069{ 3069{
3070 int ret; 3070 int ret;
3071 3071
3072 if (flags & ~BPF_F_ADJ_ROOM_FIXED_GSO)
3073 return -EINVAL;
3074
3072 if (skb_is_gso(skb) && !skb_is_gso_tcp(skb)) { 3075 if (skb_is_gso(skb) && !skb_is_gso_tcp(skb)) {
3073 /* udp gso_size delineates datagrams, only allow if fixed */ 3076 /* udp gso_size delineates datagrams, only allow if fixed */
3074 if (!(skb_shinfo(skb)->gso_type & SKB_GSO_UDP_L4) || 3077 if (!(skb_shinfo(skb)->gso_type & SKB_GSO_UDP_L4) ||