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: <20230824185930.GA2025001@dev-arch.thelio-3990X>
Date:   Thu, 24 Aug 2023 11:59:30 -0700
From:   Nathan Chancellor <nathan@...nel.org>
To:     Masahiro Yamada <masahiroy@...nel.org>
Cc:     linux-kbuild@...r.kernel.org, linux-kernel@...r.kernel.org,
        Nick Desaulniers <ndesaulniers@...gle.com>,
        Nicolas Schier <nicolas@...sle.eu>
Subject: Re: [PATCH] kbuild: get lib-y objects back to static library

On Wed, Aug 23, 2023 at 01:20:42PM -0700, Nathan Chancellor wrote:
> Hi Masahiro,
> 
> On Wed, Aug 23, 2023 at 09:08:16PM +0900, Masahiro Yamada wrote:
> > Revert the following two commits:
> > 
> >  - 7273ad2b08f8 ("kbuild: link lib-y objects to vmlinux forcibly when CONFIG_MODULES=y")
> >  - 7f2084fa55e6 ("[kbuild] handle exports in lib-y objects reliably")
> > 
> > Now, lib-y is back to static library again, and the link order is
> > consistent w/wo CONFIG_MODULES.
> > 
> > Since commit ddb5cdbafaaa ("kbuild: generate KSYMTAB entries by
> > modpost"), .vmlinux.export.c contains references to exported symbols.
> > If a symbol in a lib-y object is exported, that object is always linked
> > even without any explicit user in vmlinux.
> > 
> > Signed-off-by: Masahiro Yamada <masahiroy@...nel.org>
> > ---
> > 
> >  Makefile | 5 -----
> >  1 file changed, 5 deletions(-)
> > 
> > diff --git a/Makefile b/Makefile
> > index 87a9eef3fb4b..71e9c65d9eae 100644
> > --- a/Makefile
> > +++ b/Makefile
> > @@ -1113,12 +1113,7 @@ export ARCH_DRIVERS	:= $(drivers-y) $(drivers-m)
> >  # Externally visible symbols (used by link-vmlinux.sh)
> >  
> >  KBUILD_VMLINUX_OBJS := ./built-in.a
> > -ifdef CONFIG_MODULES
> > -KBUILD_VMLINUX_OBJS += $(patsubst %/, %/lib.a, $(filter %/, $(libs-y)))
> > -KBUILD_VMLINUX_LIBS := $(filter-out %/, $(libs-y))
> > -else
> >  KBUILD_VMLINUX_LIBS := $(patsubst %/,%/lib.a, $(libs-y))
> > -endif
> >  
> >  export KBUILD_VMLINUX_LIBS
> >  export KBUILD_LDS          := arch/$(SRCARCH)/kernel/vmlinux.lds
> > -- 
> > 2.39.2
> > 
> 
> The build error that prompted 7273ad2b08f8 from [1] appears to return
> with this patch, for example:
> 
> $ make -skj"$(nproc)" ARCH=arm64 LLVM=1 O=build mrproper virtconfig all
> ...
> ERROR: modpost: "__memcat_p" [drivers/hwtracing/stm/stm_core.ko] undefined!
> ...
> 
> [1]: https://github.com/ClangBuiltLinux/linux/issues/515

One thing I forgot to note with this is this occurs when targeting arm,
arm64, hexagon, i386, powerpc, s390, and x86_64 with various in-tree
configurations (I can provide a list if necessary).

Cheers,
Nathan

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ