From: Daniel Borkmann Date: Tue, 27 Jun 2017 00:48:36 +0000 (+0200) Subject: bpf: indicate lderr when bpf_apply_relo_data fails X-Git-Tag: v4.12.0~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c9c3720d1411730f865d4c16ac8b2f01ab2eb8a6;p=thirdparty%2Fiproute2.git 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 --- diff --git a/lib/bpf.c b/lib/bpf.c index ae4d97dc4..6b5a96d07 100644 --- a/lib/bpf.c +++ b/lib/bpf.c @@ -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;