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: <CAMj1kXEPq6VU19qzmW9DNVG=nzoGbnCMt7dE5nXeZCqk2JPE3A@mail.gmail.com>
Date: Fri, 10 Jan 2025 19:11:10 +0100
From: Ard Biesheuvel <ardb@...nel.org>
To: Masahiro Yamada <masahiroy@...nel.org>
Cc: Ard Biesheuvel <ardb+git@...gle.com>, linux-kbuild@...r.kernel.org, 
	linux-kernel@...r.kernel.org, Linus Torvalds <torvalds@...ux-foundation.org>, 
	linux-riscv@...ts.infradead.org, linux-s390@...r.kernel.org
Subject: Re: [PATCH] kbuild: Strip runtime const RELA sections correctly

On Fri, 10 Jan 2025 at 13:14, Masahiro Yamada <masahiroy@...nel.org> wrote:
>
> On Fri, Jan 10, 2025 at 5:28 PM Ard Biesheuvel <ardb+git@...gle.com> wrote:
> >
> > From: Ard Biesheuvel <ardb@...nel.org>
> >
> > Due to the fact that runtime const ELF sections are named without a
> > leading period or double underscore, the RSTRIP logic that removes the
> > static RELA sections from vmlinux fails to identify them. This results
> > in a situation like below, where some sections that were supposed to get
> > removed are left behind.
> >
> >   [Nr] Name                              Type            Address          Off     Size   ES Flg Lk Inf Al
> >
> >   [58] runtime_shift_d_hash_shift        PROGBITS        ffffffff83500f50 2900f50 000014 00   A  0   0  1
> >   [59] .relaruntime_shift_d_hash_shift   RELA            0000000000000000 55b6f00 000078 18   I 70  58  8
> >   [60] runtime_ptr_dentry_hashtable      PROGBITS        ffffffff83500f68 2900f68 000014 00   A  0   0  1
> >   [61] .relaruntime_ptr_dentry_hashtable RELA            0000000000000000 55b6f78 000078 18   I 70  60  8
> >   [62] runtime_ptr_USER_PTR_MAX          PROGBITS        ffffffff83500f80 2900f80 000238 00   A  0   0  1
> >   [63] .relaruntime_ptr_USER_PTR_MAX     RELA            0000000000000000 55b6ff0 000d50 18   I 70  62  8
> >
> > So tweak the match expression to strip all sections starting with .rel.
> > While at it, consolidate the logic used by RISC-V, s390 and x86 into a
> > single shared Makefile library command.
>
> I do not know how this works because arch/*/Makefile.post
> do not include scripts/Makefile.lib
>

Apologies - it seems I didn't test this thoroughly.

The build happily completes without any errors, though - it appears
doing '$(call cmd,foo)' does not trigger an error when cmd_foo does
not exist.

I suppose this is a consequence of 8962b6b475bddc ("kbuild: print
short log in addition to the whole command with V=1") which introduced
an $(if ) where the else branch is simply ':' and so it always
succeeds.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ