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: <CAGXu5j+SHuqv0=gxdsYBqraPyZMWdVD+uxrtYrepVZBX3ZzTKw@mail.gmail.com>
Date:   Mon, 14 Jan 2019 15:16:17 -0800
From:   Kees Cook <keescook@...omium.org>
To:     Geert Uytterhoeven <geert+renesas@...der.be>
Cc:     Shuah Khan <shuah@...nel.org>,
        Masahiro Yamada <yamada.masahiro@...ionext.com>,
        Michal Marek <michal.lkml@...kovi.net>,
        Jonathan Corbet <corbet@....net>,
        Bamvor Jian Zhang <bamv2005@...il.com>,
        "open list:KERNEL SELFTEST FRAMEWORK" 
        <linux-kselftest@...r.kernel.org>,
        linux-kbuild <linux-kbuild@...r.kernel.org>,
        LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 05/12] selftests: seccomp: Fix test dependencies and rules

On Mon, Jan 14, 2019 at 5:51 AM Geert Uytterhoeven
<geert+renesas@...der.be> wrote:
>
> When building kselftest in a separate output directory, the seccomp_bpf
> binary ends up in the source directory instead of in the output
> directory, and the build of seccomp_benchmark fails:
>
>     make[5]: *** No rule to make target 'seccomp_benchmark', needed by 'all'.  Stop.
>
> Fix this by declaring both test binaries using TEST_GEN_PROGS, and using
> the build support from lib.mk properly.
>
> Fixes: 967d7ba841513910 ("selftests/seccomp: Add simple seccomp overhead benchmark")
> Signed-off-by: Geert Uytterhoeven <geert+renesas@...der.be>
> ---
>  tools/testing/selftests/seccomp/Makefile | 15 +++------------
>  1 file changed, 3 insertions(+), 12 deletions(-)
>
> diff --git a/tools/testing/selftests/seccomp/Makefile b/tools/testing/selftests/seccomp/Makefile
> index fce7f4ce069251a6..c728bd7a366f78b9 100644
> --- a/tools/testing/selftests/seccomp/Makefile
> +++ b/tools/testing/selftests/seccomp/Makefile
> @@ -1,17 +1,8 @@
>  # SPDX-License-Identifier: GPL-2.0
> -all:
>
> -include ../lib.mk
> -
> -.PHONY: all clean
> -
> -BINARIES := seccomp_bpf seccomp_benchmark
>  CFLAGS += -Wl,-no-as-needed -Wall
> +LDFLAGS += -lpthread
>
> -seccomp_bpf: seccomp_bpf.c ../kselftest_harness.h
> -       $(CC) $(CFLAGS) $(LDFLAGS) -lpthread $< -o $@
> +TEST_GEN_PROGS = seccomp_bpf seccomp_benchmark

This breaks the dep on ../kselftest_harness.h. Changes go unnoticed if
this is changed:

$ touch tools/testing/selftests/kselftest_harness.h
$ make O=/tmp/kselftest -C tools/testing/selftests
...
make[1]: Entering directory
'/home/kees/src/linux/tools/testing/selftests/seccomp'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory
'/home/kees/src/linux/tools/testing/selftests/seccomp'
...

>
> -TEST_PROGS += $(BINARIES)
> -EXTRA_CLEAN := $(BINARIES)
> -
> -all: $(BINARIES)
> +include ../lib.mk
> --
> 2.17.1
>


-- 
Kees Cook

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ