Linux kbuild/kconfig development
 help / color / mirror / Atom feed
From: Matthew Maurer <mmaurer@google.com>
To: masahiroy@kernel.org, ndesaulniers@google.com, ojeda@kernel.org,
	 gary@garyguo.net, mcgrof@kernel.org,
	Alex Gaynor <alex.gaynor@gmail.com>,
	 Wedson Almeida Filho <wedsonaf@gmail.com>
Cc: "Matthew Maurer" <mmaurer@google.com>,
	rust-for-linux@vger.kernel.org, linux-kbuild@vger.kernel.org,
	linux-kernel@vger.kernel.org, neal@gompa.dev, marcan@marcan.st,
	j@jannau.net, asahi@lists.linux.dev,
	"Boqun Feng" <boqun.feng@gmail.com>,
	"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
	"Benno Lossin" <benno.lossin@proton.me>,
	"Andreas Hindborg" <a.hindborg@samsung.com>,
	"Alice Ryhl" <aliceryhl@google.com>
Subject: [PATCH v3 00/16] Extended MODVERSIONS Support
Date: Tue,  6 Aug 2024 21:20:26 +0000	[thread overview]
Message-ID: <20240806212106.617164-1-mmaurer@google.com> (raw)

Previously MODVERSIONS + RUST Redux [1]

This patch series is intended for use alongside the Implement
MODVERSIONS for RUST [2] series as a replacement for the symbol name
hashing approach used there to enable RUST and MODVERSIONS at the same
time.

Elsewhere, we've seen a desire for long symbol name support for LTO
symbol names [3], and the previous series came up [4] as a possible
solution rather than hashing, which some have objected [5] to.

This series adds a MODVERSIONS format which uses a section per column.
This avoids userspace tools breaking if we need to make a similar change
to the format in the future - we would do so by adding a new section,
rather than editing the struct definition. In the new format, the name
section is formatted as a concatenated sequence of NUL-terminated
strings, which allows for arbitrary length names.

Currently, this series emits both the extended format and the current
format on all modules, and prefers the extended format when checking if
present. I'm open to various other policies via Kconfig knobs, but this
seemed like a good initial default.

The refactor to MODVERSIONS is prefixed to this series as result of an
explicit request [6] by Luis in response to the original patchset.

If you are testing this patch alongside RUST by manually removing the
!MODVERSIONS restriction (this series doesn't remove it, because the
CRCs don't mean what we'd want them to yet, we need the DWARF patch for
that) and have kernel hardening enabled, you may need the CPU
Mitigations [7] series. Without it, the foo.mod.o file produced by the
C compiler will reference __x86_return_thunk, but foo.o will not.
This means that the version table will not contain a version for
__x86_return_thunk, but foo.ko will reference it, which will result
in a version check failure.

[1] https://lore.kernel.org/all/20231118025748.2778044-1-mmaurer@google.com/
[2] https://lore.kernel.org/all/20240617175818.58219-17-samitolvanen@google.com/
[3] https://lore.kernel.org/lkml/20240605032120.3179157-1-song@kernel.org/
[4] https://lore.kernel.org/lkml/ZoxbEEsK40ASi1cY@bombadil.infradead.org/
[5] https://lore.kernel.org/lkml/0b2697fd-7ab4-469f-83a6-ec9ebc701ba0@suse.com/
[6] https://lore.kernel.org/lkml/ZVZNh%2FPA5HiVRkeb@bombadil.infradead.org/
[7] https://lore.kernel.org/all/20240725183325.122827-1-ojeda@kernel.org/

Matthew Maurer (16):
  module: Take const arg in validate_section_offset
  module: Factor out elf_validity_ehdr
  module: Factor out elf_validity_cache_sechdrs
  module: Factor out elf_validity_cache_secstrings
  module: Factor out elf_validity_cache_index_info
  module: Factor out elf_validity_cache_index_mod
  module: Factor out elf_validity_cache_index_sym
  module: Factor out elf_validity_cache_index_str
  module: Group section index calculations together
  module: Factor out elf_validity_cache_strtab
  module: Additional validation in elf_validity_cache_strtab
  module: Reformat struct for code style
  export_report: Rehabilitate script
  modules: Support extended MODVERSIONS info
  modpost: Produce extended modversion information
  export_report: Use new version info format

 arch/powerpc/kernel/module_64.c |  24 +-
 kernel/module/internal.h        |  18 +-
 kernel/module/main.c            | 647 ++++++++++++++++++++++++--------
 kernel/module/version.c         |  43 +++
 scripts/export_report.pl        |  17 +-
 scripts/mod/modpost.c           |  39 +-
 6 files changed, 627 insertions(+), 161 deletions(-)

-- 
2.46.0.rc2.264.g509ed76dc8-goog


             reply	other threads:[~2024-08-06 21:21 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-06 21:20 Matthew Maurer [this message]
2024-08-06 21:20 ` [PATCH v3 01/16] module: Take const arg in validate_section_offset Matthew Maurer
2024-08-06 21:20 ` [PATCH v3 02/16] module: Factor out elf_validity_ehdr Matthew Maurer
2024-08-06 21:20 ` [PATCH v3 03/16] module: Factor out elf_validity_cache_sechdrs Matthew Maurer
2024-08-06 21:20 ` [PATCH v3 04/16] module: Factor out elf_validity_cache_secstrings Matthew Maurer
2024-08-06 21:20 ` [PATCH v3 05/16] module: Factor out elf_validity_cache_index_info Matthew Maurer
2024-08-06 21:20 ` [PATCH v3 06/16] module: Factor out elf_validity_cache_index_mod Matthew Maurer
2024-08-06 21:20 ` [PATCH v3 07/16] module: Factor out elf_validity_cache_index_sym Matthew Maurer
2024-08-06 21:20 ` [PATCH v3 08/16] module: Factor out elf_validity_cache_index_str Matthew Maurer
2024-08-06 21:20 ` [PATCH v3 09/16] module: Group section index calculations together Matthew Maurer
2024-08-06 21:20 ` [PATCH v3 10/16] module: Factor out elf_validity_cache_strtab Matthew Maurer
2024-08-06 21:20 ` [PATCH v3 11/16] module: Additional validation in elf_validity_cache_strtab Matthew Maurer
2024-08-06 21:20 ` [PATCH v3 12/16] module: Reformat struct for code style Matthew Maurer
2024-08-06 21:20 ` [PATCH v3 13/16] export_report: Rehabilitate script Matthew Maurer
2024-08-06 21:20 ` [PATCH v3 14/16] modules: Support extended MODVERSIONS info Matthew Maurer
2024-08-15 20:33   ` Sami Tolvanen
2024-08-16 23:04   ` Michael Ellerman
2024-08-19 23:41     ` Matthew Maurer
2024-08-20  2:46       ` Michael Ellerman
2024-08-06 21:20 ` [PATCH v3 15/16] modpost: Produce extended modversion information Matthew Maurer
2024-08-06 21:20 ` [PATCH v3 16/16] export_report: Use new version info format Matthew Maurer
2024-08-15 20:57 ` [PATCH v3 00/16] Extended MODVERSIONS Support Sami Tolvanen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240806212106.617164-1-mmaurer@google.com \
    --to=mmaurer@google.com \
    --cc=a.hindborg@samsung.com \
    --cc=alex.gaynor@gmail.com \
    --cc=aliceryhl@google.com \
    --cc=asahi@lists.linux.dev \
    --cc=benno.lossin@proton.me \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun.feng@gmail.com \
    --cc=gary@garyguo.net \
    --cc=j@jannau.net \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcan@marcan.st \
    --cc=masahiroy@kernel.org \
    --cc=mcgrof@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=neal@gompa.dev \
    --cc=ojeda@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=wedsonaf@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox