Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1198882

[PATCH 1/6] test_bpf: avoid oopsing the kernel when generate_test_data() fails.

From Nicolas Schichan <nschichan@freebox.fr>
Newsgroups linux.kernel
Subject [PATCH 1/6] test_bpf: avoid oopsing the kernel when generate_test_data() fails.
Date 2015-08-03 16:10 +0200
Message-ID <pToBd-5iK-53@gated-at.bofh.it> (permalink)
References <pToBb-5iK-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Signed-off-by: Nicolas Schichan <nschichan@freebox.fr>
Acked-by: Alexei Starovoitov <ast@plumgrid.com>
---
 lib/test_bpf.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/lib/test_bpf.c b/lib/test_bpf.c
index 3afddf2..6843d0b 100644
--- a/lib/test_bpf.c
+++ b/lib/test_bpf.c
@@ -4672,6 +4672,11 @@ static int run_one(const struct bpf_prog *fp, struct bpf_test *test)
 			break;
 
 		data = generate_test_data(test, i);
+		if (!data && !(test->aux & FLAG_NO_DATA)) {
+			pr_cont("data generation failed ");
+			err_cnt++;
+			break;
+		}
 		ret = __run_one(fp, data, runs, &duration);
 		release_test_data(test, data);
 
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/6] test_bpf improvements Nicolas Schichan <nschichan@freebox.fr> - 2015-08-03 16:10 +0200
  [PATCH 4/6] test_bpf: add module parameters to filter the tests to run. Nicolas Schichan <nschichan@freebox.fr> - 2015-08-03 16:10 +0200
    Re: [PATCH 4/6] test_bpf: add module parameters to filter the tests  to run. Daniel Borkmann <daniel@iogearbox.net> - 2015-08-03 18:00 +0200
      Re: [PATCH 4/6] test_bpf: add module parameters to filter the tests  to run. Daniel Borkmann <daniel@iogearbox.net> - 2015-08-03 18:40 +0200
      Re: [PATCH 4/6] test_bpf: add module parameters to filter the tests  to run. Nicolas Schichan <nschichan@freebox.fr> - 2015-08-03 18:40 +0200
  [PATCH 3/6] test_bpf: test LD_ABS and LD_IND instructions on fragmented skbs. Nicolas Schichan <nschichan@freebox.fr> - 2015-08-03 16:10 +0200
    Re: [PATCH 3/6] test_bpf: test LD_ABS and LD_IND instructions on  fragmented skbs. Daniel Borkmann <daniel@iogearbox.net> - 2015-08-03 17:10 +0200
  [PATCH 6/6] test_bpf: add tests checking that JIT/interpreter sets A and X to 0. Nicolas Schichan <nschichan@freebox.fr> - 2015-08-03 16:10 +0200
    Re: [PATCH 6/6] test_bpf: add tests checking that JIT/interpreter  sets A and X to 0. Daniel Borkmann <daniel@iogearbox.net> - 2015-08-03 17:10 +0200
  [PATCH 5/6] test_bpf: add more tests for LD_ABS and LD_IND. Nicolas Schichan <nschichan@freebox.fr> - 2015-08-03 16:10 +0200
    Re: [PATCH 5/6] test_bpf: add more tests for LD_ABS and LD_IND. Daniel Borkmann <daniel@iogearbox.net> - 2015-08-03 17:10 +0200
  [PATCH 1/6] test_bpf: avoid oopsing the kernel when generate_test_data() fails. Nicolas Schichan <nschichan@freebox.fr> - 2015-08-03 16:10 +0200
    Re: [PATCH 1/6] test_bpf: avoid oopsing the kernel when generate_test_data()  fails. Daniel Borkmann <daniel@iogearbox.net> - 2015-08-03 16:50 +0200

csiph-web