summaryrefslogtreecommitdiff
path: root/include/linux/bpf-cgroup.h
diff options
context:
space:
mode:
authorJohn Fastabend <john.fastabend@gmail.com>2020-03-31 00:38:21 +0300
committerAlexei Starovoitov <ast@kernel.org>2020-03-31 01:00:31 +0300
commit41f70fe0649dddf02046315dc566e06da5a2dc91 (patch)
tree891b4fa11cdd0212fe9f094af6d6a1e70cc679f9 /include/linux/bpf-cgroup.h
parent32f13a5add87caf11e9dd262372b4a2b79c57aa5 (diff)
downloadlinux-41f70fe0649dddf02046315dc566e06da5a2dc91.tar.xz
bpf: Test_verifier, add alu32 bounds tracking tests
Its possible to have divergent ALU32 and ALU64 bounds when using JMP32 instructins and ALU64 arithmatic operations. Sometimes the clang will even generate this code. Because the case is a bit tricky lets add a specific test for it. Here is pseudocode asm version to illustrate the idea, 1 r0 = 0xffffffff00000001; 2 if w0 > 1 goto %l[fail]; 3 r0 += 1 5 if w0 > 2 goto %l[fail] 6 exit The intent here is the verifier will fail the load if the 32bit bounds are not tracked correctly through ALU64 op. Similarly we can check the 64bit bounds are correctly zero extended after ALU32 ops. 1 r0 = 0xffffffff00000001; 2 w0 += 1 2 if r0 > 3 goto %l[fail]; 6 exit The above will fail if we do not correctly zero extend 64bit bounds after 32bit op. Signed-off-by: John Fastabend <john.fastabend@gmail.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Link: https://lore.kernel.org/bpf/158560430155.10843.514209255758200922.stgit@john-Precision-5820-Tower
Diffstat (limited to 'include/linux/bpf-cgroup.h')
0 files changed, 0 insertions, 0 deletions