linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nicholas Piggin <npiggin@gmail.com>
To: Ard Biesheuvel <ard.biesheuvel@linaro.org>,
	Arnd Bergmann <arnd@arndb.de>,
	Greg KH <gregkh@linuxfoundation.org>,
	Michal Marek <michal.lkml@markovi.net>,
	Nick Desaulniers <ndesaulniers@google.com>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Will Deacon <will@kernel.org>,
	Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: Re: a bug in genksysms/CONFIG_MODVERSIONS w/ __attribute__((foo))?
Date: Tue, 27 Aug 2019 19:58:37 +1000	[thread overview]
Message-ID: <1566899033.o5acyopsar.astroid@bobo.none> (raw)
In-Reply-To: <CAKwvOdkbY_XatVfRbZQ88p=nnrahZbvdjJ0OkU9m73G89_LRzg@mail.gmail.com>

Nick Desaulniers's on August 27, 2019 8:57 am:
> On Mon, Aug 26, 2019 at 2:22 PM Nick Desaulniers
> <ndesaulniers@google.com> wrote:
>>
>> I'm looking into a linkage failure for one of our device kernels, and
>> it seems that genksyms isn't producing a hash value correctly for
>> aggregate definitions that contain __attribute__s like
>> __attribute__((packed)).
>>
>> Example:
>> $ echo 'struct foo { int bar; };' | ./scripts/genksyms/genksyms -d
>> Defn for struct foo == <struct foo { int bar ; } >
>> Hash table occupancy 1/4096 = 0.000244141
>> $ echo 'struct __attribute__((packed)) foo { int bar; };' |
>> ./scripts/genksyms/genksyms -d
>> Hash table occupancy 0/4096 = 0
>>
>> I assume the __attribute__ part isn't being parsed correctly (looks
>> like genksyms is a lex/yacc based C parser).
>>
>> The issue we have in our out of tree driver (*sadface*) is basically a
>> EXPORT_SYMBOL'd function whose signature contains a packed struct.
>>
>> Theoretically, there should be nothing wrong with exporting a function
>> that requires packed structs, and this is just a bug in the lex/yacc
>> based parser, right?  I assume that not having CONFIG_MODVERSIONS
>> coverage of packed structs in particular could lead to potentially
>> not-fun bugs?  Or is using packed structs in exported function symbols
>> with CONFIG_MODVERSIONS forbidden in some documentation somewhere I
>> missed?
> 
> Ah, looks like I'm late to the party:
> https://lwn.net/Articles/707520/

Yeah, would be nice to do something about this.

IIRC (without re-reading it all), in theory distros would be okay
without modversions if they could just provide their own explicit
versioning. They take care about ABIs, so they can version things
carefully if they had to change.

I think we left that on hold because some of the bigger distros were
heading into releases and we didn't care to cause pain. I wonder if
we could try again.

What's your requirement for versioning?

Thanks,
Nick

  reply	other threads:[~2019-08-27  9:59 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-26 21:22 a bug in genksysms/CONFIG_MODVERSIONS w/ __attribute__((foo))? Nick Desaulniers
2019-08-26 22:57 ` Nick Desaulniers
2019-08-27  9:58   ` Nicholas Piggin [this message]
2019-08-27 10:49     ` Masahiro Yamada
2019-08-27 12:42       ` Nicholas Piggin
2019-08-27 15:34         ` Ben Hutchings
2019-08-27 17:09           ` Greg KH
2019-08-27 21:11             ` Ben Hutchings
2019-08-28  2:25           ` Nicholas Piggin
2019-08-28 17:17             ` Nick Desaulniers
2019-08-28 21:42               ` Matthias Maennich
     [not found] <CAOGTHR7wWaS+CdA9aR-8wWXa-AC47WBuLe5BEg01pFoKwKBpAw@mail.gmail.com>
2020-07-27 18:03 ` Nick Desaulniers

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=1566899033.o5acyopsar.astroid@bobo.none \
    --to=npiggin@gmail.com \
    --cc=ard.biesheuvel@linaro.org \
    --cc=arnd@arndb.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michal.lkml@markovi.net \
    --cc=ndesaulniers@google.com \
    --cc=torvalds@linux-foundation.org \
    --cc=will@kernel.org \
    --cc=yamada.masahiro@socionext.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).