netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH iproute2] bpf: indicate lderr when bpf_apply_relo_data fails
@ 2017-06-27  0:48 Daniel Borkmann
  2017-06-27 23:09 ` Stephen Hemminger
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel Borkmann @ 2017-06-27  0:48 UTC (permalink / raw)
  To: netdev; +Cc: Daniel Borkmann

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 | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/bpf.c b/lib/bpf.c
index ae4d97d..6b5a96d 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;
-- 
1.9.3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-06-27 23:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-27  0:48 [PATCH iproute2] bpf: indicate lderr when bpf_apply_relo_data fails Daniel Borkmann
2017-06-27 23:09 ` Stephen Hemminger
2017-06-27 23:14   ` Daniel Borkmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).