rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Gary Guo <gary@garyguo.net>
To: Lucas De Marchi <lucas.demarchi@intel.com>
Cc: "Michael Ellerman" <mpe@ellerman.id.au>,
	"Nicholas Piggin" <npiggin@gmail.com>,
	"Christophe Leroy" <christophe.leroy@csgroup.eu>,
	"Luis Chamberlain" <mcgrof@kernel.org>,
	"Masahiro Yamada" <masahiroy@kernel.org>,
	"Nathan Chancellor" <nathan@kernel.org>,
	"Nick Desaulniers" <ndesaulniers@google.com>,
	"Nicolas Schier" <nicolas@fjasle.eu>,
	"Miguel Ojeda" <ojeda@kernel.org>,
	"Alex Gaynor" <alex.gaynor@gmail.com>,
	"Wedson Almeida Filho" <wedsonaf@gmail.com>,
	"Boqun Feng" <boqun.feng@gmail.com>,
	" Björn Roy Baron" <bjorn3_gh@protonmail.com>,
	"Kees Cook" <keescook@chromium.org>,
	"Joel Stanley" <joel@jms.id.au>,
	"Julia Lawall" <Julia.Lawall@inria.fr>,
	"Guo Zhengkui" <guozhengkui@vivo.com>,
	"Wedson Almeida Filho" <wedsonaf@google.com>,
	linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org,
	linux-modules@vger.kernel.org, linux-kbuild@vger.kernel.org,
	rust-for-linux@vger.kernel.org
Subject: Re: [PATCH] modpost: support arbitrary symbol length in modversion
Date: Fri, 13 Jan 2023 18:18:41 +0000	[thread overview]
Message-ID: <20230113181841.4d378a24.gary@garyguo.net> (raw)
In-Reply-To: <20230112214059.o4vq474c47edjup6@ldmartin-desk2>

On Thu, 12 Jan 2023 14:40:59 -0700
Lucas De Marchi <lucas.demarchi@intel.com> wrote:

> On Wed, Jan 11, 2023 at 04:11:51PM +0000, Gary Guo wrote:
> >
> > struct modversion_info {
> >-	unsigned long crc;
> >-	char name[MODULE_NAME_LEN];
> >+	/* Offset of the next modversion entry in relation to this one. */
> >+	u32 next;
> >+	u32 crc;
> >+	char name[0];  
> 
> although not really exported as uapi, this will break userspace as this is
> used in the  elf file generated for the modules. I think
> this change must be made in a backward compatible way and kmod updated
> to deal with the variable name length:
> 
> kmod $ git grep "\[64"
> libkmod/libkmod-elf.c:  char name[64 - sizeof(uint32_t)];
> libkmod/libkmod-elf.c:  char name[64 - sizeof(uint64_t)];
> 
> in kmod we have both 32 and 64 because a 64-bit kmod can read both 32
> and 64 bit module, and vice versa.
> 

Hi Lucas,

Thanks for the information.

The change can't be "truly" backward compatible, in a sense that
regardless of the new format we choose, kmod would not be able to decode
symbols longer than "64 - sizeof(long)" bytes. So the list it retrieves
is going to be incomplete, isn't it?

What kind of backward compatibility should be expected? It could be:
* short symbols can still be found by old versions of kmod, but not
  long symbols;
* or, no symbols are found by old versions of kmod, but it does not
  fail;
* or, old versions of kmod would fail gracefully for not able to
  recognise the format of __versions section, but it didn't do anything
  crazy (e.g. decode it as old format).

Also, do you think the current modversion format should stick forever
or would we be able to migrate away from it eventually and fail old
versions of modprobe given enough time?

Best,
Gary

  reply	other threads:[~2023-01-13 18:25 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-11 16:11 [PATCH] modpost: support arbitrary symbol length in modversion Gary Guo
2023-01-12 21:40 ` Lucas De Marchi
2023-01-13 18:18   ` Gary Guo [this message]
2023-01-17 17:51     ` Michal Suchánek
2023-01-17 19:22       ` Lucas De Marchi
2023-01-18  7:01         ` Masahiro Yamada
2023-01-19 19:02           ` Lucas De Marchi
2023-01-19 19:19           ` Miguel Ojeda
2023-01-19 15:09         ` Gary Guo
2023-01-19 15:18           ` Michal Suchánek
2023-01-19 15:57             ` Gary Guo
2023-03-13 20:32 ` Andrea Righi
2023-03-13 21:48   ` Michal Suchánek
2023-03-13 21:53     ` Andrea Righi
2023-03-13 22:02       ` Michal Suchánek
2023-03-13 22:09         ` Andrea Righi
2023-03-14 14:38           ` Andrea Righi
2023-03-14 14:59             ` Andrea Righi
2023-03-15  0:15               ` Vincenzo Palazzo
2023-03-15  6:07                 ` Andrea Righi
2023-03-15 16:18             ` Masahiro Yamada
2023-03-15 21:00               ` Andrea Righi

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=20230113181841.4d378a24.gary@garyguo.net \
    --to=gary@garyguo.net \
    --cc=Julia.Lawall@inria.fr \
    --cc=alex.gaynor@gmail.com \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun.feng@gmail.com \
    --cc=christophe.leroy@csgroup.eu \
    --cc=guozhengkui@vivo.com \
    --cc=joel@jms.id.au \
    --cc=keescook@chromium.org \
    --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=lucas.demarchi@intel.com \
    --cc=masahiroy@kernel.org \
    --cc=mcgrof@kernel.org \
    --cc=mpe@ellerman.id.au \
    --cc=nathan@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=nicolas@fjasle.eu \
    --cc=npiggin@gmail.com \
    --cc=ojeda@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=wedsonaf@gmail.com \
    --cc=wedsonaf@google.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;
as well as URLs for NNTP newsgroup(s).