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] [day] [month] [year] [list]
Message-ID: <ff7fecca-8413-6625-4d10-a6b3c21fc24d@redhat.com>
Date:   Sat, 5 Aug 2023 00:09:49 +0200
From:   Paolo Bonzini <pbonzini@...hat.com>
To:     Mark Brown <broonie@...nel.org>,
        Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
        Peter Zijlstra <peterz@...radead.org>,
        "Paul E. McKenney" <paulmck@...nel.org>,
        Boqun Feng <boqun.feng@...il.com>,
        Shuah Khan <shuah@...nel.org>,
        Sean Christopherson <seanjc@...gle.com>
Cc:     Aaron Lewis <aaronlewis@...gle.com>, stable@...r.kernel.org,
        kvm@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-kselftest@...r.kernel.org
Subject: Re: [PATCH] selftests/rseq: Fix build with undefined __weak

On 8/4/23 21:22, Mark Brown wrote:
> Commit 3bcbc20942db ("selftests/rseq: Play nice with binaries statically
> linked against glibc 2.35+") which is now in Linus' tree introduced uses
> of __weak but did nothing to ensure that a definition is provided for it
> resulting in build failures for the rseq tests:
> 
> rseq.c:41:1: error: unknown type name '__weak'
> __weak ptrdiff_t __rseq_offset;
> ^
> rseq.c:41:17: error: expected ';' after top level declarator
> __weak ptrdiff_t __rseq_offset;
>                  ^
>                  ;
> rseq.c:42:1: error: unknown type name '__weak'
> __weak unsigned int __rseq_size;
> ^
> rseq.c:43:1: error: unknown type name '__weak'
> __weak unsigned int __rseq_flags;
> 
> Fix this by using the definition from tools/include compiler.h.
> 

Queued, thanks.  Sorry for the breakage.

Paolo

> Fixes: 3bcbc20942db ("selftests/rseq: Play nice with binaries statically linked against glibc 2.35+")
> Signed-off-by: Mark Brown <broonie@...nel.org>
> ---
> It'd be good if the KVM testing could include builds of the rseq
> selftests, the KVM tests pull in code from rseq but not the build system
> which has resulted in multiple failures like this.
> ---
>   tools/testing/selftests/rseq/Makefile | 4 +++-
>   tools/testing/selftests/rseq/rseq.c   | 2 ++
>   2 files changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/testing/selftests/rseq/Makefile b/tools/testing/selftests/rseq/Makefile
> index b357ba24af06..7a957c7d459a 100644
> --- a/tools/testing/selftests/rseq/Makefile
> +++ b/tools/testing/selftests/rseq/Makefile
> @@ -4,8 +4,10 @@ ifneq ($(shell $(CC) --version 2>&1 | head -n 1 | grep clang),)
>   CLANG_FLAGS += -no-integrated-as
>   endif
>   
> +top_srcdir = ../../../..
> +
>   CFLAGS += -O2 -Wall -g -I./ $(KHDR_INCLUDES) -L$(OUTPUT) -Wl,-rpath=./ \
> -	  $(CLANG_FLAGS)
> +	  $(CLANG_FLAGS) -I$(top_srcdir)/tools/include
>   LDLIBS += -lpthread -ldl
>   
>   # Own dependencies because we only want to build against 1st prerequisite, but
> diff --git a/tools/testing/selftests/rseq/rseq.c b/tools/testing/selftests/rseq/rseq.c
> index a723da253244..96e812bdf8a4 100644
> --- a/tools/testing/selftests/rseq/rseq.c
> +++ b/tools/testing/selftests/rseq/rseq.c
> @@ -31,6 +31,8 @@
>   #include <sys/auxv.h>
>   #include <linux/auxvec.h>
>   
> +#include <linux/compiler.h>
> +
>   #include "../kselftest.h"
>   #include "rseq.h"
>   
> 
> ---
> base-commit: 5d0c230f1de8c7515b6567d9afba1f196fb4e2f4
> change-id: 20230804-kselftest-rseq-build-9d537942b1de
> 
> Best regards,

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ