projects
/
linux-block.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9887060
)
bpf: Fix maximum permitted number of arguments check
author
Yuntao Wang
<ytcoode@gmail.com>
Thu, 24 Mar 2022 16:42:38 +0000
(
00:42
+0800)
committer
Alexei Starovoitov
<ast@kernel.org>
Tue, 29 Mar 2022 02:08:17 +0000
(19:08 -0700)
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 <ytcoode@gmail.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Link:
https://lore.kernel.org/bpf/20220324164238.1274915-1-ytcoode@gmail.com
kernel/bpf/btf.c
patch
|
blob
|
blame
|
history
diff --git
a/kernel/bpf/btf.c
b/kernel/bpf/btf.c
index 24788ce564a08611dcc04f9f37acb520891537f0..0918a39279f6c2e9b7e58e0715594bf98fedee15 100644
(file)
--- a/
kernel/bpf/btf.c
+++ b/
kernel/bpf/btf.c
@@
-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);