All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH 1/3] bpf: Print full verification log
@ 2021-08-27  5:13 Richard Palethorpe
  2021-08-27  5:13 ` [LTP] [PATCH 2/3] bpf: Mention CAP_BPF in required privs and add fallback definition Richard Palethorpe
                   ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Richard Palethorpe @ 2021-08-27  5:13 UTC (permalink / raw)
  To: ltp

The log never falls within the 1024 byte limit imposed by format
string buffer. So print it separately with dprintf.

Signed-off-by: Richard Palethorpe <rpalethorpe@suse.com>
---
 testcases/kernel/syscalls/bpf/bpf_common.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/testcases/kernel/syscalls/bpf/bpf_common.c b/testcases/kernel/syscalls/bpf/bpf_common.c
index ba0829a75..6e9cd498c 100644
--- a/testcases/kernel/syscalls/bpf/bpf_common.c
+++ b/testcases/kernel/syscalls/bpf/bpf_common.c
@@ -3,6 +3,8 @@
  * Copyright (c) 2019-2020 Linux Test Project
  */
 
+#include <stdio.h>
+
 #define TST_NO_DEFAULT_MAIN
 #include "tst_test.h"
 #include "bpf_common.h"
@@ -118,8 +120,10 @@ int bpf_load_prog(union bpf_attr *const attr, const char *const log)
 	if (ret != -1)
 		tst_brk(TBROK, "Invalid bpf() return value: %d", ret);
 
-	if (log[0] != 0)
-		tst_brk(TBROK | TERRNO, "Failed verification: %s", log);
+	if (log[0] != 0) {
+		dprintf(STDERR_FILENO, "%s\n", log);
+		tst_brk(TBROK | TERRNO, "Failed verification");
+	}
 
 	tst_brk(TBROK | TERRNO, "Failed to load program");
 	return ret;
-- 
2.31.1


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

end of thread, other threads:[~2022-01-17 15:31 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-27  5:13 [LTP] [PATCH 1/3] bpf: Print full verification log Richard Palethorpe
2021-08-27  5:13 ` [LTP] [PATCH 2/3] bpf: Mention CAP_BPF in required privs and add fallback definition Richard Palethorpe
2021-08-27  5:13 ` [LTP] [PATCH 3/3] bpf_prog05: Drop CAP_BPF and check if ptr arithmetic is allowed Richard Palethorpe
2021-08-30 15:23 ` [LTP] [PATCH 1/3] bpf: Print full verification log Cyril Hrubis
2021-08-31  9:10   ` [LTP] [PATCH v2 1/4] API: Add tst_printf to avoid specifying the output FD in tests Richard Palethorpe
2021-08-31  9:10     ` [LTP] [PATCH v2 2/4] bpf: Print full verification log Richard Palethorpe
2021-08-31  9:51       ` Cyril Hrubis
2021-08-31  9:10     ` [LTP] [PATCH v2 3/4] bpf: Mention CAP_BPF in required privs and add fallback definition Richard Palethorpe
2021-08-31  9:10     ` [LTP] [PATCH v2 4/4] bpf_prog05: Drop CAP_BPF and check if ptr arithmetic is allowed Richard Palethorpe
2022-01-11 10:42       ` Joerg Vehlow
2022-01-11 14:36         ` Richard Palethorpe
2022-01-12  6:55           ` Joerg Vehlow
2022-01-13  7:48             ` Richard Palethorpe
2022-01-14  6:51               ` Joerg Vehlow
2022-01-17 15:11                 ` Richard Palethorpe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.