Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp2236699rdg; Sun, 15 Oct 2023 18:48:08 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFqqocgfBYFIfvWR1dmW8S25UtkZVVBmhnX2NGp/hj+KxsVb4HqULoxePcKprSv2rFtD15T X-Received: by 2002:a05:6870:be8f:b0:1ea:19d5:1e50 with SMTP id nx15-20020a056870be8f00b001ea19d51e50mr4795220oab.51.1697420887802; Sun, 15 Oct 2023 18:48:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697420887; cv=none; d=google.com; s=arc-20160816; b=pLkt+L95j3Xqypllq//rwcKZkEacBCdUanMfChyEjjIjOXqSVlQuiO39pCBtMyYSwb jHnA7h+1efYqZxLbSsJDzJtBfzud4TM6avRMB1hiyKJj3WQ+ShXGc513ghxLl1BuBBYr X6XTxjZlLyzyAes3uckprYo5I4kufx2Wx3DPqXpybrokd2Iy7MGtoosI38rNYI/hsKJE xOncO2l/P21sD6bhPrj1msvX96LFa5XJzU4KViP83jf0pYV1v/KvGZCR5zKWPR9m9E7z vmZXnYEbJhJmRIiKtVjK09xi1yRsDpPyBXuwB5fLqmwLPPRw7DPC8+JHZ0iMZX5ZeT2Y /QMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=mi5UmAT05d3969V2jLDH5OfDsDaXCi2SPvi05677hA4=; fh=UUVBB6hdZtgkdevQaSWXrPPcR6FiQNJo3IQxWCli3s0=; b=sUv8lGmrlxmSjCUspnVavhYVk4R6RWo3MjVvmSp+YGKa0PG86F4XigQQByyt/xASwJ BXSJjih3AucpUDLfGtw4COwzmV9/j9A78I11W8YL/Kq2YshXXaQIw5LFXVaQbTaQvrGy GUzBiJCnw6m6ZBmp4LNI2PYz5AJ+hJK2FpEXucfgGhZuqaSPsI3cjmVumV/7mSovTdib r0B5Z+LHrqIe794/8L4kRnlmBYF7vx24YmmgBO+u/SCF6v5WRFnLWttecikpX0GGUaQB ShnrmqaVmJQF1pP5KM980ftd++oynunQny3Wm5oSTB1raOSRNwARRtof+QjvdQ3nOvsh u0eA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=C5kTRMBF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id 193-20020a6300ca000000b005aaf19c3981si6652413pga.329.2023.10.15.18.48.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Oct 2023 18:48:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=C5kTRMBF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 007C180A73D5; Sun, 15 Oct 2023 18:48:06 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231358AbjJPBsD (ORCPT + 99 others); Sun, 15 Oct 2023 21:48:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50724 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231324AbjJPBrx (ORCPT ); Sun, 15 Oct 2023 21:47:53 -0400 Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3B51EE9; Sun, 15 Oct 2023 18:47:52 -0700 (PDT) Received: by mail-pj1-x1029.google.com with SMTP id 98e67ed59e1d1-27d3ede72f6so2136314a91.1; Sun, 15 Oct 2023 18:47:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697420871; x=1698025671; darn=vger.kernel.org; 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=mi5UmAT05d3969V2jLDH5OfDsDaXCi2SPvi05677hA4=; b=C5kTRMBFanemv7wO8grEXFn8sCR7wXzJ4Lv+wA9TIl+kJNxDaUi0T+cdqbrV4/WQcE e6F2HK2t3D9j4PF8akTTbHWfquiP2luxfy0FuXMpLYyKRNQw7htfyIDWETv2VzGZ/uM1 zWGTWJmXMRZNapAWdlXoeQCz60YUOCRuikPSrsjjWJ1EuJHVBbF/VASOPKR9Mlvc3vYi L8Qdlc4i2+oDzudw6IMjnz875Kl+ovhi81Im8qBNz0Ig+JY89z9SpV5BKnpak2BjPn1a XSPTvWAOQetAjXosjUw/nl4hQ+oKNjUEBKGnrFO1wdCn3weZr20AzE+BqM5KB1Z86Ud/ 6JNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697420871; x=1698025671; 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=mi5UmAT05d3969V2jLDH5OfDsDaXCi2SPvi05677hA4=; b=gNPspkZBG17h0ZNCiPpguqAPC/ugSzB9Z+cutjaOTnNDCAjYZ+BkI/KPCO1Cv+T+U7 pV2nlqzwWhkbl2VtNqXezE+tEv0eNyOhfVGAjPR+zIwhyPH6A8zfUsrozpHbGYPEDWJo mV/I3a1VH81rLWRhYkJe+GViQ8tht+07elQKHBk6fD8nyX+7xI/mKjLhJbGHvDlHgJ5s UjR14/4yZ7/Hu3xNhqgQE4tJTE9RhOlgGq6aUu3jhwBYM1Q0UOjnw8Ublw36rF/5lEC7 /P+qv7t/Uhdu+wzyECG3IElbpG0DbiHteyBNNkTKIWvUM/TZ5dqbF7mi6u2cqKwleWCz V70g== X-Gm-Message-State: AOJu0YyKjJnBzdLJA08QAMOfCM94A2igroSbyfhFgEGZ/tMJf5XPEr3p iDlnpe8KJp33fFr0AJdCAw3llFP16FC4Vw== X-Received: by 2002:a17:90b:8e:b0:27c:fc2a:a178 with SMTP id bb14-20020a17090b008e00b0027cfc2aa178mr14832393pjb.9.1697420870865; Sun, 15 Oct 2023 18:47:50 -0700 (PDT) Received: from ubuntu.. ([203.205.141.13]) by smtp.googlemail.com with ESMTPSA id pd17-20020a17090b1dd100b0027cfb5f010dsm3574377pjb.4.2023.10.15.18.47.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Oct 2023 18:47:49 -0700 (PDT) From: Hengqi Chen To: linux-kernel@vger.kernel.org, bpf@vger.kernel.org Cc: keescook@chromium.org, ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org, luto@amacapital.net, wad@chromium.org, alexyonghe@tencent.com, hengqi.chen@gmail.com Subject: [PATCH v2 5/5] selftests/bpf: Skip BPF_PROG_TYPE_SECCOMP-related tests Date: Sun, 15 Oct 2023 23:29:53 +0000 Message-Id: <20231015232953.84836-6-hengqi.chen@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231015232953.84836-1-hengqi.chen@gmail.com> References: <20231015232953.84836-1-hengqi.chen@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Sun, 15 Oct 2023 18:48:07 -0700 (PDT) We only allow BPF_PROG_TYPE_SECCOMP progs to be loaded via seccomp syscall. Skip related test on BPF side. Signed-off-by: Hengqi Chen --- tools/testing/selftests/bpf/prog_tests/libbpf_probes.c | 3 ++- tools/testing/selftests/bpf/prog_tests/libbpf_str.c | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/bpf/prog_tests/libbpf_probes.c b/tools/testing/selftests/bpf/prog_tests/libbpf_probes.c index 9f766ddd946a..134ae042c4da 100644 --- a/tools/testing/selftests/bpf/prog_tests/libbpf_probes.c +++ b/tools/testing/selftests/bpf/prog_tests/libbpf_probes.c @@ -28,7 +28,8 @@ void test_libbpf_probe_prog_types(void) enum bpf_prog_type prog_type = (enum bpf_prog_type)e->val; int res; - if (prog_type == BPF_PROG_TYPE_UNSPEC) + if (prog_type == BPF_PROG_TYPE_UNSPEC || + prog_type == BPF_PROG_TYPE_SECCOMP) continue; if (!test__start_subtest(prog_type_name)) diff --git a/tools/testing/selftests/bpf/prog_tests/libbpf_str.c b/tools/testing/selftests/bpf/prog_tests/libbpf_str.c index c440ea3311ed..35365500c326 100644 --- a/tools/testing/selftests/bpf/prog_tests/libbpf_str.c +++ b/tools/testing/selftests/bpf/prog_tests/libbpf_str.c @@ -186,6 +186,9 @@ static void test_libbpf_bpf_prog_type_str(void) const char *prog_type_str; char buf[256]; + if (prog_type == BPF_PROG_TYPE_SECCOMP) + continue; + prog_type_name = btf__str_by_offset(btf, e->name_off); prog_type_str = libbpf_bpf_prog_type_str(prog_type); ASSERT_OK_PTR(prog_type_str, prog_type_name); -- 2.34.1