diff options
| author | David S. Miller <davem@davemloft.net> | 2017-05-11 22:30:02 -0400 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2017-05-11 22:48:58 -0400 |
| commit | 6832a333ed4a7cc4fcb170c045d1d96d0976fdd4 (patch) | |
| tree | 61befd17c5dbb8c91c1e5593a56f82b97da752c3 /kernel | |
| 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')
| -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: | |||
| 1531 | dst_reg->id = ++env->id_gen; | 1531 | dst_reg->id = ++env->id_gen; |
| 1532 | 1532 | ||
| 1533 | /* something was added to pkt_ptr, set range to zero */ | 1533 | /* something was added to pkt_ptr, set range to zero */ |
| 1534 | dst_reg->aux_off = dst_reg->off; | 1534 | dst_reg->aux_off += dst_reg->off; |
| 1535 | dst_reg->off = 0; | 1535 | dst_reg->off = 0; |
| 1536 | dst_reg->range = 0; | 1536 | dst_reg->range = 0; |
| 1537 | if (had_id) | 1537 | if (had_id) |
