From patchwork Fri Jun 4 11:50:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thadeu Lima de Souza Cascardo X-Patchwork-Id: 1487764 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FxLgw3cfMz9sW6; Fri, 4 Jun 2021 21:51:08 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1lp8Lv-0000RK-T3; Fri, 04 Jun 2021 11:51:03 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1lp8Lm-0000Py-Gh for kernel-team@lists.ubuntu.com; Fri, 04 Jun 2021 11:50:54 +0000 Received: from [191.13.218.203] (helo=mussarela..) by youngberry.canonical.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1lp8Ll-0002oB-Rc for kernel-team@lists.ubuntu.com; Fri, 04 Jun 2021 11:50:54 +0000 From: Thadeu Lima de Souza Cascardo To: kernel-team@lists.ubuntu.com Subject: [SRU Bionic 1/1] UBUNTU: SAUCE: Revert "bpf: test_maps, only support ESTABLISHED socks" Date: Fri, 4 Jun 2021 08:50:47 -0300 Message-Id: <20210604115047.13569-2-cascardo@canonical.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210604115047.13569-1-cascardo@canonical.com> References: <20210604115047.13569-1-cascardo@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" BugLink: https://bugs.launchpad.net/bugs/1839912 This reverts commit da8fdf4717bf4e40143115be8799ca0dd2688e8d. This is upstream commit 5028027844cfc6168e39650abecd817ba64c9d98. That commit fixes 1aa12bdf1bfb ("bpf: sockmap, add sock close() hook to remove socks"), which is not included in bionic. That one fixes a real bug (a bpf program leak), but has a lot of fixes upstream, so is a potential regression. Given that sockmap bpf maps can only be created by root userns CAP_NET_ADMIN capable processes, leave this bug unfixed until there is some request for fixing it. Signed-off-by: Thadeu Lima de Souza Cascardo --- tools/testing/selftests/bpf/test_maps.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/tools/testing/selftests/bpf/test_maps.c b/tools/testing/selftests/bpf/test_maps.c index 32e5410ecdcf..b528bac3a6e8 100644 --- a/tools/testing/selftests/bpf/test_maps.c +++ b/tools/testing/selftests/bpf/test_maps.c @@ -563,11 +563,7 @@ static void test_sockmap(int tasks, void *data) /* Test update without programs */ for (i = 0; i < 6; i++) { err = bpf_map_update_elem(fd, &i, &sfd[i], BPF_ANY); - if (i < 2 && !err) { - printf("Allowed update sockmap '%i:%i' not in ESTABLISHED\n", - i, sfd[i]); - goto out_sockmap; - } else if (i >= 2 && err) { + if (err) { printf("Failed noprog update sockmap '%i:%i'\n", i, sfd[i]); goto out_sockmap; @@ -691,7 +687,7 @@ static void test_sockmap(int tasks, void *data) } /* Test map update elem afterwards fd lives in fd and map_fd */ - for (i = 2; i < 6; i++) { + for (i = 0; i < 6; i++) { err = bpf_map_update_elem(map_fd_rx, &i, &sfd[i], BPF_ANY); if (err) { printf("Failed map_fd_rx update sockmap %i '%i:%i'\n", @@ -787,7 +783,7 @@ static void test_sockmap(int tasks, void *data) } /* Delete the elems without programs */ - for (i = 2; i < 6; i++) { + for (i = 0; i < 6; i++) { err = bpf_map_delete_elem(fd, &i); if (err) { printf("Failed delete sockmap %i '%i:%i'\n",