summaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorDaniel Borkmann <daniel@iogearbox.net>2020-11-13 01:42:12 +0100
committerDaniel Borkmann <daniel@iogearbox.net>2020-11-13 01:42:57 +0100
commit0a58a65cc0b0ebabbcf3cdae7642e6db29648164 (patch)
tree9c3d86a8186c1284faf76bdbc98f60d720cd2b28 /include/linux
parentc36538798fc6c80bd8bdaddad803b0c86dc13d7c (diff)
parentcb62d34019d9117bb94de6ed35959449d43d6055 (diff)
downloadcachepc-linux-0a58a65cc0b0ebabbcf3cdae7642e6db29648164.tar.gz
cachepc-linux-0a58a65cc0b0ebabbcf3cdae7642e6db29648164.zip
Merge branch 'bpf-ptrs-beyond-pkt-end'
Alexei Starovoitov says: ==================== v1->v2: - removed set-but-unused variable. - added Jiri's Tested-by. In some cases LLVM uses the knowledge that branch is taken to optimze the code which causes the verifier to reject valid programs. Teach the verifier to recognize that r1 = skb->data; r1 += 10; r2 = skb->data_end; if (r1 > r2) { here r1 points beyond packet_end and subsequent if (r1 > r2) // always evaluates to "true". } ==================== Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/bpf_verifier.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/bpf_verifier.h b/include/linux/bpf_verifier.h
index e83ef6f6bf43..306869d4743b 100644
--- a/include/linux/bpf_verifier.h
+++ b/include/linux/bpf_verifier.h
@@ -45,7 +45,7 @@ struct bpf_reg_state {
enum bpf_reg_type type;
union {
/* valid when type == PTR_TO_PACKET */
- u16 range;
+ int range;
/* valid when type == CONST_PTR_TO_MAP | PTR_TO_MAP_VALUE |
* PTR_TO_MAP_VALUE_OR_NULL