bpf: indicate lderr when bpf_apply_relo_data fails

When LLVM wrongly generates a rodata relo entry (llvm BZ #33599),
then just bail out instead of probing for prog w/o reloc, which
will fail in this case anyway.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
This commit is contained in:
Daniel Borkmann 2017-06-27 02:48:36 +02:00 committed by Stephen Hemminger
parent 3288e9b426
commit c9c3720d14
1 changed files with 3 additions and 1 deletions

View File

@ -1795,8 +1795,10 @@ static int bpf_fetch_prog_relo(struct bpf_elf_ctx *ctx, const char *section,
*sseen = true;
ret = bpf_apply_relo_data(ctx, &data_relo, &data_insn);
if (ret < 0)
if (ret < 0) {
*lderr = true;
return ret;
}
memset(&prog, 0, sizeof(prog));
prog.type = ctx->type;