public inbox for libabigail@sourceware.org
 help / color / mirror / Atom feed
From: Giuliano Procida <gprocida@google.com>
To: Dodji Seketeli <dodji@seketeli.org>
Cc: libabigail@sourceware.org, kernel-team@android.com,
	maennich@google.com,  sidnayyar@google.com, vvvvvv@google.com
Subject: Re: [PATCH] Narrow Linux symbol CRCs to 32 bits
Date: Fri, 28 Oct 2022 17:08:48 +0100	[thread overview]
Message-ID: <CAGvU0HkKvuKSYdDB4YYKVBB4VE8B9azB4Ojx6Q9qYbdHOROKJQ@mail.gmail.com> (raw)
In-Reply-To: <875yg4ugk4.fsf@seketeli.org>

Hi Dodji.

On Fri, 28 Oct 2022 at 16:13, Dodji Seketeli <dodji@seketeli.org> wrote:
>
> Hello Giuliano,
>
> Giuliano Procida <gprocida@google.com> a écrit:
>
> > Self-reply.
> >
> > On Thu, 27 Oct 2022 at 15:09, Giuliano Procida <gprocida@google.com> wrote:
> >>
> >> MODVERSIONS CRCs are 32-bit hashes of strings representing C type
> >> elements or typed symbols. The hash is calculated using a 32-bit CRC,
> >> hence the name. The kernel module loading code (implicitly) truncates
> >> any provided CRC value to 32 bits before comparing it with anything.
> >>
> >> When support was added to libabigail, values up to 64 bits wide were
> >> supported.
> >
> > True so far.
> >
> >> Recently, Linux kernel builds have now started generating
> >> ELF CRC symbols with 64-bit values (where the low 32 bits are the
> >> CRC). Together this has resulted in incorrect CRCs in ABIs.
> >
> > The actual problem is a change to how CRCs are emitted in kernel objects.
> > I think the change 7b4537199a4a8480b8c3ba37a2d44765ce76cd9b was
> > responsible.
> >
> >> This change resolves the problem by narrowing libabigail's concept of
> >> Linux CRC to 32 bits. No tests are affected.
> >
> > The representation change is fine. The problem with bad CRCs is still
> > there.
>
> The changes look good to me.  Do you want me to apply it right now, or
> do you prefer to send a subsequent patch that addresses the new way how
> CRCs are emitted in kernel object?

I'm happy for the change to go in. However, the commit message text
should be updated. I would make it:

--

MODVERSIONS CRCs are 32-bit hashes of strings representing C type
elements or typed symbols. The hashes are calculated using a 32-bit CRC,
hence the name. The kernel module loading code (implicitly) truncates
any provided CRC value to 32 bits before comparing it with anything.

When support was added to libabigail, values up to 64 bits wide were
supported. This change narrows libabigail's concept of Linux CRC to 32
bits. No tests are affected.

--

I'm not sure when we'll get around to updating the symtab reader. It'll
probably not be done by me. As I understand things, there are
something like 3 or 4 different encodings of CRCs depending on the
kernel version and architecture (and that's ignoring endianness issues).

Matthias has even suggested it might be better (more reliable) just reading
CRCs from Modules.symvers instead. However, that would require more
integration into build scripts etc.

> I am fine with either way.
>
> [...]
>
> Cheers,
>
> --
>                 Dodji
>
> --
> To unsubscribe from this group and stop receiving emails from it, send an email to kernel-team+unsubscribe@android.com.
>

  reply	other threads:[~2022-10-28 16:09 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-27 14:09 Giuliano Procida
2022-10-27 15:53 ` Giuliano Procida
2022-10-28 15:13   ` Dodji Seketeli
2022-10-28 16:08     ` Giuliano Procida [this message]
2022-11-17 10:13       ` Dodji Seketeli
2022-11-11 13:21 ` [PATCH v2] " Giuliano Procida
2022-11-11 15:44   ` Giuliano Procida
2022-11-17 10:10   ` Dodji Seketeli

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=CAGvU0HkKvuKSYdDB4YYKVBB4VE8B9azB4Ojx6Q9qYbdHOROKJQ@mail.gmail.com \
    --to=gprocida@google.com \
    --cc=dodji@seketeli.org \
    --cc=kernel-team@android.com \
    --cc=libabigail@sourceware.org \
    --cc=maennich@google.com \
    --cc=sidnayyar@google.com \
    --cc=vvvvvv@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 read-only IMAP folder(s) and NNTP newsgroup(s).