summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2020-06-04 11:54:36 +0300
committerDaniel Borkmann <daniel@iogearbox.net>2020-06-04 23:38:54 +0200
commite7ed83d6fa1a00d0f2ad0327e73d3ea9e7ea8de1 (patch)
tree3a6e82cb49723a4c17396dd690ae7bf713ea1e5e
parent49b23575943c04b6711107cfd08ad2b3ae4e81f5 (diff)
downloadlinux-e7ed83d6fa1a00d0f2ad0327e73d3ea9e7ea8de1.tar.gz
linux-e7ed83d6fa1a00d0f2ad0327e73d3ea9e7ea8de1.tar.xz
bpf: Fix an error code in check_btf_func()
This code returns success if the "info_aux" allocation fails but it should return -ENOMEM. Fixes: 8c1b6e69dcc1 ("bpf: Compare BTF types of functions arguments with actual types") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Acked-by: Song Liu <songliubraving@fb.com> Link: https://lore.kernel.org/bpf/20200604085436.GA943001@mwanda
-rw-r--r--kernel/bpf/verifier.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index 5c7bbaac81ef..34cde841ab68 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -7552,7 +7552,7 @@ static int check_btf_func(struct bpf_verifier_env *env,
const struct btf *btf;
void __user *urecord;
u32 prev_offset = 0;
- int ret = 0;
+ int ret = -ENOMEM;
nfuncs = attr->func_info_cnt;
if (!nfuncs)