bpf: Fix maximum permitted number of arguments check
Subsystems (3)
PATCH 1/1 bpf: Fix maximum permitted number of arguments check
Since the m->arg_size array can hold up to MAX_BPF_FUNC_ARGS argument sizes, it's ok that nargs is equal to MAX_BPF_FUNC_ARGS.
Signed-off-by Yuntao Wang <[email protected]>
--- kernel/bpf/btf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/bpf/btf.c +1 -1
@@ -5507,7 +5507,7 @@ int btf_distill_func_proto(struct bpf_verifier_log *log, } args = (const struct btf_param *)(func +1 ); nargs =btf_type_vlen (func); -if (nargs >=MAX_BPF_FUNC_ARGS ) { +if (nargs >MAX_BPF_FUNC_ARGS ) {bpf_log (log,"The function %s has %d arguments. Too many.\n" , tname, nargs);
Signature · 1 line
2.35.1
Quoted 2 lines · Yuntao Wang
Since the
m->arg_sizearray can hold up toMAX_BPF_FUNC_ARGSargument sizes, it's ok that nargs is equal toMAX_BPF_FUNC_ARGS.
Acked-by Martin KaFai Lau <[email protected]>
This patch was applied to bpf/bpf.git (master) by Alexei Starovoitov <[email protected]>:
Hello:
This patch was applied to bpf/bpf.git (master)
by Alexei Starovoitov <[email protected]>:
Quoted 7 lines · On Fri, 25 Mar 2022 00:42:38 +0800 you wrote:
Since the
m->arg_sizearray can hold up toMAX_BPF_FUNC_ARGSargument sizes, it's ok that nargs is equal toMAX_BPF_FUNC_ARGS.Signed-off-by Yuntao Wang <[email protected]>--- kernel/bpf/btf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Here is the summary with links:
- [bpf-next] bpf: Fix maximum permitted number of arguments check
https://git.kernel.org/bpf/bpf/c/c29a4920dfca
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html