]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit539f19fe97b4fe827418412eae5abd566055f5b9
tree2659170370cdcb9036b4f151f5980569e897015e
parent1758c01f8362d3b3f087e52d7ab445502d4f24da
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