[PATCH 30/31] BPF: [TEMPORARY] Nerf BTF scalar value check

From: Tejun Heo
Date: Wed Nov 30 2022 - 03:27:35 EST


THIS IS A TEMPORARY WORKAROUND. WILL BE DROPPED.

This is needed for scx_example_atropos for now. This won't be needed once we
have generic BPF bitmask / cpumask helpers.

NOT_SIGNED_OFF
Cc: Alexei Starovoitov <ast@xxxxxxxxxx>
Cc: Dave Marchevsky <davemarchevsky@xxxxxxxx>
---
kernel/bpf/btf.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/kernel/bpf/btf.c b/kernel/bpf/btf.c
index 5579ff3a5b54..1dc5a6e5e530 100644
--- a/kernel/bpf/btf.c
+++ b/kernel/bpf/btf.c
@@ -6400,11 +6400,14 @@ static int btf_check_func_arg_match(struct bpf_verifier_env *env,
return ret;
}
}
-
+#warning "btf argument scalar test nerfed"
+ /*
if (reg->type == SCALAR_VALUE)
continue;
bpf_log(log, "R%d is not a scalar\n", regno);
return -EINVAL;
+ */
+ continue;
}

if (!btf_type_is_ptr(t)) {
--
2.38.1