]> git.ipfire.org Git - thirdparty/valgrind.git/commit
Add file descriptor tracking in wrappers for bpf system call
authorQuentin Monnet <quentin.monnet@netronome.com>
Sat, 14 Apr 2018 22:56:37 +0000 (23:56 +0100)
committerTom Hughes <tom@compton.nu>
Tue, 14 Aug 2018 19:47:19 +0000 (20:47 +0100)
commit0097176525896f377a4a0686b928e2ba570e5ad4
tree51757a67ce173c3a47b71f03a59b66a4f1611a2d
parent1d933b5a4afdbc2eff2fc27027847998b84393c5
Add file descriptor tracking in wrappers for bpf system call

Support for the bpf system call was added in a previous commit, but
did not include tracking for file descriptors handled by the call.

Add checks and tracking for file descriptors. Check in PRE() wrapper
that all file descriptors (pointing to object such as eBPF programs or
maps, cgroups, or raw tracepoints) used by the system call are valid,
then add tracking in POST() wrapper for newly produced file descriptors.

As the file descriptors are not always processed in the same way by the
bpf call, add to the header file some additional definitions from bpf.h
that are necessary to sort out under what conditions descriptors should
be checked in the PRE() helper.
coregrind/m_syswrap/syswrap-linux.c
include/vki/vki-linux.h