From 5ec15cdd1e9c1c17bd23738399042f3a550eaea9 Mon Sep 17 00:00:00 2001 From: Ksawlii <ksawery.blaszczak@proton.me> Date: Sun, 24 Nov 2024 00:22:59 +0100 Subject: [PATCH] Revert "bpf: Check percpu map value size first" This reverts commit 22c88ba3ccf33da0821244a2eadf0562df45d63c. --- kernel/bpf/arraymap.c | 3 --- kernel/bpf/hashtab.c | 3 --- 2 files changed, 6 deletions(-) diff --git a/kernel/bpf/arraymap.c b/kernel/bpf/arraymap.c index 3d92e42c3..510233812 100755 --- a/kernel/bpf/arraymap.c +++ b/kernel/bpf/arraymap.c @@ -74,9 +74,6 @@ int array_map_alloc_check(union bpf_attr *attr) * access the elements. */ return -E2BIG; - /* percpu map value size is bound by PCPU_MIN_UNIT_SIZE */ - if (percpu && round_up(attr->value_size, 8) > PCPU_MIN_UNIT_SIZE) - return -E2BIG; return 0; } diff --git a/kernel/bpf/hashtab.c b/kernel/bpf/hashtab.c index 4c7cab79d..72bc5f575 100755 --- a/kernel/bpf/hashtab.c +++ b/kernel/bpf/hashtab.c @@ -404,9 +404,6 @@ static int htab_map_alloc_check(union bpf_attr *attr) * kmalloc-able later in htab_map_update_elem() */ return -E2BIG; - /* percpu map value size is bound by PCPU_MIN_UNIT_SIZE */ - if (percpu && round_up(attr->value_size, 8) > PCPU_MIN_UNIT_SIZE) - return -E2BIG; return 0; }