From: Sami Tolvanen <samitolvanen@google.com>
To: Matthew Maurer <mmaurer@google.com>
Cc: masahiroy@kernel.org, ndesaulniers@google.com, ojeda@kernel.org,
gary@garyguo.net, mcgrof@kernel.org,
"Michael Ellerman" <mpe@ellerman.id.au>,
"Alex Gaynor" <alex.gaynor@gmail.com>,
"Benjamin Gray" <bgray@linux.ibm.com>,
"Naveen N Rao" <naveen@kernel.org>,
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,
"Nicholas Piggin" <npiggin@gmail.com>,
"Christophe Leroy" <christophe.leroy@csgroup.eu>,
"Madhavan Srinivasan" <maddy@linux.ibm.com>,
"Petr Pavlu" <petr.pavlu@suse.com>,
"Daniel Gomez" <da.gomez@samsung.com>,
"Boqun Feng" <boqun.feng@gmail.com>,
"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
"Benno Lossin" <benno.lossin@proton.me>,
"Andreas Hindborg" <a.hindborg@kernel.org>,
"Alice Ryhl" <aliceryhl@google.com>,
"Trevor Gross" <tmgross@umich.edu>,
linuxppc-dev@lists.ozlabs.org, linux-modules@vger.kernel.org
Subject: Re: [PATCH v4 14/16] modules: Support extended MODVERSIONS info
Date: Wed, 25 Sep 2024 23:00:00 +0000 [thread overview]
Message-ID: <20240925230000.GA3176650@google.com> (raw)
In-Reply-To: <20240924212024.540574-15-mmaurer@google.com>
Hi Matt,
On Tue, Sep 24, 2024 at 09:19:56PM +0000, Matthew Maurer wrote:
> +static void dedotify_ext_version_names(char *str_seq, unsigned long size)
> +{
> + unsigned long out = 0;
> + unsigned long in;
> + char last = '\0';
> +
> + for (in = 0; in < size; in++) {
> + if (last == '\0')
> + /* Skip one leading dot */
> + if (str_seq[in] == '.')
> + in++;
Thanks for addressing Michael's comment, this looks correct to me.
Nit: might be cleaner in a single if statement though:
/* Skip one leading dot */
if (last == '\0' && str_seq[in] == '.')
in++;
> +void modversion_ext_start(const struct load_info *info,
> + struct modversion_info_ext *start)
> +{
> + unsigned int crc_idx = info->index.vers_ext_crc;
> + unsigned int name_idx = info->index.vers_ext_name;
> + Elf_Shdr *sechdrs = info->sechdrs;
> +
> + /*
> + * Both of these fields are needed for this to be useful
> + * Any future fields should be initialized to NULL if absent.
> + */
> + if ((crc_idx == 0) || (name_idx == 0))
> + start->remaining = 0;
> +
> + start->crc = (const s32 *)sechdrs[crc_idx].sh_addr;
> + start->name = (const char *)sechdrs[name_idx].sh_addr;
> + start->remaining = sechdrs[crc_idx].sh_size / sizeof(*start->crc);
> +}
This looks unchanged from v3, so I think my comment from there
still applies:
https://lore.kernel.org/lkml/CABCJKufJK0WO92wnW09VTLqZk0ODxhuKQG=HbKE-va0urJU1Vg@mail.gmail.com/
Sami
next prev parent reply other threads:[~2024-09-25 23:00 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20240924212024.540574-1-mmaurer@google.com>
2024-09-24 21:19 ` [PATCH v4 01/16] module: Take const arg in validate_section_offset Matthew Maurer
2024-09-25 9:00 ` Daniel Gomez
2024-09-24 21:19 ` [PATCH v4 02/16] module: Factor out elf_validity_ehdr Matthew Maurer
2024-09-24 21:19 ` [PATCH v4 03/16] module: Factor out elf_validity_cache_sechdrs Matthew Maurer
2024-09-24 21:19 ` [PATCH v4 04/16] module: Factor out elf_validity_cache_secstrings Matthew Maurer
2024-09-24 21:19 ` [PATCH v4 05/16] module: Factor out elf_validity_cache_index_info Matthew Maurer
2024-09-24 21:19 ` [PATCH v4 06/16] module: Factor out elf_validity_cache_index_mod Matthew Maurer
2024-09-24 21:19 ` [PATCH v4 07/16] module: Factor out elf_validity_cache_index_sym Matthew Maurer
2024-09-24 21:19 ` [PATCH v4 08/16] module: Factor out elf_validity_cache_index_str Matthew Maurer
2024-09-24 21:19 ` [PATCH v4 09/16] module: Group section index calculations together Matthew Maurer
2024-09-24 21:19 ` [PATCH v4 10/16] module: Factor out elf_validity_cache_strtab Matthew Maurer
2024-09-24 21:19 ` [PATCH v4 11/16] module: Additional validation in elf_validity_cache_strtab Matthew Maurer
2024-09-24 21:19 ` [PATCH v4 12/16] module: Reformat struct for code style Matthew Maurer
2024-09-24 21:19 ` [PATCH v4 14/16] modules: Support extended MODVERSIONS info Matthew Maurer
2024-09-25 23:00 ` Sami Tolvanen [this message]
2024-09-25 23:42 ` Matthew Maurer
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=20240925230000.GA3176650@google.com \
--to=samitolvanen@google.com \
--cc=a.hindborg@kernel.org \
--cc=alex.gaynor@gmail.com \
--cc=aliceryhl@google.com \
--cc=asahi@lists.linux.dev \
--cc=benno.lossin@proton.me \
--cc=bgray@linux.ibm.com \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun.feng@gmail.com \
--cc=christophe.leroy@csgroup.eu \
--cc=da.gomez@samsung.com \
--cc=gary@garyguo.net \
--cc=j@jannau.net \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-modules@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=maddy@linux.ibm.com \
--cc=marcan@marcan.st \
--cc=masahiroy@kernel.org \
--cc=mcgrof@kernel.org \
--cc=mmaurer@google.com \
--cc=mpe@ellerman.id.au \
--cc=naveen@kernel.org \
--cc=ndesaulniers@google.com \
--cc=neal@gompa.dev \
--cc=npiggin@gmail.com \
--cc=ojeda@kernel.org \
--cc=petr.pavlu@suse.com \
--cc=rust-for-linux@vger.kernel.org \
--cc=tmgross@umich.edu \
/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;
as well as URLs for NNTP newsgroup(s).