aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/samples
diff options
context:
space:
mode:
authorStanislav Fomichev <sdf@google.com>2020-06-16 18:04:15 -0700
committerAlexei Starovoitov <ast@kernel.org>2020-06-17 10:54:05 -0700
commita0cb12b03132befbdb29d835ca330c18792e8134 (patch)
treec7fc8a91361a361fb6a56bb024203c834bb9d5b3 /samples
parentbpf: Don't return EINVAL from {get,set}sockopt when optlen > PAGE_SIZE (diff)
downloadwireguard-linux-a0cb12b03132befbdb29d835ca330c18792e8134.tar.xz
wireguard-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 'samples')
0 files changed, 0 insertions, 0 deletions