aboutsummaryrefslogtreecommitdiffstats
path: root/net/bpf/test_run.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2021-07-23 15:59:46 +0100
committerDavid S. Miller <davem@davemloft.net>2021-07-23 16:13:06 +0100
commit5af84df962dd6699e3972fda7a0c8b579fb3ab04 (patch)
tree0a66f54c99c0c0d22588304d030ecb752487dfa1 /net/bpf/test_run.c
parentMerge branch 'net-remove-compat-alloc-user-space' (diff)
parentMerge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux (diff)
downloadlinux-dev-5af84df962dd6699e3972fda7a0c8b579fb3ab04.tar.xz
linux-dev-5af84df962dd6699e3972fda7a0c8b579fb3ab04.zip
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Conflicts are simple overlapping changes. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/bpf/test_run.c')
-rw-r--r--net/bpf/test_run.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/net/bpf/test_run.c b/net/bpf/test_run.c
index cda8375bbbaf..b488e2779718 100644
--- a/net/bpf/test_run.c
+++ b/net/bpf/test_run.c
@@ -761,6 +761,11 @@ int bpf_prog_test_run_xdp(struct bpf_prog *prog, const union bpf_attr *kattr,
void *data;
int ret = -EINVAL;
+ if (prog->expected_attach_type == BPF_XDP_DEVMAP ||
+ prog->expected_attach_type == BPF_XDP_CPUMAP)
+ return -EINVAL;
+ if (kattr->test.ctx_in || kattr->test.ctx_out)
+ return -EINVAL;
ctx = bpf_ctx_init(kattr, sizeof(struct xdp_md));
if (IS_ERR(ctx))
return PTR_ERR(ctx);