]> git.baikalelectronics.ru Git - kernel.git/commit
selftests/bpf: Validate frozen map contents stays frozen
authorAndrii Nakryiko <andriin@fb.com>
Fri, 10 Apr 2020 20:26:13 +0000 (13:26 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Tue, 14 Apr 2020 19:28:57 +0000 (21:28 +0200)
commit02ee1cafee15c055005c45e239ff0ecb7ee271b2
tree766a7490a2cdb507523f1369f73ec902fb699e85
parentf29508e06c4789355bb5fe424090c8f5c05c2fb2
selftests/bpf: Validate frozen map contents stays frozen

Test that frozen and mmap()'ed BPF map can't be mprotect()'ed as writable or
executable memory. Also validate that "downgrading" from writable to read-only
doesn't screw up internal writable count accounting for the purposes of map
freezing.

Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20200410202613.3679837-2-andriin@fb.com
tools/testing/selftests/bpf/prog_tests/mmap.c