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: <20250113154141.42646-N-hca@linux.ibm.com>
Date: Mon, 13 Jan 2025 16:41:41 +0100
From: Heiko Carstens <hca@...ux.ibm.com>
To: Steven Rostedt <rostedt@...dmis.org>
Cc: LKML <linux-kernel@...r.kernel.org>,
        Linux Trace Kernel <linux-trace-kernel@...r.kernel.org>,
        linux-arm-kernel@...ts.infradead.org,
        Catalin Marinas <catalin.marinas@....com>,
        Will Deacon <will@...nel.org>, Josh Poimboeuf <jpoimboe@...hat.com>,
        Masami Hiramatsu <mhiramat@...nel.org>,
        Mark Rutland <mark.rutland@....com>,
        Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
        Linus Torvalds <torvalds@...ux-foundation.org>,
        Vasily Gorbik <gor@...ux.ibm.com>, linux-s390@...r.kernel.org
Subject: Re: [RFC][PATCH] arm64: scripts/sorttable: Implement sorting
 mcount_loc at build for arm64

Hi Steven,

On Tue, Jan 07, 2025 at 08:32:14AM -0500, Steven Rostedt wrote:
> From: Steven Rostedt <rostedt@...dmis.org>
> 
> The mcount_loc section holds the addresses of the functions that get
> patched by ftrace when enabling function callbacks. It can contain tens of
> thousands of entries. These addresses must be sorted. If they are not
> sorted at compile time, they are sorted at boot. Sorting at boot does take
> some time and does have a small impact on boot overhead.
> 
> x86 and arm32 have the addresses in the mcount_loc section of the ELF
> file. But for arm64, the section just contains zeros. The .rela.dyn
> Elf_Rela section holds the addresses and they get patched at boot during
> the relocation phase.
> 
> In order to sort these addresses, the Elf_Rela needs to be updated instead
> of the location in the binary that holds the mcount_loc section. Have the
> sorttable code, allocate an array to hold the function addresses, load the
> addresses from the Elf_Rela entries, sort them, then put them back in
> order into the Elf_rela entries so that they will be sorted at boot up
> without having to sort them during boot up.
> 
> Signed-off-by: Steven Rostedt (Google) <rostedt@...dmis.org>
> ---
> 
> Note, this is based on top of my sorttable clean up code:
> 
>   https://lore.kernel.org/linux-trace-kernel/20250105162211.971039541@goodmis.org/
>   git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git sorttable/for-next
> 
> I tested this on a arm64 VM (running on x86 host), with
> CONFIG_FTRACE_SORT_STARTUP_TEST enabled, which verifies the mcount entries
> are sorted at boot up.
> 
> I wonder if this will also work for s390? But I do not know s390 Elf layout.

Thanks for the hint! We look into this, but it might take some time.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ