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-next>] [day] [month] [year] [list]
Message-ID: <20250121162119.2c3c0a4a@gandalf.local.home>
Date: Tue, 21 Jan 2025 16:21:19 -0500
From: Steven Rostedt <rostedt@...dmis.org>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: LKML <linux-kernel@...r.kernel.org>, linux-kbuild@...r.kernel.org,
 Masami Hiramatsu <mhiramat@...nel.org>, Mathieu Desnoyers
 <mathieu.desnoyers@...icios.com>, Mark Rutland <mark.rutland@....com>,
 Peter Zijlstra <peterz@...radead.org>, Andrew Morton
 <akpm@...ux-foundation.org>, Mathieu Desnoyers
 <mathieu.desnoyers@...icios.com>, Masahiro Yamada <masahiroy@...nel.org>,
 Nathan Chancellor  <nathan@...nel.org>, Nicolas Schier <nicolas@...sle.eu>,
 Zheng Yejian  <zhengyejian1@...wei.com>, Martin  Kelly
 <martin.kelly@...wdstrike.com>, Christophe Leroy
 <christophe.leroy@...roup.eu>, Josh Poimboeuf  <jpoimboe@...hat.com>
Subject: [GIT PULL] scripts/sorttable: Updates for 6.14



Linus,

Updates to scripts/sorttable for 6.14:

The sorttable.c was a copy from recordmcount.c which is very hard to
maintain. That's because it uses macro helpers and places the code in a
header file sorttable.h to handle both the 64 bit and 32 bit version of
the Elf structures. It also uses _r()/r()/r2() wrappers around accessing
the data which will read the 64 bit or 32 bit version of the data as well
as handle endianess. If the wrong wrapper is used, an invalid value will
result, and this has been a cause for bugs in the past. In fact the new
ORC code doesn't even use it. That's fine because ORC is only for 64 bit
x86 which is the default parsing.

Instead of having a bunch of macros defined and then include the code
twice from a header, the Elf structures are each wrapped in a union.  The
union holds the 64 bit and 32 bit version of the needed structure. Then
a structure of function pointers is used, along with helper macros
to access the ELF types appropriately for their byte size and endianess.
How to reference the data fields is moved from the code that implements
the sorting to the helper functions where all accesses to a field will
use he same helper function. As long as the helper functions access
the fields correctly, the code will also access the fields. This is
an improvement over having to code implementing the sorting having to
make sure it always uses the right accessor function when reading an
ELF field.

This is a clean up only, the functionality of the scripts/sorttable.c
does not change.


Please pull the latest trace-sorttable-v6.14 tree, which can be found at:


  git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git
trace-sorttable-v6.14

Tag SHA1: fabf1492e45892c215eff466f80b62284f50854f
Head SHA1: 1e5f6771c247b28135307058d2cfe3b0153733dc


Steven Rostedt (15):
      scripts/sorttable: Remove unused macro defines
      scripts/sorttable: Remove unused write functions
      scripts/sorttable: Remove unneeded Elf_Rel
      scripts/sorttable: Have the ORC code use the _r() functions to read
      scripts/sorttable: Make compare_extable() into two functions
      scripts/sorttable: Convert Elf_Ehdr to union
      scripts/sorttable: Replace Elf_Shdr Macro with a union
      scripts/sorttable: Convert Elf_Sym MACRO over to a union
      scripts/sorttable: Add helper functions for Elf_Ehdr
      scripts/sorttable: Add helper functions for Elf_Shdr
      scripts/sorttable: Add helper functions for Elf_Sym
      scripts/sorttable: Use uint64_t for mcount sorting
      scripts/sorttable: Move code from sorttable.h into sorttable.c
      scripts/sorttable: Get start/stop_mcount_loc from ELF file directly
      scripts/sorttable: Use a structure of function pointers for elf helpers

----
 scripts/sorttable.c | 740 ++++++++++++++++++++++++++++++++++++++++++++++++----
 scripts/sorttable.h | 500 -----------------------------------
 2 files changed, 685 insertions(+), 555 deletions(-)
 delete mode 100644 scripts/sorttable.h
---------------------------

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ