diff options
author | David S. Miller | 2017-05-11 19:30:02 -0700 |
---|---|---|
committer | David S. Miller | 2017-05-11 19:48:58 -0700 |
commit | 6832a333ed4a7cc4fcb170c045d1d96d0976fdd4 (patch) | |
tree | 61befd17c5dbb8c91c1e5593a56f82b97da752c3 /kernel/bpf | |
parent | 844cf763fba654436d3a4279b6a672c196cf1901 (diff) |
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')
-rw-r--r-- | kernel/bpf/verifier.c | 2 |
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) |