Re: [PATCH net] bpf: uninitialized variables in test code
From: Alexei Starovoitov <hidden>
Date: 2018-12-02 07:49:39
Also in:
kernel-janitors
From: Alexei Starovoitov <hidden>
Date: 2018-12-02 07:49:39
Also in:
kernel-janitors
On Sat, Dec 01, 2018 at 08:12:34PM +0000, Roman Gushchin wrote:
From dc70ddb39c2f8d87d64b8d0fd71f4baa956d5f50 Mon Sep 17 00:00:00 2001
From: Roman Gushchin <redacted>
Date: Sat, 1 Dec 2018 10:39:44 -0800
Subject: [PATCH v2 bpf] bpf: refactor bpf_test_run() to separate own failures
and test program result
After commit f42ee093be29 ("bpf/test_run: support cgroup local
storage") the bpf_test_run() function may fail with -ENOMEM, if
it's not possible to allocate memory for a cgroup local storage.
This error shouldn't be mixed with the return value of the testing
program. Let's add an additional argument with a pointer where to
store the testing program's result; and make bpf_test_run()
return either 0 or -ENOMEM.
Fixes: f42ee093be29 ("bpf/test_run: support cgroup local storage")
Reported-by: Dan Carpenter <redacted>
Suggested-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Roman Gushchin <redacted>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: Alexei Starovoitov <ast@kernel.org>Applied to bpf tree. Thanks!