From patchwork Thu Dec 24 01:12:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jiang Wang ." X-Patchwork-Id: 11989115 X-Patchwork-Delegate: bpf@iogearbox.net Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A1DE4C433DB for ; Thu, 24 Dec 2020 01:14:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 638D522517 for ; Thu, 24 Dec 2020 01:14:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728449AbgLXBOL (ORCPT ); Wed, 23 Dec 2020 20:14:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48852 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728444AbgLXBOL (ORCPT ); Wed, 23 Dec 2020 20:14:11 -0500 Received: from mail-pj1-x102a.google.com (mail-pj1-x102a.google.com [IPv6:2607:f8b0:4864:20::102a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4CA27C061794 for ; Wed, 23 Dec 2020 17:13:31 -0800 (PST) Received: by mail-pj1-x102a.google.com with SMTP id z12so307965pjn.1 for ; Wed, 23 Dec 2020 17:13:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=oEB/K+/1a1TbERA41YPGQZ634+oV6MBUudjc1gIr9Sk=; b=d3ORO5ShNMs1pkhQ29br1mERag49q/f83ZtdBI6QdI3MVihNc/r5XVwYPxYroDFLct zrClBqJ8/KcQsop2nf1EPj01VxIvOK/n9FqG7sEJhkxz9dy7N905hwXBD6esh2csdA4F L/kTmtLsVtHm20LxK3QuGPkUzJngoIougG0mnFiwHa/TZiuZA57r+E1M641ieD3A2p09 bGJ+ebpCK8PpNP/cfkbVA3Kut50Ap5lqHViv2ZJ2zrI8TE5KrKxyTV6Mqs5rg8f9Rxga heIl1gFMj5WTdP/A4EpDmXYq8t1cReNJKiieVRhN20oSX84o7/PIyxmYIvLcituhhm0F ZbBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=oEB/K+/1a1TbERA41YPGQZ634+oV6MBUudjc1gIr9Sk=; b=aMZM4L1FQPEPJ3VMR/6ts9rimgnVFTnfMrf6LfuKfQg/icE/m2iJi3xxnvnCCy5mhh EyJL4GqBdNxod7A9+GDfjMeBqiZUFenCWr3MtyhXfG3/X8zrPgQJT3sXZasdUcAOSemA K3mVKLPvhOwZ4jc7As7rFsQOmlbtCsOf6e4WzmGa25+t0STD2LgfbaUzZCR3J2VG787+ LFSnY0tK1ffNnrfH1yIUbcTbQRRiUdOZlRtO95pd8+bB2/7oYX47h00kElwD2myOETD4 HB3YKMSpm3qR2GQ7xg8mgAJLZmAJFBtniYTRf0KhAwPABrHXowjGfzJ0hXL2zgdTb2Q8 GndQ== X-Gm-Message-State: AOAM531OzJ9lLLfCvys2oHLZ0eh8s+dxuTqsM+Pij54dKh1sqJb5vusD cWKpjjLb5tZxgDaMx6meEwlGDY0bMAaUlmIMmcQ= X-Google-Smtp-Source: ABdhPJxp6pFBDWgwrquCGYhzlbRGI+Qxau++0DkeM0wYnPsoAjxKMfDKOY9N0lYbXn1bmXU1t+ERHA== X-Received: by 2002:a17:90b:a4a:: with SMTP id gw10mr2023693pjb.29.1608772410727; Wed, 23 Dec 2020 17:13:30 -0800 (PST) Received: from n124-121-013.byted.org (ec2-54-241-92-238.us-west-1.compute.amazonaws.com. [54.241.92.238]) by smtp.gmail.com with ESMTPSA id o14sm20386864pgr.44.2020.12.23.17.13.29 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Dec 2020 17:13:30 -0800 (PST) From: Jiang Wang To: bpf@vger.kernel.org Cc: cong.wang@bytedance.com, kpsingh@google.com, Jiang Wang Subject: [PATCH] selftests/bpf: fix a compile error for BPF_F_BPRM_SECUREEXEC Date: Thu, 24 Dec 2020 01:12:42 +0000 Message-Id: <20201224011242.585967-1-jiang.wang@bytedance.com> X-Mailer: git-send-email 2.11.0 Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org X-Patchwork-Delegate: bpf@iogearbox.net When CONFIG_BPF_LSM is not configured, running bpf selftesting will show BPF_F_BPRM_SECUREEXEC undefined error for bprm_opts.c. The problem is that bprm_opts.c includes vmliunx.h. The vmlinux.h is generated by "bpftool btf dump file ./vmlinux format c". On the other hand, BPF_F_BPRM_SECUREEXEC is defined in include/uapi/linux/bpf.h and used only in bpf_lsm.c. When CONFIG_BPF_LSM is not set, bpf_lsm will not be compiled, so vmlinux.h will not include definition of BPF_F_BPRM_SECUREEXEC. Ideally, we want to compile bpf selftest regardless of the configuration setting, so change the include file from vmlinux.h to bpf.h. Signed-off-by: Jiang Wang Acked-by: Song Liu Acked-by: John Fastabend --- tools/testing/selftests/bpf/progs/bprm_opts.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/bpf/progs/bprm_opts.c b/tools/testing/selftests/bpf/progs/bprm_opts.c index 5bfef2887e70..418d9c6d4952 100644 --- a/tools/testing/selftests/bpf/progs/bprm_opts.c +++ b/tools/testing/selftests/bpf/progs/bprm_opts.c @@ -4,7 +4,7 @@ * Copyright 2020 Google LLC. */ -#include "vmlinux.h" +#include #include #include #include