lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 10 Jan 2022 08:59:52 +0000
From:   SeongJae Park <sj@...nel.org>
To:     ojeda@...nel.org
Cc:     alex.gaynor@...il.com, wedsonaf@...gle.com,
        akpm@...ux-foundation.org, wei.liu@...nel.org,
        linux-kernel@...r.kernel.org, rust-for-linux@...r.kernel.org,
        SeongJae Park <sj@...nel.org>
Subject: [PATCH v2 for-rust-for-linux] init/Kconfig: Specify the interpreter for rust-version.sh

Some common tools like 'diff' don't support permissions of the files.
Due to that, 'rust-version.sh' in some trees including '-mm' result in
having no execution permission, and therefore build fails like below:

    $ make O=../linux.out/ olddefconfig
    make[1]: Entering directory 'linux.out'
      GEN     Makefile
    sh: 1: linux/scripts/rust-version.sh: Permission denied
    init/Kconfig:71: syntax error
    init/Kconfig:70: invalid statement
    linux/scripts/kconfig/Makefile:77: recipe for target 'olddefconfig' failed
    make[2]: *** [olddefconfig] Error 1
    linux/Makefile:666: recipe for target 'olddefconfig' failed
    make[1]: *** [olddefconfig] Error 2
    make[1]: Leaving directory 'linux.out'
    Makefile:226: recipe for target '__sub-make' failed
    make: *** [__sub-make] Error 2

It's not a big deal, but not so fun.  This commit works around the issue
by specifying the interpreter for 'rust-version.sh' in the Kconfig file.
The ugly work around wouldn't be needed once 'rust-version.sh' file is
merged in the mainline with the execution permission.

Signed-off-by: SeongJae Park <sj@...nel.org>
Reviewed-by: Wei Liu <wei.liu@...nel.org>
---
Changes from v1
(https://lore.kernel.org/all/20220106123357.16220-1-sj@kernel.org/)
- Collect 'Reviewed-by:' from Wei Liu
- Specify that this is temporal workaround and when it can be reverted
  (Miguel Ojeda)

 init/Kconfig | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/init/Kconfig b/init/Kconfig
index cd23faa163d1..d3707b9f222c 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -67,7 +67,13 @@ config HAS_RUST
 config RUSTC_VERSION
 	depends on HAS_RUST
 	int
-	default $(shell,$(srctree)/scripts/rust-version.sh $(RUSTC))
+	# Because some common tools like 'diff' don't support permissions of
+	# the files, 'rust-version.sh' in some trees that managed with such
+	# tools result in having no execution permission.  As a temporal work
+	# around, we specify the interpreter ('/bin/sh').  It will be unneeded
+	# once 'rust-version.sh' is merged in the mainline with its execution
+	# permission.
+	default $(shell,/bin/sh $(srctree)/scripts/rust-version.sh $(RUSTC))
 
 config CC_CAN_LINK
 	bool
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ