Thread (3 messages) 3 messages, 2 authors, 2026-01-06

Re: ftrace: sorttable unable to sort ELF64 on 32-bit host

From: Steven Rostedt <rostedt@goodmis.org>
Date: 2026-01-06 17:21:24
Also in: stable

On Thu, 20 Mar 2025 17:02:06 -0500
Sahil Gupta [off-list ref] wrote:
Hi Steven,
Hi,

Sorry for the really late reply. I'm cleaning out my inbox and just noticed
this email.
On 6.12.0, sorttable is unable to sort 64-bit ELFs on 32-bit hosts
because of the parsing of the start_mcount_loc and stop_mcount_loc
values in get_mcount_loc():

  *_start = strtoul(start_buff, NULL, 16);

and

 *_stop = strtoul(stop_buff, NULL, 16);

This code makes the (often correct) assumption that the host and the
target have the same architecture, however it runs into issues when
compiling for a 64-bit target on a 32-bit host, as unsigned long is
shorter than the pointer width. As a result, I've noticed that both
start and stop max out at 2^32 - 1.

It seems that commit 4acda8ed fixes this issue inadvertently by
directly extracting them from the ELF using the correct width. I'm
wondering if it is possible to backport this as well as the other
sorttable refactors to 6.12.0 since they fix this issue.
I think this is a good reason to mark that commit as stable and backport it
to 6.12.

-- Steve
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help