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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1532495771-10255-2-git-send-email-yamada.masahiro@socionext.com>
Date:   Wed, 25 Jul 2018 14:16:11 +0900
From:   Masahiro Yamada <yamada.masahiro@...ionext.com>
To:     linux-kbuild@...r.kernel.org
Cc:     Sam Ravnborg <sam@...nborg.org>,
        Masahiro Yamada <yamada.masahiro@...ionext.com>,
        linux-s390@...r.kernel.org,
        Heiko Carstens <heiko.carstens@...ibm.com>,
        linux-um@...ts.infradead.org, linux-kernel@...r.kernel.org,
        Michal Marek <michal.lkml@...kovi.net>,
        Richard Weinberger <richard@....at>,
        Martin Schwidefsky <schwidefsky@...ibm.com>,
        Jeff Dike <jdike@...toit.com>,
        Hendrik Brueckner <brueckner@...ux.vnet.ibm.com>
Subject: [PATCH 2/2] kbuild: do not redirect the first prerequisite for filechk

Currently, filechk unconditionally opens the first prerequisite and
redirects it as the stdin of a filechk_* rule.  Hence, every target
using $(call filechk,...) must list something as the first prerequisite
even if it is unneeded.

'< $<' is actually unneeded in most cases.  Each rule can explicitly
adds it if necessary.

Signed-off-by: Masahiro Yamada <yamada.masahiro@...ionext.com>
---

 Makefile                           | 2 +-
 arch/s390/kernel/syscalls/Makefile | 6 +++---
 arch/um/Makefile                   | 2 +-
 scripts/Kbuild.include             | 2 +-
 scripts/Makefile.lib               | 2 +-
 5 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/Makefile b/Makefile
index 67d9d20..af863f1 100644
--- a/Makefile
+++ b/Makefile
@@ -1116,7 +1116,7 @@ define filechk_version.h
 	echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))';)
 endef
 
-$(version_h): $(srctree)/Makefile FORCE
+$(version_h): FORCE
 	$(call filechk,version.h)
 	$(Q)rm -f $(old_version_h)
 
diff --git a/arch/s390/kernel/syscalls/Makefile b/arch/s390/kernel/syscalls/Makefile
index 8ff96c0..4d929ed 100644
--- a/arch/s390/kernel/syscalls/Makefile
+++ b/arch/s390/kernel/syscalls/Makefile
@@ -25,15 +25,15 @@ _dummy := $(shell [ -d '$(uapi)' ] || mkdir -p '$(uapi)') \
 	  $(shell [ -d '$(kapi)' ] || mkdir -p '$(kapi)')
 
 define filechk_syshdr
-	$(CONFIG_SHELL) '$(systbl)' -H -a $(syshdr_abi_$(basetarget)) -f "$2"
+	$(CONFIG_SHELL) '$(systbl)' -H -a $(syshdr_abi_$(basetarget)) -f "$2" < $<
 endef
 
 define filechk_sysnr
-	$(CONFIG_SHELL) '$(systbl)' -N -a $(sysnr_abi_$(basetarget))
+	$(CONFIG_SHELL) '$(systbl)' -N -a $(sysnr_abi_$(basetarget)) < $<
 endef
 
 define filechk_syscalls
-	$(CONFIG_SHELL) '$(systbl)' -S
+	$(CONFIG_SHELL) '$(systbl)' -S < $<
 endef
 
 syshdr_abi_unistd_32 := common,32
diff --git a/arch/um/Makefile b/arch/um/Makefile
index e54dda8..8c35261 100644
--- a/arch/um/Makefile
+++ b/arch/um/Makefile
@@ -169,7 +169,7 @@ define filechk_gen-asm-offsets
          echo " *"; \
          echo " */"; \
          echo ""; \
-         sed -ne "/^->/{s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}"; \
+         sed -ne "/^->/{s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}" < $<; \
          echo ""; )
 endef
 
diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include
index 86321f0..0bee89c 100644
--- a/scripts/Kbuild.include
+++ b/scripts/Kbuild.include
@@ -56,7 +56,7 @@ kecho := $($(quiet)kecho)
 define filechk
 	$(Q)set -e;				\
 	mkdir -p $(dir $@);			\
-	$(filechk_$(1)) < $< > $@...p;		\
+	$(filechk_$(1)) > $@...p;		\
 	if [ -r $@ ] && cmp -s $@ $@...p; then	\
 		rm -f $@...p;			\
 	else					\
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 1bb594f..4b2f89f 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -416,7 +416,7 @@ define filechk_offsets
 	 echo " * This file was generated by Kbuild"; \
 	 echo " */"; \
 	 echo ""; \
-	 sed -ne $(sed-offsets); \
+	 sed -ne $(sed-offsets) < $<; \
 	 echo ""; \
 	 echo "#endif" )
 endef
-- 
2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ