diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/core/filter.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/net/core/filter.c b/net/core/filter.c index 647b12265e18..e6cde173851d 100644 --- a/net/core/filter.c +++ b/net/core/filter.c @@ -728,6 +728,11 @@ int bpf_check_classic(const struct sock_filter *filter, unsigned int flen) if (ftest->k == 0) return -EINVAL; break; + case BPF_ALU | BPF_LSH | BPF_K: + case BPF_ALU | BPF_RSH | BPF_K: + if (ftest->k >= 32) + return -EINVAL; + break; case BPF_LD | BPF_MEM: case BPF_LDX | BPF_MEM: case BPF_ST: |