bpf/tests: Add tests of BPF_LDX and BPF_STX with small sizes
authorJohan Almbladh <johan.almbladh@anyfinetworks.com>
Fri, 1 Oct 2021 13:03:39 +0000 (15:03 +0200)
committerDaniel Borkmann <daniel@iogearbox.net>
Fri, 1 Oct 2021 15:04:25 +0000 (17:04 +0200)
commitcaaaa1667bf198c54cc3141ad92ca6ce853e99cd
tree2659170370cdcb9036b4f151f5980569e897015e
parent6bbc7103738f0e0871a9331351ee3cd4d462b431
bpf/tests: Add tests of BPF_LDX and BPF_STX with small sizes

This patch adds a series of tests to verify the behavior of BPF_LDX and
BPF_STX with BPF_B//W sizes in isolation. In particular, it checks that
BPF_LDX zero-extendeds the result, and that BPF_STX does not overwrite
adjacent bytes in memory.

BPF_ST and operations on BPF_DW size are deemed to be sufficiently
tested by existing tests.

Signed-off-by: Johan Almbladh <johan.almbladh@anyfinetworks.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20211001130348.3670534-2-johan.almbladh@anyfinetworks.com
lib/test_bpf.c