From: Greg Kroah-Hartman Date: Thu, 11 Jun 2020 10:53:01 +0000 (+0200) Subject: 4.19-stable patches X-Git-Tag: v5.4.47~142 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=88fc314c7eac6a00c780d19fee4b4ab1ee41ba3c;p=thirdparty%2Fkernel%2Fstable-queue.git 4.19-stable patches added patches: selftests-bpf-fix-use-of-undeclared-ret_if-macro.patch --- diff --git a/queue-4.19/selftests-bpf-fix-use-of-undeclared-ret_if-macro.patch b/queue-4.19/selftests-bpf-fix-use-of-undeclared-ret_if-macro.patch new file mode 100644 index 00000000000..1db94b15b26 --- /dev/null +++ b/queue-4.19/selftests-bpf-fix-use-of-undeclared-ret_if-macro.patch @@ -0,0 +1,65 @@ +From lmb@cloudflare.com Thu Jun 11 12:52:08 2020 +From: Lorenz Bauer +Date: Thu, 21 May 2020 15:48:41 +0100 +Subject: selftests: bpf: fix use of undeclared RET_IF macro +To: stable@vger.kernel.org +Cc: kernel-team@cloudflare.com, Lorenz Bauer , kernel test robot +Message-ID: <20200521144841.7074-1-lmb@cloudflare.com> + +From: Lorenz Bauer + +commit 634efb750435 ("selftests: bpf: Reset global state between +reuseport test runs") uses a macro RET_IF which doesn't exist in +the v4.19 tree. It is defined as follows: + + #define RET_IF(condition, tag, format...) ({ + if (CHECK_FAIL(condition)) { + printf(tag " " format); + return; + } + }) + +CHECK_FAIL in turn is defined as: + + #define CHECK_FAIL(condition) ({ + int __ret = !!(condition); + int __save_errno = errno; + if (__ret) { + test__fail(); + fprintf(stdout, "%s:FAIL:%d\n", __func__, __LINE__); + } + errno = __save_errno; + __ret; + }) + +Replace occurences of RET_IF with CHECK. This will abort the test binary +if clearing the intermediate state fails. + +Fixes: 634efb750435 ("selftests: bpf: Reset global state between reuseport test runs") +Reported-by: kernel test robot +Signed-off-by: Lorenz Bauer +Signed-off-by: Greg Kroah-Hartman +--- + tools/testing/selftests/bpf/test_select_reuseport.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +--- a/tools/testing/selftests/bpf/test_select_reuseport.c ++++ b/tools/testing/selftests/bpf/test_select_reuseport.c +@@ -616,13 +616,13 @@ static void cleanup_per_test(void) + + for (i = 0; i < NR_RESULTS; i++) { + err = bpf_map_update_elem(result_map, &i, &zero, BPF_ANY); +- RET_IF(err, "reset elem in result_map", +- "i:%u err:%d errno:%d\n", i, err, errno); ++ CHECK(err, "reset elem in result_map", ++ "i:%u err:%d errno:%d\n", i, err, errno); + } + + err = bpf_map_update_elem(linum_map, &zero, &zero, BPF_ANY); +- RET_IF(err, "reset line number in linum_map", "err:%d errno:%d\n", +- err, errno); ++ CHECK(err, "reset line number in linum_map", "err:%d errno:%d\n", ++ err, errno); + + for (i = 0; i < REUSEPORT_ARRAY_SIZE; i++) + close(sk_fds[i]); diff --git a/queue-4.19/series b/queue-4.19/series index f1041cd19a3..ca379f79267 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -3,3 +3,4 @@ net_failover-fixed-rollback-in-net_failover_open.patch bridge-avoid-infinite-loop-when-suppressing-ns-messages-with-invalid-options.patch vxlan-avoid-infinite-loop-when-suppressing-ns-messages-with-invalid-options.patch tun-correct-header-offsets-in-napi-frags-mode.patch +selftests-bpf-fix-use-of-undeclared-ret_if-macro.patch