diff options
author | David S. Miller <davem@davemloft.net> | 2019-04-22 21:35:55 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-04-22 21:35:55 -0700 |
commit | 2843ba2ec75948e274d2c4f0a9390980e68a6461 (patch) | |
tree | b2fde70246956609ac43ad62026a4fdb48e33fbc /net/core/filter.c | |
parent | be659b8d3c79afc54e087ebf8d849685d7b0d395 (diff) | |
parent | f79b464fd6b56b6256de43bc4c7d5968c0e52968 (diff) | |
download | linux-2843ba2ec75948e274d2c4f0a9390980e68a6461.tar.gz linux-2843ba2ec75948e274d2c4f0a9390980e68a6461.tar.bz2 linux-2843ba2ec75948e274d2c4f0a9390980e68a6461.zip |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next
Alexei Starovoitov says:
====================
pull-request: bpf-next 2019-04-22
The following pull-request contains BPF updates for your *net-next* tree.
The main changes are:
1) allow stack/queue helpers from more bpf program types, from Alban.
2) allow parallel verification of root bpf programs, from Alexei.
3) introduce bpf sysctl hook for trusted root cases, from Andrey.
4) recognize var/datasec in btf deduplication, from Andrii.
5) cpumap performance optimizations, from Jesper.
6) verifier prep for alu32 optimization, from Jiong.
7) libbpf xsk cleanup, from Magnus.
8) other various fixes and cleanups.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/filter.c')
-rw-r--r-- | net/core/filter.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/net/core/filter.c b/net/core/filter.c index 1644a16afcec..fa8fb0548217 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, { int ret; + if (flags & ~BPF_F_ADJ_ROOM_FIXED_GSO) + return -EINVAL; + if (skb_is_gso(skb) && !skb_is_gso_tcp(skb)) { /* udp gso_size delineates datagrams, only allow if fixed */ if (!(skb_shinfo(skb)->gso_type & SKB_GSO_UDP_L4) || @@ -4434,8 +4437,7 @@ BPF_CALL_2(bpf_sock_ops_cb_flags_set, struct bpf_sock_ops_kern *, bpf_sock, if (!IS_ENABLED(CONFIG_INET) || !sk_fullsock(sk)) return -EINVAL; - if (val) - tcp_sk(sk)->bpf_sock_ops_cb_flags = val; + tcp_sk(sk)->bpf_sock_ops_cb_flags = val; return argval & (~BPF_SOCK_OPS_ALL_CB_FLAGS); } |