summaryrefslogtreecommitdiff
path: root/net/bpf/test_run.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2025-03-08 00:54:06 +0100
committerIngo Molnar <mingo@kernel.org>2025-03-08 00:54:06 +0100
commitf23ecef20af6fbd489e0362d33cdf8d9429fa901 (patch)
tree713f06d8335b7c3388bbfbc46cb6d2a568951252 /net/bpf/test_run.c
parentc929d08df8bee855528b9d15b853c892c54e1eee (diff)
parent85b2b9c16d053364e2004883140538e73b333cdb (diff)
Merge branch 'locking/urgent' into locking/core, to pick up locking fixes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'net/bpf/test_run.c')
-rw-r--r--net/bpf/test_run.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/net/bpf/test_run.c b/net/bpf/test_run.c
index 8f6f7db48d4e..7cb192cbd65f 100644
--- a/net/bpf/test_run.c
+++ b/net/bpf/test_run.c
@@ -660,12 +660,9 @@ static void *bpf_test_init(const union bpf_attr *kattr, u32 user_size,
void __user *data_in = u64_to_user_ptr(kattr->test.data_in);
void *data;
- if (size < ETH_HLEN || size > PAGE_SIZE - headroom - tailroom)
+ if (user_size < ETH_HLEN || user_size > PAGE_SIZE - headroom - tailroom)
return ERR_PTR(-EINVAL);
- if (user_size > size)
- return ERR_PTR(-EMSGSIZE);
-
size = SKB_DATA_ALIGN(size);
data = kzalloc(size + headroom + tailroom, GFP_USER);
if (!data)