+ module-fix-crash-in-get_ksymbol-when-oopsing-in-module-init.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     module: fix crash in get_ksymbol() when oopsing in module init
has been added to the -mm tree.  Its filename is
     module-fix-crash-in-get_ksymbol-when-oopsing-in-module-init.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

------------------------------------------------------
Subject: module: fix crash in get_ksymbol() when oopsing in module init
From: Rusty Russell <rusty@xxxxxxxxxxxxxxx>

Andrew had the sole pleasure of tickling this bug in linux-next; when we
set up "info->strtab" it's pointing into the temporary copy of the module.
 For most uses that is fine, but kallsyms keeps a pointer around during
module load (inside mod->strtab).

If we oops for some reason inside a module's init function, kallsyms will
use the mod->strtab pointer into the now-freed temporary module copy.

(Later oopses work fine: after init we overwrite mod->strtab to point to a
compacted core-only strtab).

Reported-by: Andrew "Grumpy" Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
Signed-off-by: Rusty "Buggy" Russell <rusty@xxxxxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 kernel/module.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff -puN kernel/module.c~module-fix-crash-in-get_ksymbol-when-oopsing-in-module-init kernel/module.c
--- a/kernel/module.c~module-fix-crash-in-get_ksymbol-when-oopsing-in-module-init
+++ a/kernel/module.c
@@ -2003,7 +2003,8 @@ static void add_kallsyms(struct module *
 
 	mod->symtab = (void *)symsec->sh_addr;
 	mod->num_symtab = symsec->sh_size / sizeof(Elf_Sym);
-	mod->strtab = info->strtab;
+	/* Make sure we get permanent strtab: don't use info->strtab. */
+	mod->strtab = (void *)info->sechdrs[info->index.str].sh_addr;
 
 	/* Set types up while we still have access to sections. */
 	for (i = 0; i < mod->num_symtab; i++)
_

Patches currently in -mm which might be from rusty@xxxxxxxxxxxxxxx are

linux-next.patch
module-fix-crash-in-get_ksymbol-when-oopsing-in-module-init.patch
revert-ed5aa19b93da2c094b6647762774a8022e4e1d6c.patch
revert-9652e31db6d841e291531547b3f4f12b5aeb42a9.patch
revert-fdc8302019d9bc10729cd3e8d348571e833388aa.patch
revert-324d76561842e551051e2a897b958b0539f6867b.patch
revert-e92e80797e7eaaf2a9bbd586c63f7c6bd3177276.patch
revert-d04ab5241f301bdcad2f6beb0ecd326bd82100a7.patch
revert-3ab7269a6058c136795ce9417f7051a0edde60db.patch
revert-4624469822455b4accc886557f6c997ccdd59066.patch
modpost-support-objects-with-more-than-64k-sections.patch
kmap_atomic-make-kunmap_atomic-harder-to-misuse.patch
include-linux-compiler-gcch-use-__same_type-in-__must_be_array.patch
init-mainc-fix-warning-calltimetv64-may-be-used-uninitialized.patch
init-mainc-mark-do_one_initcall-as-__init_or_module.patch
reiser4.patch

--
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux