]> git.proxmox.com Git - mirror_iproute2.git/commitdiff
bpf: indicate lderr when bpf_apply_relo_data fails
authorDaniel Borkmann <daniel@iogearbox.net>
Tue, 27 Jun 2017 00:48:36 +0000 (02:48 +0200)
committerStephen Hemminger <stephen@networkplumber.org>
Tue, 27 Jun 2017 23:08:52 +0000 (16:08 -0700)
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>
lib/bpf.c

index ae4d97dc4eed3f8cc7d57951c7f360f5f1220eab..6b5a96d075b7d03b62261c145c0aea13984b2405 100644 (file)
--- 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;