summaryrefslogtreecommitdiff
path: root/kernel/bpf/verifier.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2017-05-12 05:30:02 +0300
committerDavid S. Miller <davem@davemloft.net>2017-05-12 05:48:58 +0300
commit6832a333ed4a7cc4fcb170c045d1d96d0976fdd4 (patch)
tree61befd17c5dbb8c91c1e5593a56f82b97da752c3 /kernel/bpf/verifier.c
parent844cf763fba654436d3a4279b6a672c196cf1901 (diff)
downloadlinux-6832a333ed4a7cc4fcb170c045d1d96d0976fdd4.tar.xz
bpf: Handle multiple variable additions into packet pointers in verifier.
We must accumulate into reg->aux_off rather than use a plain assignment. Add a test for this situation to test_align. Reported-by: Alexei Starovoitov <ast@fb.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'kernel/bpf/verifier.c')
-rw-r--r--kernel/bpf/verifier.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index e74fb1b87855..39f2dcbc4cbc 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -1531,7 +1531,7 @@ add_imm:
dst_reg->id = ++env->id_gen;
/* something was added to pkt_ptr, set range to zero */
- dst_reg->aux_off = dst_reg->off;
+ dst_reg->aux_off += dst_reg->off;
dst_reg->off = 0;
dst_reg->range = 0;
if (had_id)