diff options
author | Stanislav Fomichev <sdf@google.com> | 2020-06-17 03:04:15 +0200 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2020-06-17 19:54:05 +0200 |
commit | a0cb12b03132befbdb29d835ca330c18792e8134 (patch) | |
tree | c7fc8a91361a361fb6a56bb024203c834bb9d5b3 /Documentation/bpf/btf.rst | |
parent | bpf: Don't return EINVAL from {get,set}sockopt when optlen > PAGE_SIZE (diff) | |
download | linux-a0cb12b03132befbdb29d835ca330c18792e8134.tar.xz linux-a0cb12b03132befbdb29d835ca330c18792e8134.zip |
selftests/bpf: Make sure optvals > PAGE_SIZE are bypassed
We are relying on the fact, that we can pass > sizeof(int) optvals
to the SOL_IP+IP_FREEBIND option (the kernel will take first 4 bytes).
In the BPF program we check that we can only touch PAGE_SIZE bytes,
but the real optlen is PAGE_SIZE * 2. In both cases, we override it to
some predefined value and trim the optlen.
Also, let's modify exiting IP_TOS usecase to test optlen=0 case
where BPF program just bypasses the data as is.
Signed-off-by: Stanislav Fomichev <sdf@google.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20200617010416.93086-2-sdf@google.com
Diffstat (limited to 'Documentation/bpf/btf.rst')
0 files changed, 0 insertions, 0 deletions