1. 24 5月, 2017 1 次提交
    • K
      module: Add module name to modinfo · 3e2e857f
      Kees Cook 提交于
      Accessing the mod structure (e.g. for mod->name) prior to having completed
      check_modstruct_version() can result in writing garbage to the error logs
      if the layout of the mod structure loaded from disk doesn't match the
      running kernel's mod structure layout. This kind of mismatch will become
      much more likely if a kernel is built with different randomization seed
      for the struct layout randomization plugin.
      
      Instead, add and use a new modinfo string for logging the module name.
      Signed-off-by: NKees Cook <keescook@chromium.org>
      Signed-off-by: NJessica Yu <jeyu@redhat.com>
      3e2e857f
  2. 02 3月, 2017 1 次提交
  3. 04 2月, 2017 1 次提交
    • A
      kbuild: modversions: add infrastructure for emitting relative CRCs · 56067812
      Ard Biesheuvel 提交于
      This add the kbuild infrastructure that will allow architectures to emit
      vmlinux symbol CRCs as 32-bit offsets to another location in the kernel
      where the actual value is stored. This works around problems with CRCs
      being mistaken for relocatable symbols on kernels that self relocate at
      runtime (i.e., powerpc with CONFIG_RELOCATABLE=y)
      
      For the kbuild side of things, this comes down to the following:
      
       - introducing a Kconfig symbol MODULE_REL_CRCS
      
       - adding a -R switch to genksyms to instruct it to emit the CRC symbols
         as references into the .rodata section
      
       - making modpost distinguish such references from absolute CRC symbols
         by the section index (SHN_ABS)
      
       - making kallsyms disregard non-absolute symbols with a __crc_ prefix
      Signed-off-by: NArd Biesheuvel <ard.biesheuvel@linaro.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      56067812
  4. 29 11月, 2016 1 次提交
    • N
      kbuild: modpost warn if export version crc is missing · d8c1eb86
      Nicholas Piggin 提交于
      This catches the failing ceph CRC on with:
      
          LD      vmlinux.o
          MODPOST vmlinux.o
        WARNING: EXPORT symbol "ceph_monc_do_statfs" [vmlinux] version
        generation failed, symbol will not be versioned.
      
      When the modules referring to exported symbols are built, there is an
      existing warning for missing CRC, but it's not always the case such
      any such module will be built, and in any case it is useful to get a
      warning at the source.
      
      This gets a little verbose with CONFIG_DEBUG_SECTION_MISMATCH,
      producing a warning with each object linked, but I didn't think
      that warranted extra complexity to avoid.
      Signed-off-by: NNicholas Piggin <npiggin@gmail.com>
      Signed-off-by: NMichal Marek <mmarek@suse.com>
      d8c1eb86
  5. 27 11月, 2016 1 次提交
  6. 08 10月, 2016 1 次提交
  7. 21 1月, 2016 1 次提交
    • A
      powerpc: Simplify module TOC handling · c153693d
      Alan Modra 提交于
      PowerPC64 uses the symbol .TOC. much as other targets use
      _GLOBAL_OFFSET_TABLE_. It identifies the value of the GOT pointer (or in
      powerpc parlance, the TOC pointer). Global offset tables are generally
      local to an executable or shared library, or in the kernel, module. Thus
      it does not make sense for a module to resolve a relocation against
      .TOC. to the kernel's .TOC. value. A module has its own .TOC., and
      indeed the powerpc64 module relocation processing ignores the kernel
      value of .TOC. and instead calculates a module-local value.
      
      This patch removes code involved in exporting the kernel .TOC., tweaks
      modpost to ignore an undefined .TOC., and the module loader to twiddle
      the section symbol so that .TOC. isn't seen as undefined.
      
      Note that if the kernel was compiled with -msingle-pic-base then ELFv2
      would not have function global entry code setting up r2. In that case
      the module call stubs would need to be modified to set up r2 using the
      kernel .TOC. value, requiring some of this code to be reinstated.
      
      mpe: Furthermore a change in binutils master (not yet released) causes
      the current way we handle the TOC to no longer work when building with
      MODVERSIONS=y and RELOCATABLE=n. The symptom is that modules can not be
      loaded due to there being no version found for TOC.
      
      Cc: stable@vger.kernel.org # 3.16+
      Signed-off-by: NAlan Modra <amodra@gmail.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      c153693d
  8. 26 10月, 2015 1 次提交
  9. 06 10月, 2015 1 次提交
  10. 08 8月, 2015 1 次提交
    • T
      modpost: abort if a module symbol is too long · 5cfb203a
      Takashi Iwai 提交于
      Module symbols have a limited length, but currently the build system
      allows the build finishing even if the driver code contains a too long
      symbol name, which eventually overflows the modversion_info[] item.
      The compiler may catch at compiling *.mod.c like
        CC      xxx.mod.o
        xxx.mod.c:18:16: warning: initializer-string for array of chars is too long
      but it's merely a warning.
      
      This patch adds the check of the symbol length in modpost and stops
      the build properly.
      
      Currently MODULE_NAME_LEN is defined in modpost.c instead of referring
      to the definition in kernel header because including linux/module.h is
      messy and we must cover cross-compilation.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      5cfb203a
  11. 09 7月, 2015 1 次提交
    • C
      modpost: work correctly with tile coldtext sections · 673c2c34
      Chris Metcalf 提交于
      The tilegx and tilepro compilers use .coldtext for their unlikely
      executed text section name, so an __attribute__((cold)) function
      will (when compiled with higher optimization levels) land in
      the .coldtext section.
      
      Modify modpost to add .coldtext to the set of OTHER_TEXT_SECTIONS
      so we don't get warnings about referencing such a section in an
      __ex_table block, and then also modify arch/tile/lib/memcpy_user_64.c
      so that it uses plain ".coldtext" instead of ".coldtext.memcpy".
      The latter naming is a relic of an earlier use of -ffunction-sections,
      which we no longer use by default.
      Signed-off-by: NChris Metcalf <cmetcalf@ezchip.com>
      Acked-by: NRusty Russell <rusty@rustcorp.com.au>
      673c2c34
  12. 22 4月, 2015 7 次提交
  13. 13 4月, 2015 7 次提交
  14. 03 10月, 2014 1 次提交
    • K
      aarch64: filter $x from kallsyms · 6c34f1f5
      Kyle McMartin 提交于
      Similar to ARM, AArch64 is generating $x and $d syms... which isn't
      terribly helpful when looking at %pF output and the like. Filter those
      out in kallsyms, modpost and when looking at module symbols.
      
      Seems simplest since none of these check EM_ARM anyway, to just add it
      to the strchr used, rather than trying to make things overly
      complicated.
      
      initcall_debug improves:
      dmesg_before.txt: initcall $x+0x0/0x154 [sg] returned 0 after 26331 usecs
      dmesg_after.txt: initcall init_sg+0x0/0x154 [sg] returned 0 after 15461 usecs
      Signed-off-by: NKyle McMartin <kyle@redhat.com>
      Acked-by: NRusty Russell <rusty@rustcorp.com.au>
      Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      6c34f1f5
  15. 27 8月, 2014 2 次提交
  16. 27 7月, 2014 2 次提交
  17. 10 6月, 2014 1 次提交
  18. 05 5月, 2014 1 次提交
  19. 28 4月, 2014 1 次提交
  20. 19 2月, 2014 1 次提交
  21. 14 2月, 2014 3 次提交
  22. 15 1月, 2014 1 次提交
  23. 13 11月, 2013 1 次提交
  24. 07 11月, 2013 1 次提交