From: Rusty Russell <rusty@rustcorp.com.au>
To: linux-kernel@vger.kernel.org
Cc: Jon Masters <jonathan@jonmasters.org>,
Linus Torvalds <torvalds@linux-foundation.org>
Subject: [PATCH 2/3] module: be more picky about allowing missing module versions
Date: Fri, 9 May 2008 16:24:21 +1000 [thread overview]
Message-ID: <200805091624.21659.rusty@rustcorp.com.au> (raw)
In-Reply-To: <200805091623.18127.rusty@rustcorp.com.au>
We allow missing __versions sections, because modprobe --force strips
it. It makes less sense to allow sections where there's no version
for a specific symbol the module uses, so disallow that.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
---
kernel/module.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff -r cf690cb1ffad kernel/module.c
--- a/kernel/module.c Thu May 08 21:51:23 2008 +1000
+++ b/kernel/module.c Thu May 08 21:51:48 2008 +1000
@@ -917,6 +917,10 @@ static int check_version(Elf_Shdr *sechd
if (!crc)
return 1;
+ /* No versions at all? modprobe --force does this. */
+ if (versindex == 0)
+ return try_to_force_load(mod, symname) == 0;
+
versions = (void *) sechdrs[versindex].sh_addr;
num_versions = sechdrs[versindex].sh_size
/ sizeof(struct modversion_info);
@@ -932,8 +936,9 @@ static int check_version(Elf_Shdr *sechd
goto bad_version;
}
- if (!try_to_force_load(mod, symname))
- return 1;
+ printk(KERN_WARNING "%s: no symbol version for %s\n",
+ mod->name, symname);
+ return 0;
bad_version:
printk("%s: disagrees about version of symbol %s\n",
next prev parent reply other threads:[~2008-05-09 6:24 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-09 6:23 [PATCH 1/3] module: put modversions in vermagic Rusty Russell
2008-05-09 6:24 ` Rusty Russell [this message]
2008-05-09 6:25 ` [PATCH 3/3] module: don't ignore vermagic string if module doesn't have modversions Rusty Russell
2008-05-09 14:44 ` Linus Torvalds
2008-05-11 0:57 ` Rusty Russell
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=200805091624.21659.rusty@rustcorp.com.au \
--to=rusty@rustcorp.com.au \
--cc=jonathan@jonmasters.org \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@linux-foundation.org \
/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.