From patchwork Tue Aug 29 10:18:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daan De Meyer X-Patchwork-Id: 13368784 X-Patchwork-Delegate: bpf@iogearbox.net Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6784714F82 for ; Tue, 29 Aug 2023 10:19:23 +0000 (UTC) Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9D71619A for ; Tue, 29 Aug 2023 03:19:15 -0700 (PDT) Received: by mail-ed1-x536.google.com with SMTP id 4fb4d7f45d1cf-52a069edca6so5872953a12.3 for ; Tue, 29 Aug 2023 03:19:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1693304354; x=1693909154; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=y14cfr9X7ZfqN6REntNnZLiNj9fIlAHdGv7Az327RZ4=; b=MCC1LSvpudwllF1svJbmhHDXgNBFX15mSQ8TPH/qrtqmlYu0pTYTq0YgChXRb4D+CJ D5zd7ZXGAMwkYFnSP8HsjRFbh8SC8Z9gZ8IwENHgq5RcohmL2UdR1Btyb0IfaX5C8jnb JY14//E55NyhFv3JhATDeHnL19maOzOc/bsY2UrldfYwKW2PQ7LP8tlsKrs4rlLdyxY5 RZxu6EY18w504WNgP9JSC/CLgIu5O63xSBWnLlFpt1T84tjO/aQyHgu848ifad/1qPdA SbYGW5ECwXiUHuI0ldJoWmZneZugb238RWO7FsM+zzgA53eGsGAcZ8etrs8h/hoxoGt5 W4VQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693304354; x=1693909154; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=y14cfr9X7ZfqN6REntNnZLiNj9fIlAHdGv7Az327RZ4=; b=ODEqomElPhXe0I+moUTYBks09oo6vzdJ2NQkXh6jZ7FslnPb85uzAzUMWtyibaUKPl QI5Qe7VeuEkF82KUOXxKFu6oiavLIOJoMdosNpo/5K1Ui1ODMlZygYCYb5esTT8CE2R/ ML+ff4cj4O6tY08PXOltLbEy4ZRhJdXbHhcI/t5bAx7wUX1HgQZyfF16jis1CVIrJGV7 oQ/Sk42JoaVEEMmRTRHUM//c15MlGRNjUitADiVEAelfMYttYdrJcJiYmj5UAtDLVGWK Owun9z+nKMrEyQdw8sFpjr290QkM3LnkuoyIj345U2x7zDQSJ7dBMRrRotrKp77At9kb Emzw== X-Gm-Message-State: AOJu0YxBENJnkxCihJIlDzIwzerko2gvt00ncpA4lPE3Y3KPFcw+QS1j twbTnfNP0kS4FdNcVDK13i95/TRhNqLHGdag55E= X-Google-Smtp-Source: AGHT+IF2hv4PlyQ88alZkZovIA5SeosJBV949to+4DT3WEkSBUlN41NhVgri9kGGAnzDFJb2oGfXEg== X-Received: by 2002:aa7:d058:0:b0:523:406a:5f6 with SMTP id n24-20020aa7d058000000b00523406a05f6mr21492859edo.12.1693304353706; Tue, 29 Aug 2023 03:19:13 -0700 (PDT) Received: from daandemeyer-fedora-PC1EV17T.thefacebook.com (2001-1c05-3310-3500-67a4-023c-67c4-b186.cable.dynamic.v6.ziggo.nl. [2001:1c05:3310:3500:67a4:23c:67c4:b186]) by smtp.googlemail.com with ESMTPSA id f15-20020a50ee8f000000b0051e2670d599sm5545606edr.4.2023.08.29.03.19.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Aug 2023 03:19:13 -0700 (PDT) From: Daan De Meyer To: bpf@vger.kernel.org Cc: Daan De Meyer , martin.lau@linux.dev, kernel-team@meta.com Subject: [PATCH bpf-next v3 1/9] selftests/bpf: Add missing section name tests for getpeername/getsockname Date: Tue, 29 Aug 2023 12:18:25 +0200 Message-ID: <20230829101838.851350-2-daan.j.demeyer@gmail.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230829101838.851350-1-daan.j.demeyer@gmail.com> References: <20230829101838.851350-1-daan.j.demeyer@gmail.com> Precedence: bulk X-Mailing-List: bpf@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Patchwork-Delegate: bpf@iogearbox.net These were missed when these hooks were first added so add them now instead to make sure every sockaddr hook has a matching section name test. Signed-off-by: Daan De Meyer --- .../selftests/bpf/prog_tests/section_names.c | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tools/testing/selftests/bpf/prog_tests/section_names.c b/tools/testing/selftests/bpf/prog_tests/section_names.c index 8b571890c57e..fc5248e94a01 100644 --- a/tools/testing/selftests/bpf/prog_tests/section_names.c +++ b/tools/testing/selftests/bpf/prog_tests/section_names.c @@ -158,6 +158,26 @@ static struct sec_name_test tests[] = { {0, BPF_PROG_TYPE_CGROUP_SOCKOPT, BPF_CGROUP_SETSOCKOPT}, {0, BPF_CGROUP_SETSOCKOPT}, }, + { + "cgroup/getpeername4", + {0, BPF_PROG_TYPE_CGROUP_SOCK_ADDR, BPF_CGROUP_INET4_GETPEERNAME}, + {0, BPF_CGROUP_INET4_GETPEERNAME}, + }, + { + "cgroup/getpeername6", + {0, BPF_PROG_TYPE_CGROUP_SOCK_ADDR, BPF_CGROUP_INET6_GETPEERNAME}, + {0, BPF_CGROUP_INET6_GETPEERNAME}, + }, + { + "cgroup/getsockname4", + {0, BPF_PROG_TYPE_CGROUP_SOCK_ADDR, BPF_CGROUP_INET4_GETSOCKNAME}, + {0, BPF_CGROUP_INET4_GETSOCKNAME}, + }, + { + "cgroup/getsockname6", + {0, BPF_PROG_TYPE_CGROUP_SOCK_ADDR, BPF_CGROUP_INET6_GETSOCKNAME}, + {0, BPF_CGROUP_INET6_GETSOCKNAME}, + }, }; static void test_prog_type_by_name(const struct sec_name_test *test)