diff options
author | Joe Stringer <joe@wand.net.nz> | 2018-10-02 13:35:35 -0700 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2018-10-03 02:53:47 +0200 |
commit | fd978bf7fd312581a7ca454a991f0ffb34c4204b (patch) | |
tree | 5f5cd39c65ff6f3839c78ce39684da93e1252cf3 /net | |
parent | 84dbf3507349696b505b6a500722538b0683e4ac (diff) |
bpf: Add reference tracking to verifier
Allow helper functions to acquire a reference and return it into a
register. Specific pointer types such as the PTR_TO_SOCKET will
implicitly represent such a reference. The verifier must ensure that
these references are released exactly once in each path through the
program.
To achieve this, this commit assigns an id to the pointer and tracks it
in the 'bpf_func_state', then when the function or program exits,
verifies that all of the acquired references have been freed. When the
pointer is passed to a function that frees the reference, it is removed
from the 'bpf_func_state` and all existing copies of the pointer in
registers are marked invalid.
Signed-off-by: Joe Stringer <joe@wand.net.nz>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'net')
0 files changed, 0 insertions, 0 deletions