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:
b77ef5b
)
bpf: Adjust BTF log size limit.
author
Alexei Starovoitov
<ast@kernel.org>
Wed, 1 Dec 2021 18:10:29 +0000
(10:10 -0800)
committer
Greg Kroah-Hartman
<gregkh@linuxfoundation.org>
Thu, 27 Jan 2022 09:53:54 +0000
(10:53 +0100)
[ Upstream commit
c5a2d43e998a821701029f23e25b62f9188e93ff
]
Make BTF log size limit to be the same as the verifier log size limit.
Otherwise tools that progressively increase log size and use the same log
for BTF loading and program loading will be hitting hard to debug EINVAL.
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link:
https://lore.kernel.org/bpf/20211201181040.23337-7-alexei.starovoitov@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
kernel/bpf/btf.c
patch
|
blob
|
blame
|
history
diff --git
a/kernel/bpf/btf.c
b/kernel/bpf/btf.c
index aaf2fbaa0cc76e4a8615ac961a16da6042c76ec3..72534a6f4b96e21b1faa612ba3aa16562039d8f5 100644
(file)
--- a/
kernel/bpf/btf.c
+++ b/
kernel/bpf/btf.c
@@
-4135,7
+4135,7
@@
static struct btf *btf_parse(void __user *btf_data, u32 btf_data_size,
log->len_total = log_size;
/* log attributes have to be sane */
- if (log->len_total < 128 || log->len_total > UINT_MAX >>
8
||
+ if (log->len_total < 128 || log->len_total > UINT_MAX >>
2
||
!log->level || !log->ubuf) {
err = -EINVAL;
goto errout;