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]
Date:   Thu, 30 Jul 2020 16:11:17 -0700
From:   Nick Desaulniers <ndesaulniers@...gle.com>
To:     Pingfan Liu <kernelfans@...il.com>
Cc:     "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" <x86@...nel.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
        "H. Peter Anvin" <hpa@...or.com>,
        Hans de Goede <hdegoede@...hat.com>,
        Arvind Sankar <nivedita@...m.mit.edu>,
        Steve Wahl <steve.wahl@....com>,
        LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] x86/purgatory: strip debug info

On Thu, Jul 30, 2020 at 1:27 AM Pingfan Liu <kernelfans@...il.com> wrote:
>
> It is useless to keep debug info in purgatory. And discarding them saves
> about 200K space.
>
> Original:
>   259080  kexec-purgatory.o
> Stripped:
>    29152  kexec-purgatory.o
>
> Signed-off-by: Pingfan Liu <kernelfans@...il.com>
> Cc: Thomas Gleixner <tglx@...utronix.de>
> Cc: Ingo Molnar <mingo@...hat.com>
> Cc: Borislav Petkov <bp@...en8.de>
> Cc: "H. Peter Anvin" <hpa@...or.com>
> Cc: Hans de Goede <hdegoede@...hat.com>
> Cc: Nick Desaulniers <ndesaulniers@...gle.com>
> Cc: Arvind Sankar <nivedita@...m.mit.edu>
> Cc: Steve Wahl <steve.wahl@....com>
> Cc: linux-kernel@...r.kernel.org
> To: x86@...nel.org

I don't see any code in
arch/x86/purgatory/
arch/x86/include/asm/purgatory.h
include/linux/purgatory.h
include/uapi/linux/kexec.h
kernel/kexec*
include/linux/kexec.h
include/linux/crash_dump.h
kernel/crash_dump.c
arch/x86/kernel/crash*
https://github.com/horms/kexec-tools/tree/master/kexec/arch/x86_64
that mentions any kind of debug info section.  I'm not sure what you'd
do with the debug info anyway for this binary.  So I suspect this
information should ok to discard.

This works, but it might be faster to build to not generate the
compile info in the first place via compile flag `-g0`, which could be
added `ifdef CONFIG_DEBUG_INFO` or even just unconditionally.  That
way we're not doing additional work to generate debug info, then
additional work to throw it away.

> ---
>  arch/x86/purgatory/Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/x86/purgatory/Makefile b/arch/x86/purgatory/Makefile
> index 088bd76..4340ae6 100644
> --- a/arch/x86/purgatory/Makefile
> +++ b/arch/x86/purgatory/Makefile
> @@ -16,7 +16,7 @@ CFLAGS_sha256.o := -D__DISABLE_EXPORTS
>
>  # When linking purgatory.ro with -r unresolved symbols are not checked,
>  # also link a purgatory.chk binary without -r to check for unresolved symbols.
> -PURGATORY_LDFLAGS := -e purgatory_start -nostdlib -z nodefaultlib
> +PURGATORY_LDFLAGS := -e purgatory_start -nostdlib -z nodefaultlib -S
>  LDFLAGS_purgatory.ro := -r $(PURGATORY_LDFLAGS)
>  LDFLAGS_purgatory.chk := $(PURGATORY_LDFLAGS)
>  targets += purgatory.ro purgatory.chk
> --
> 2.7.5
>


-- 
Thanks,
~Nick Desaulniers

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ