提交 e7ed83d6 编写于 作者: D Dan Carpenter 提交者: Daniel Borkmann

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: 8c1b6e69 ("bpf: Compare BTF types of functions arguments with actual types")
Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NDaniel Borkmann <daniel@iogearbox.net>
Acked-by: NSong Liu <songliubraving@fb.com>
Link: https://lore.kernel.org/bpf/20200604085436.GA943001@mwanda
上级 49b23575
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册