public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Masahiro Yamada <masahiroy@kernel.org>
To: linux-kbuild@vger.kernel.org
Cc: Masahiro Yamada <masahiroy@kernel.org>,
	Michal Marek <michal.lkml@markovi.net>,
	Nick Desaulniers <ndesaulniers@google.com>,
	linux-kernel@vger.kernel.org
Subject: [PATCH 4/4] kbuild: error out if $(INSTALL_MOD_PATH) contains % or :
Date: Thu, 14 Jul 2022 14:02:43 +0900	[thread overview]
Message-ID: <20220714050243.16411-4-masahiroy@kernel.org> (raw)
In-Reply-To: <20220714050243.16411-1-masahiroy@kernel.org>

If the directory pass given to INSTALL_MOD_PATH contains % or :,
the module_install fails.

% is used in pattern rules, and : as the separator of dependencies.

Bail out with a clearer error message.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 scripts/Makefile.modinst | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/scripts/Makefile.modinst b/scripts/Makefile.modinst
index 16a02e9237d3..a4c987c23750 100644
--- a/scripts/Makefile.modinst
+++ b/scripts/Makefile.modinst
@@ -18,6 +18,9 @@ INSTALL_MOD_DIR ?= extra
 dst := $(MODLIB)/$(INSTALL_MOD_DIR)
 endif
 
+$(foreach x, % :, $(if $(findstring $x, $(dst)), \
+	$(error module installation path cannot contain '$x')))
+
 suffix-y				:=
 suffix-$(CONFIG_MODULE_COMPRESS_GZIP)	:= .gz
 suffix-$(CONFIG_MODULE_COMPRESS_XZ)	:= .xz
-- 
2.34.1


  parent reply	other threads:[~2022-07-14  5:07 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-14  5:02 [PATCH 1/4] kbuild: rpm-pkg: fix build error when _arch is undefined Masahiro Yamada
2022-07-14  5:02 ` [PATCH 2/4] kbuild: rpm-pkg: pass 'linux' to --target option of rpmbuild Masahiro Yamada
2022-07-14  5:02 ` [PATCH 3/4] kbuild: error out if $(KBUILD_EXTMOD) contains % or : Masahiro Yamada
2022-07-15  9:17   ` Nicolas Schier
2022-07-16 15:38   ` Masahiro Yamada
2022-07-14  5:02 ` Masahiro Yamada [this message]
2022-07-15  9:17   ` [PATCH 4/4] kbuild: error out if $(INSTALL_MOD_PATH) " Nicolas Schier
2022-07-16 15:40   ` Masahiro Yamada

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220714050243.16411-4-masahiroy@kernel.org \
    --to=masahiroy@kernel.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michal.lkml@markovi.net \
    --cc=ndesaulniers@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox