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-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170215185902.ieu5geoezggnkvad@jeyu>
Date:   Wed, 15 Feb 2017 10:59:02 -0800
From:   Jessica Yu <jeyu@...hat.com>
To:     Josh Poimboeuf <jpoimboe@...hat.com>
Cc:     Ingo Molnar <mingo@...nel.org>, linux-kernel@...r.kernel.org,
        Marc MERLIN <marc@...lins.org>, Michal Marek <mmarek@...e.com>
Subject: Re: [PATCH] objtool: fix CONFIG_STACK_VALIDATION warning for
 out-of-tree modules

+++ Josh Poimboeuf [15/02/17 12:21 -0600]:
>When building a CONFIG_STACK_VALIDATION enabled kernel without the
>libelf devel package installed, the Makefile prints a warning:
>
>  "Cannot use CONFIG_STACK_VALIDATION, please install libelf-dev, libelf-devel or elfutils-libelf-devel"
>
>But when building an out-of-tree module, the warning doesn't show.
>Instead it tries to use objtool, and the build fails with:
>
>  /bin/sh: ./tools/objtool/objtool: No such file or directory
>
>Make sure the warning and the disabling of objtool occur in all cases,
>by moving the CONFIG_STACK_VALIDATION checks outside the 'ifeq
>($(KBUILD_EXTMOD),)' block in the Makefile.
>
>Reported-by: Marc MERLIN <marc@...lins.org>
>Suggested-by: Jessica Yu <jeyu@...hat.com>
>Fixes: 3b27a0c85d70 ("objtool: Detect and warn if libelf is missing and don't break the build")
>Signed-off-by: Josh Poimboeuf <jpoimboe@...hat.com>

With this patch the warning now prints for OOT modules, and more
importantly, the build no longer breaks for them, so:

Reviewed-by: Jessica Yu <jeyu@...hat.com>

>---
> Makefile | 24 ++++++++++++------------
> 1 file changed, 12 insertions(+), 12 deletions(-)
>
>diff --git a/Makefile b/Makefile
>index 8e223e0..bcf7036 100644
>--- a/Makefile
>+++ b/Makefile
>@@ -908,6 +908,18 @@ mod_sign_cmd = true
> endif
> export mod_sign_cmd
>
>+ifdef CONFIG_STACK_VALIDATION
>+  has_libelf := $(call try-run,\
>+		echo "int main() {}" | $(HOSTCC) -xc -o /dev/null -lelf -,1,0)
>+  ifeq ($(has_libelf),1)
>+    objtool_target := tools/objtool FORCE
>+  else
>+    $(warning "Cannot use CONFIG_STACK_VALIDATION, please install libelf-dev, libelf-devel or elfutils-libelf-devel")
>+    SKIP_STACK_VALIDATION := 1
>+    export SKIP_STACK_VALIDATION
>+  endif
>+endif
>+
>
> ifeq ($(KBUILD_EXTMOD),)
> core-y		+= kernel/ certs/ mm/ fs/ ipc/ security/ crypto/ block/
>@@ -1035,18 +1047,6 @@ prepare0: archprepare gcc-plugins
> # All the preparing..
> prepare: prepare0 prepare-objtool
>
>-ifdef CONFIG_STACK_VALIDATION
>-  has_libelf := $(call try-run,\
>-		echo "int main() {}" | $(HOSTCC) -xc -o /dev/null -lelf -,1,0)
>-  ifeq ($(has_libelf),1)
>-    objtool_target := tools/objtool FORCE
>-  else
>-    $(warning "Cannot use CONFIG_STACK_VALIDATION, please install libelf-dev, libelf-devel or elfutils-libelf-devel")
>-    SKIP_STACK_VALIDATION := 1
>-    export SKIP_STACK_VALIDATION
>-  endif
>-endif
>-
> PHONY += prepare-objtool
> prepare-objtool: $(objtool_target)
>
>-- 
>2.7.4
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ