diff mbox series

[net] selftests/net: fixes psock_fanout eBPF test case

Message ID 20180214070059.6004-1-bhole_prashant_q7@lab.ntt.co.jp
State Changes Requested, archived
Delegated to: David Miller
Headers show
Series [net] selftests/net: fixes psock_fanout eBPF test case | expand

Commit Message

Prashant Bhole Feb. 14, 2018, 7 a.m. UTC
eBPF test fails due to verifier failure because log_buf is too small

Fixed by increasing log_buf size

Signed-off-by: Prashant Bhole <bhole_prashant_q7@lab.ntt.co.jp>
---
 tools/testing/selftests/net/psock_fanout.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Willem de Bruijn Feb. 14, 2018, 5:34 p.m. UTC | #1
On Wed, Feb 14, 2018 at 2:00 AM, Prashant Bhole
<bhole_prashant_q7@lab.ntt.co.jp> wrote:
> eBPF test fails due to verifier failure because log_buf is too small
>
> Fixed by increasing log_buf size
>
> Signed-off-by: Prashant Bhole <bhole_prashant_q7@lab.ntt.co.jp>
> ---
>  tools/testing/selftests/net/psock_fanout.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/net/psock_fanout.c b/tools/testing/selftests/net/psock_fanout.c
> index 989f917068d1..898278a41322 100644
> --- a/tools/testing/selftests/net/psock_fanout.c
> +++ b/tools/testing/selftests/net/psock_fanout.c
> @@ -140,7 +140,7 @@ static void sock_fanout_set_ebpf(int fd)
>                 { BPF_ALU   | BPF_MOV | BPF_K,   0, 0, 0, 0 },
>                 { BPF_JMP   | BPF_EXIT,          0, 0, 0, 0 }
>         };
> -       char log_buf[512];
> +       char log_buf[65536];

Please don't allocate that much on the stack. Since this is a single
threaded test, it is okay to statically allocate. See for instance
reuseport_bpf.c

Thanks for sending a patch. I could reproduce the issue.
diff mbox series

Patch

diff --git a/tools/testing/selftests/net/psock_fanout.c b/tools/testing/selftests/net/psock_fanout.c
index 989f917068d1..898278a41322 100644
--- a/tools/testing/selftests/net/psock_fanout.c
+++ b/tools/testing/selftests/net/psock_fanout.c
@@ -140,7 +140,7 @@  static void sock_fanout_set_ebpf(int fd)
 		{ BPF_ALU   | BPF_MOV | BPF_K,   0, 0, 0, 0 },
 		{ BPF_JMP   | BPF_EXIT,          0, 0, 0, 0 }
 	};
-	char log_buf[512];
+	char log_buf[65536];
 	union bpf_attr attr;
 	int pfd;