From mboxrd@z Thu Jan 1 00:00:00 1970 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=-10.8 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable 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 5E1EDC43467 for ; Mon, 12 Oct 2020 18:21:01 +0000 (UTC) Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CD76A2072C for ; Mon, 12 Oct 2020 18:21:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="LdoVe2QL" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CD76A2072C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linux-kernel-mentees-bounces@lists.linuxfoundation.org Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 81D7387505; Mon, 12 Oct 2020 18:21:00 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id pF7AAsQoTodl; Mon, 12 Oct 2020 18:20:59 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by hemlock.osuosl.org (Postfix) with ESMTP id C52FC874FF; Mon, 12 Oct 2020 18:20:59 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id AF958C0052; Mon, 12 Oct 2020 18:20:59 +0000 (UTC) Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by lists.linuxfoundation.org (Postfix) with ESMTP id 21F4BC0051 for ; Mon, 12 Oct 2020 18:20:58 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 0C1F5862BE for ; Mon, 12 Oct 2020 18:20:58 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id OfHpn0SH59k4 for ; Mon, 12 Oct 2020 18:20:56 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-ed1-f67.google.com (mail-ed1-f67.google.com [209.85.208.67]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 9284986287 for ; Mon, 12 Oct 2020 18:20:56 +0000 (UTC) Received: by mail-ed1-f67.google.com with SMTP id l24so18039414edj.8 for ; Mon, 12 Oct 2020 11:20:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:date:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=en7+cHw+zpp+LIZnFwAodjQVlC83Izxx3U6c4o6e8D0=; b=LdoVe2QL2arh9oFysuEfjbiUDo4wQnijZX8WFKCxuw4iMOyCg4OkxwYJkuSMyGoHss w8FTMhYH119rUuRP5DBz4W5MFIPV6udmxofgXfZ9KAbzBb0FYWhTlnYGFoK+YmTCf84t gKZHzLItmu5+bKqT242hrtLDH3HmluRnM+NgmFDayhA0dPAR80KRiTXCZEMyphTuN5Ki 3ctnIdgF4kJNUIG0XftUPOycfiOHfvGXGRzVMWK9EYfcydDagFWwVUNWkInM84/v6q/C FR2mvutyZPqGPXYSlzfa4aV2HuO3+KXfei/8DV3vVs85ShumBWRhgbaGIFqDCQqqva8z Qq7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=en7+cHw+zpp+LIZnFwAodjQVlC83Izxx3U6c4o6e8D0=; b=gPK2knydUD9JSQTtYig6UVrHKs1Ll+TZqvQ9VlVLBIaKkayzWSAnSknTMYYTozOrV8 KOJK/ZDcZ18nP5i2Gu50Y3cdnOOfokz/fqCKA1xXk1QykMyljcKS8ZZVWI7N1j9E/u61 18258NJmweLUBh8s0bIEaLCvRws/TTE8fL8Slmx0yDSHYdv+gN+uLUE23AvGY2qJP8l4 +oMOuf5jlOasCXKDAedTTZjnmjM4/1BR6S+YS2uwiccYFtEVfjXoaOWQM/WBN/RVrhyI VBIgdYxSQwLl6qI1+JvpFLTDbhpC3B+r/lFQ8W05W29r/qIL4IwA5rcCwSN4Jl3+qpA6 Is/g== X-Gm-Message-State: AOAM532TrKnDOa4C0+3w01yM0S5D/Ul9LCA1Kj6FApnICM4/bSjVw5vf g3obViryOk+4F4hMW6WyrBM= X-Google-Smtp-Source: ABdhPJy/WCePAhiFNYC/WvVr3EDosYtqB/OY+tIpiWNLpDWi62nlpJ3S02DEWDiUjD2rfF+w4RTLfQ== X-Received: by 2002:a50:9b14:: with SMTP id o20mr15052069edi.328.1602526854914; Mon, 12 Oct 2020 11:20:54 -0700 (PDT) Received: from felia ([2001:16b8:2d57:fc00:a1bd:911e:26f6:597]) by smtp.gmail.com with ESMTPSA id w4sm7861015eds.83.2020.10.12.11.20.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Oct 2020 11:20:54 -0700 (PDT) From: Lukas Bulwahn X-Google-Original-From: Lukas Bulwahn Date: Mon, 12 Oct 2020 20:20:52 +0200 (CEST) X-X-Sender: lukas@felia To: Ujjwal Kumar In-Reply-To: <20201012170631.1241502-3-ujjwalkumar0501@gmail.com> Message-ID: References: <20201012170631.1241502-1-ujjwalkumar0501@gmail.com> <20201012170631.1241502-3-ujjwalkumar0501@gmail.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Cc: Michal Marek , linux-ia64@vger.kernel.org, Kees Cook , linux-kbuild@vger.kernel.org, Masahiro Yamada , Nick Desaulniers , linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com, Nathan Chancellor , linux-kernel-mentees@lists.linuxfoundation.org, Andrew Morton , linux-arm-kernel@lists.infradead.org Subject: Re: [Linux-kernel-mentees] [PATCH v2 2/2] kbuild: use interpreters to invoke scripts X-BeenThere: linux-kernel-mentees@lists.linuxfoundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-kernel-mentees-bounces@lists.linuxfoundation.org Sender: "Linux-kernel-mentees" On Mon, 12 Oct 2020, Ujjwal Kumar wrote: > We cannot rely on execute bits to be set on files in the repository. > The build script should use the explicit interpreter when invoking any > script from the repository. > > Link: https://lore.kernel.org/lkml/20200830174409.c24c3f67addcce0cea9a9d4c@linux-foundation.org/ > Link: https://lore.kernel.org/lkml/202008271102.FEB906C88@keescook/ > > Suggested-by: Andrew Morton > Suggested-by: Kees Cook > Suggested-by: Lukas Bulwahn > Signed-off-by: Ujjwal Kumar > --- > Makefile | 4 ++-- > arch/arm64/kernel/vdso/Makefile | 2 +- > arch/arm64/kernel/vdso32/Makefile | 2 +- > arch/ia64/Makefile | 4 ++-- > arch/nds32/kernel/vdso/Makefile | 2 +- > scripts/Makefile.build | 2 +- > scripts/Makefile.package | 4 ++-- > 7 files changed, 10 insertions(+), 10 deletions(-) > > diff --git a/Makefile b/Makefile > index 0af7945caa61..df20e71dd7c8 100644 > --- a/Makefile > +++ b/Makefile > @@ -1256,7 +1256,7 @@ include/generated/utsrelease.h: include/config/kernel.release FORCE > PHONY += headerdep > headerdep: > $(Q)find $(srctree)/include/ -name '*.h' | xargs --max-args 1 \ > - $(srctree)/scripts/headerdep.pl -I$(srctree)/include > + $(PERL) $(srctree)/scripts/headerdep.pl -I$(srctree)/include > > # --------------------------------------------------------------------------- > # Kernel headers > @@ -1312,7 +1312,7 @@ PHONY += kselftest-merge > kselftest-merge: > $(if $(wildcard $(objtree)/.config),, $(error No .config exists, config your kernel first!)) > $(Q)find $(srctree)/tools/testing/selftests -name config | \ > - xargs $(srctree)/scripts/kconfig/merge_config.sh -m $(objtree)/.config > + xargs $(CONFIG_SHELL) $(srctree)/scripts/kconfig/merge_config.sh -m $(objtree)/.config > $(Q)$(MAKE) -f $(srctree)/Makefile olddefconfig > > # --------------------------------------------------------------------------- > diff --git a/arch/arm64/kernel/vdso/Makefile b/arch/arm64/kernel/vdso/Makefile > index edccdb77c53e..fb07804b7fc1 100644 > --- a/arch/arm64/kernel/vdso/Makefile > +++ b/arch/arm64/kernel/vdso/Makefile > @@ -65,7 +65,7 @@ $(obj)/%.so: $(obj)/%.so.dbg FORCE > # Generate VDSO offsets using helper script > gen-vdsosym := $(srctree)/$(src)/gen_vdso_offsets.sh > quiet_cmd_vdsosym = VDSOSYM $@ > - cmd_vdsosym = $(NM) $< | $(gen-vdsosym) | LC_ALL=C sort > $@ > + cmd_vdsosym = $(NM) $< | $(CONFIG_SHELL) $(gen-vdsosym) | LC_ALL=C sort > $@ > > include/generated/vdso-offsets.h: $(obj)/vdso.so.dbg FORCE > $(call if_changed,vdsosym) > diff --git a/arch/arm64/kernel/vdso32/Makefile b/arch/arm64/kernel/vdso32/Makefile > index 7f96a1a9f68c..617c9ac58156 100644 > --- a/arch/arm64/kernel/vdso32/Makefile > +++ b/arch/arm64/kernel/vdso32/Makefile > @@ -205,7 +205,7 @@ quiet_cmd_vdsomunge = MUNGE $@ > gen-vdsosym := $(srctree)/$(src)/../vdso/gen_vdso_offsets.sh > quiet_cmd_vdsosym = VDSOSYM $@ > # The AArch64 nm should be able to read an AArch32 binary > - cmd_vdsosym = $(NM) $< | $(gen-vdsosym) | LC_ALL=C sort > $@ > + cmd_vdsosym = $(NM) $< | $(CONFIG_SHELL) $(gen-vdsosym) | LC_ALL=C sort > $@ > > # Install commands for the unstripped file > quiet_cmd_vdso_install = INSTALL32 $@ > diff --git a/arch/ia64/Makefile b/arch/ia64/Makefile > index 703b1c4f6d12..86d42a2d09cb 100644 > --- a/arch/ia64/Makefile > +++ b/arch/ia64/Makefile > @@ -27,8 +27,8 @@ cflags-y := -pipe $(EXTRA) -ffixed-r13 -mfixed-range=f12-f15,f32-f127 \ > -falign-functions=32 -frename-registers -fno-optimize-sibling-calls > KBUILD_CFLAGS_KERNEL := -mconstant-gp > > -GAS_STATUS = $(shell $(srctree)/arch/ia64/scripts/check-gas "$(CC)" "$(OBJDUMP)") > -KBUILD_CPPFLAGS += $(shell $(srctree)/arch/ia64/scripts/toolchain-flags "$(CC)" "$(OBJDUMP)" "$(READELF)") > +GAS_STATUS = $(shell $(CONFIG_SHELL) $(srctree)/arch/ia64/scripts/check-gas "$(CC)" "$(OBJDUMP)") > +KBUILD_CPPFLAGS += $(shell $(CONFIG_SHELL) $(srctree)/arch/ia64/scripts/toolchain-flags "$(CC)" "$(OBJDUMP)" "$(READELF)") Here is an instance of what Masahiro-san pointed out being wrong. Ujjwal, will you send a v3? > > ifeq ($(GAS_STATUS),buggy) > $(error Sorry, you need a newer version of the assember, one that is built from \ > diff --git a/arch/nds32/kernel/vdso/Makefile b/arch/nds32/kernel/vdso/Makefile > index 55df25ef0057..e77d4bcfa7c1 100644 > --- a/arch/nds32/kernel/vdso/Makefile > +++ b/arch/nds32/kernel/vdso/Makefile > @@ -39,7 +39,7 @@ $(obj)/%.so: $(obj)/%.so.dbg FORCE > # Generate VDSO offsets using helper script > gen-vdsosym := $(srctree)/$(src)/gen_vdso_offsets.sh > quiet_cmd_vdsosym = VDSOSYM $@ > - cmd_vdsosym = $(NM) $< | $(gen-vdsosym) | LC_ALL=C sort > $@ > + cmd_vdsosym = $(NM) $< | $(CONFIG_SHELL) $(gen-vdsosym) | LC_ALL=C sort > $@ > > include/generated/vdso-offsets.h: $(obj)/vdso.so.dbg FORCE > $(call if_changed,vdsosym) > diff --git a/scripts/Makefile.build b/scripts/Makefile.build > index a467b9323442..893217ee4a17 100644 > --- a/scripts/Makefile.build > +++ b/scripts/Makefile.build > @@ -104,7 +104,7 @@ else ifeq ($(KBUILD_CHECKSRC),2) > endif > > ifneq ($(KBUILD_EXTRA_WARN),) > - cmd_checkdoc = $(srctree)/scripts/kernel-doc -none $< > + cmd_checkdoc = $(PERL) $(srctree)/scripts/kernel-doc -none $< > endif > > # Compile C sources (.c) > diff --git a/scripts/Makefile.package b/scripts/Makefile.package > index f952fb64789d..4fc16c4776cc 100644 > --- a/scripts/Makefile.package > +++ b/scripts/Makefile.package > @@ -44,7 +44,7 @@ if test "$(objtree)" != "$(srctree)"; then \ > echo >&2; \ > false; \ > fi ; \ > -$(srctree)/scripts/setlocalversion --save-scmversion; \ > +$(CONFIG_SHELL) $(srctree)/scripts/setlocalversion --save-scmversion; \ > tar -I $(KGZIP) -c $(RCS_TAR_IGNORE) -f $(2).tar.gz \ > --transform 's:^:$(2)/:S' $(TAR_CONTENT) $(3); \ > rm -f $(objtree)/.scmversion > @@ -123,7 +123,7 @@ git --git-dir=$(srctree)/.git archive --prefix=$(perf-tar)/ \ > mkdir -p $(perf-tar); \ > git --git-dir=$(srctree)/.git rev-parse HEAD > $(perf-tar)/HEAD; \ > (cd $(srctree)/tools/perf; \ > -util/PERF-VERSION-GEN $(CURDIR)/$(perf-tar)/); \ > +$(CONFIG_SHELL) util/PERF-VERSION-GEN $(CURDIR)/$(perf-tar)/); \ > tar rf $(perf-tar).tar $(perf-tar)/HEAD $(perf-tar)/PERF-VERSION-FILE; \ > rm -r $(perf-tar); \ > $(if $(findstring tar-src,$@),, \ > -- > 2.25.1 > > _______________________________________________ Linux-kernel-mentees mailing list Linux-kernel-mentees@lists.linuxfoundation.org https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees