From: "H. Peter Anvin" <hpa@zytor.com>
To: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Cc: arjan@infradead.org, james.hogan@imgtec.com,
rusty@rustcorp.com.au, linux-kernel@vger.kernel.org,
andy.shevchenko@gmail.com
Subject: Re: [PATCH] x86_32: Fix module version table mismatch.
Date: Tue, 23 Apr 2013 15:56:39 -0700 [thread overview]
Message-ID: <517711A7.8090002@zytor.com> (raw)
In-Reply-To: <201304232140.FGF73904.QJOFOVtHFFMSOL@I-love.SAKURA.ne.jp>
On 04/23/2013 05:40 AM, Tetsuo Handa wrote:
> Commit a4b6a77b "module: fix symbol versioning with symbol prefixes" broke
> loading of net/ipv6/ipv6.ko built with CONFIG_MODVERSIONS=y for x86_32.
>
> # modprobe ipv6
> FATAL: Error inserting ipv6 (/lib/modules/3.9.0-rc8-next-20130422/kernel/net/ipv6/ipv6.ko): Invalid argument
> # dmesg
> ipv6: no symbol version for memcmp
> ipv6: Unknown symbol memcmp (err -22)
>
> The reason for breakage is that check_version() in kernel/module.c tries to
> find symname == "memcmp" but versions[i].name == "__builtin_memcmp".
>
> The reason for versions[i].name == "__builtin_memcmp" is that
> memcmp() for x86_32 is defined as
>
> #define memcmp __builtin_memcmp
>
> in arch/x86/include/asm/string_32.h while memcmp() for x86_64 is defined as
>
> int memcmp(const void *cs, const void *ct, size_t count);
>
> in arch/x86/include/asm/string_64.h.
>
> Since __builtin_memcmp is a gcc's built-in function which might emit a call to
> memcmp, __builtin_memcmp should not be used for versions[i].name field.
>
> In order to make sure that versions[i].name == "memcmp", make the definition of
> memcmp() for x86_32 identical with that of x86_64.
>
I'm still confused by all of this. VMLINUX_SYMBOL_STR() ought to be a
noop on x86, so how on Earth could a4b6a77b break anything?
Secondly, although memcmp is a macro, it is #undef'd before the
definition in lib/string.c, which is the one that is exported.
I'm wondering if the real culprit isn't b92021b0, but I'm looking into
it now.
-hpa
next prev parent reply other threads:[~2013-04-23 22:56 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CAHp75VdDwh0wgCWrVDcPps1C2qfdDZra15y9BQvzfWHzSMqbWA@mail.gmail.com>
2013-04-12 15:08 ` memcmp in modules Andy Shevchenko
2013-04-22 14:26 ` Tetsuo Handa
2013-04-23 12:40 ` [PATCH] x86_32: Fix module version table mismatch Tetsuo Handa
2013-04-23 14:14 ` Andy Shevchenko
2013-04-23 15:17 ` H. Peter Anvin
2013-04-23 15:41 ` Andy Shevchenko
2013-04-23 22:07 ` H. Peter Anvin
2013-04-23 22:56 ` H. Peter Anvin [this message]
2013-04-24 0:52 ` H. Peter Anvin
2013-04-24 1:00 ` H. Peter Anvin
2013-04-24 10:13 ` James Hogan
2013-04-24 11:24 ` Andy Shevchenko
2013-04-24 12:28 ` Tetsuo Handa
2013-04-24 13:49 ` Andy Shevchenko
2013-04-24 17:48 ` H. Peter Anvin
2013-04-25 10:42 ` [PATCH v2] modpost: fix unwanted VMLINUX_SYMBOL_STR expansion James Hogan
2013-04-29 2:10 ` Rusty Russell
2013-04-23 23:15 ` memcmp in modules H. Peter Anvin
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=517711A7.8090002@zytor.com \
--to=hpa@zytor.com \
--cc=andy.shevchenko@gmail.com \
--cc=arjan@infradead.org \
--cc=james.hogan@imgtec.com \
--cc=linux-kernel@vger.kernel.org \
--cc=penguin-kernel@I-love.SAKURA.ne.jp \
--cc=rusty@rustcorp.com.au \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.