[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CABCJKufJK0WO92wnW09VTLqZk0ODxhuKQG=HbKE-va0urJU1Vg@mail.gmail.com>
Date: Thu, 15 Aug 2024 20:33:15 +0000
From: Sami Tolvanen <samitolvanen@...gle.com>
To: Matthew Maurer <mmaurer@...gle.com>
Cc: masahiroy@...nel.org, ndesaulniers@...gle.com, ojeda@...nel.org,
gary@...yguo.net, mcgrof@...nel.org, Michael Ellerman <mpe@...erman.id.au>,
Alex Gaynor <alex.gaynor@...il.com>, Wedson Almeida Filho <wedsonaf@...il.com>,
Christophe Leroy <christophe.leroy@...roup.eu>, Naveen N Rao <naveen@...nel.org>,
rust-for-linux@...r.kernel.org, linux-kbuild@...r.kernel.org,
linux-kernel@...r.kernel.org, neal@...pa.dev, marcan@...can.st, j@...nau.net,
asahi@...ts.linux.dev, Nicholas Piggin <npiggin@...il.com>,
Boqun Feng <boqun.feng@...il.com>, Björn Roy Baron <bjorn3_gh@...tonmail.com>,
Benno Lossin <benno.lossin@...ton.me>, Andreas Hindborg <a.hindborg@...sung.com>,
Alice Ryhl <aliceryhl@...gle.com>, linuxppc-dev@...ts.ozlabs.org,
linux-modules@...r.kernel.org
Subject: Re: [PATCH v3 14/16] modules: Support extended MODVERSIONS info
Hi Matt,
On Tue, Aug 6, 2024 at 9:25 PM Matthew Maurer <mmaurer@...gle.com> wrote:
>
[...]
> +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))
nit: The extra parentheses are not necessary.
> + 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);
> +}
Is this missing an else condition or a return? Why set
start->remaining to zero and then proceed to assign a possibly invalid
value to it anyway?
Sami
Powered by blists - more mailing lists