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: <YrR2j74IWiGrUKFr@FVFF77S0Q05N.cambridge.arm.com>
Date:   Thu, 23 Jun 2022 15:19:59 +0100
From:   Mark Rutland <mark.rutland@....com>
To:     Ard Biesheuvel <ardb@...nel.org>
Cc:     Peter Zijlstra <peterz@...radead.org>,
        Steven Rostedt <rostedt@...dmis.org>, X86 ML <x86@...nel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Josh Poimboeuf <jpoimboe@...hat.com>,
        Christophe Leroy <christophe.leroy@...roup.eu>,
        "Naveen N . Rao" <naveen.n.rao@...ux.vnet.ibm.com>,
        Miroslav Benes <mbenes@...e.cz>,
        Nathan Chancellor <nathan@...nel.org>,
        Nick Desaulniers <ndesaulniers@...gle.com>
Subject: Re: [RFC][PATCH] ftrace,objtool: PC32 based __mcount_loc

On Tue, Jun 21, 2022 at 06:27:39PM +0200, Ard Biesheuvel wrote:
> On Fri, 17 Jun 2022 at 13:40, Mark Rutland <mark.rutland@....com> wrote:
> >
> > On Fri, Jun 17, 2022 at 01:24:53PM +0200, Peter Zijlstra wrote:
> > >
> > > Hi,
> > >
> > > I recently noticed that __mcount_loc is 64bit wide, containing absolute
> > > addresses. Since __mcount_loc is a permanent section (not one we drop
> > > after boot), this bloats the kernel memory usage for no real purpose.
> > >
> > > The below patch adds __mcount_loc_32 and objtool support to generate it.
> > > This saves, on an x86_64-defconfig + FTRACE, 23975*4 ~= 94K of permanent
> > > storage.
> >
> > We have a similar issue on arm64, which is exacerbated by needing ABS64
> > relocations (24 bytes per entry!) adding significant bloat when FTRACE is
> > enabled.
> >
> > It'd be really nice if going forwards compilers could expose an option to
> > generate PC32/PREL32 entries directly for this.
> 
> As opposed to generating absolute references today? Or as opposed to
> having to rely on our own tooling?

Both; My prefrence would be the compiler had the option to generate these
entries as relative at compile-time, without needing a binary post-processing
step.

That said, from my PoV this is one of the things that I think it's somewhat
reasonable for objtool to do, as it's arguably akin to the build-time sort, and
doesn't require deep knowledge of the control flow, etc.

Thanks,
Mark.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ