Skip to content
Snippets Groups Projects
  1. Mar 17, 2014
  2. Mar 11, 2014
  3. Mar 04, 2014
    • Andy Honig's avatar
      kallsyms: fix absolute addresses for kASLR · 0f55159d
      Andy Honig authored
      
      Currently symbols that are absolute addresses are incorrectly displayed
      in /proc/kallsyms if the kernel is loaded with kASLR.
      
      The problem was that the scripts/kallsyms.c file which generates the
      array of symbol names and addresses uses an relocatable value for all
      symbols, even absolute symbols.  This patch fixes that.
      
      Several kallsyms output in different boot states for comparison:
      
        $ egrep '_(stext|_per_cpu_(start|end))' /root/kallsyms.nokaslr
        0000000000000000 D __per_cpu_start
        0000000000014280 D __per_cpu_end
        ffffffff810001c8 T _stext
        $ egrep '_(stext|_per_cpu_(start|end))' /root/kallsyms.kaslr1
        000000001f200000 D __per_cpu_start
        000000001f214280 D __per_cpu_end
        ffffffffa02001c8 T _stext
        $ egrep '_(stext|_per_cpu_(start|end))' /root/kallsyms.kaslr2
        000000000d400000 D __per_cpu_start
        000000000d414280 D __per_cpu_end
        ffffffff8e4001c8 T _stext
        $ egrep '_(stext|_per_cpu_(start|end))' /root/kallsyms.kaslr-fixed
        0000000000000000 D __per_cpu_start
        0000000000014280 D __per_cpu_end
        ffffffffadc001c8 T _stext
      
      Signed-off-by: default avatarAndy Honig <ahonig@google.com>
      Signed-off-by: default avatarKees Cook <keescook@chromium.org>
      Cc: Michal Marek <mmarek@suse.cz>
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      0f55159d
  4. Nov 13, 2013
  5. Nov 08, 2013
  6. Nov 06, 2013
  7. Nov 01, 2013
    • Ming Lei's avatar
      scripts/kallsyms: filter symbols not in kernel address space · f6537f2f
      Ming Lei authored
      
      This patch uses CONFIG_PAGE_OFFSET to filter symbols which
      are not in kernel address space because these symbols are
      generally for generating code purpose and can't be run at
      kernel mode, so we needn't keep them in /proc/kallsyms.
      
      For example, on ARM there are some symbols which may be
      linked in relocatable code section, then perf can't parse
      symbols any more from /proc/kallsyms, this patch fixes the
      problem (introduced b9b32bf7)
      
      Cc: Russell King <linux@arm.linux.org.uk>
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: Michal Marek <mmarek@suse.cz>
      Signed-off-by: default avatarMing Lei <tom.leiming@gmail.com>
      Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
      Cc: stable@vger.kernel.org
      f6537f2f
  8. May 12, 2011
    • Xiaochen Wang's avatar
      scripts/kallsyms.c: fix potential segfault · e0a04b11
      Xiaochen Wang authored
      
      Description:
      This bug hardly appears during real kernel compiling,
       because the vmlinux symbols table is huge.
      
      But we can still catch it under strict condition , as follows.
         $ echo "c101b97b T do_fork" | ./scripts/kallsyms --all-symbols
         #include <asm/types.h>
         ......
         ......
         .globl kallsyms_token_table
                 ALGN
         kallsyms_token_table:
         Segmentation fault (core dumped)
         $
      
      If symbols table is small, all entries in token_profit[0x10000] may
      decrease to 0 after several calls of compress_symbols() in optimize_result().
      In that case, find_best_token() always return 0 and
      best_table[i] is set to "\0\0" and best_table_len[i] is set to 2.
      
      As a result, expand_symbol(best_table[0]="\0\0", best_table_len[0]=2, buf)
      in write_src() will run in infinite recursion until stack overflows,
      causing segfault.
      
      This patch checks the find_best_token() return value. If all entries in
      token_profit[0x10000] become 0 according to return value, it breaks the loop
      in optimize_result().
      And expand_symbol() works well when best_table_len[i] is 0.
      
      Signed-off-by: default avatarXiaochen Wang <wangxiaochen0@gmail.com>
      Acked-by: default avatarPaulo Marques <pmarques@grupopie.com>
      Signed-off-by: default avatarMichal Marek <mmarek@suse.cz>
      e0a04b11
  9. Sep 29, 2010
  10. Feb 02, 2010
  11. Sep 23, 2009
    • Paul Mundt's avatar
      kallsyms: fix segfault in prefix_underscores_count() · a9ece53c
      Paul Mundt authored
      
      Commit b478b782 "kallsyms, tracing: output
      more proper symbol name" introduces a "bugfix" that introduces a segfault
      in kallsyms in my configurations.
      
      The cause is the introduction of prefix_underscores_count() which attempts
      to count underscores, even in symbols that do not have them.  As a result,
      it just uselessly runs past the end of the buffer until it crashes:
      
        CC      init/version.o
        LD      init/built-in.o
        LD      .tmp_vmlinux1
        KSYM    .tmp_kallsyms1.S
      /bin/sh: line 1: 16934 Done                    sh-linux-gnu-nm -n .tmp_vmlinux1
           16935 Segmentation fault      | scripts/kallsyms > .tmp_kallsyms1.S
      make: *** [.tmp_kallsyms1.S] Error 139
      
      This simplifies the logic and just does a straightforward count.
      
      Signed-off-by: default avatarPaul Mundt <lethal@linux-sh.org>
      Reviewed-by: default avatarLi Zefan <lizf@cn.fujitsu.com>
      Cc: Lai Jiangshan <laijs@cn.fujitsu.com>
      Cc: Sam Ravnborg <sam@ravnborg.org>
      Cc: Paulo Marques <pmarques@grupopie.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: <stable@kernel.org>		[2.6.30.x, 2.6.31.x]
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      a9ece53c
  12. Jun 20, 2009
  13. Jun 14, 2009
  14. Mar 14, 2009
    • Lai Jiangshan's avatar
      kallsyms, tracing: output more proper symbol name · b478b782
      Lai Jiangshan authored
      
      Impact: bugfix, output more reliable symbol lookup result
      
      Debug tools(dump_stack(), ftrace...) are like to print out symbols.
      But it is always print out the first aliased symbol.(Aliased symbols
      are symbols with the same address), and the first aliased symbol is
      sometime not proper.
      
       # echo function_graph > current_tracer
       # cat trace
      ......
       1)   1.923 us    |    select_nohz_load_balancer();
       1) + 76.692 us   |  }
       1)               |  default_idle() {
       1)   ==========> |    __irqentry_text_start() {
       1)   0.000 us    |      native_apic_mem_write();
       1)               |      irq_enter() {
       1)   0.000 us    |        idle_cpu();
       1)               |        tick_check_idle() {
       1)   0.000 us    |          tick_check_oneshot_broadcast();
       1)               |          tick_nohz_stop_idle() {
      ......
      
      It's very embarrassing, it ouputs "__irqentry_text_start()",
      actually, it should output "smp_apic_timer_interrupt()".
      (these two symbol are the same address, but "__irqentry_text_start"
      is deemed to the first aliased symbol by scripts/kallsyms)
      
      This patch puts symbols like "__irqentry_text_start" to the second
      aliased symbols. And a more proper symbol name becomes the first.
      
      Aliased symbols mostly come from linker script. The solution is
      guessing "is this symbol defined in linker script", the symbols
      defined in linker script will not become the first aliased symbol.
      
      And if symbols are found to be equal in this "linker script provided"
      criteria, symbols are sorted by the number of prefix underscores.
      
      Signed-off-by: default avatarLai Jiangshan <laijs@cn.fujitsu.com>
      Acked-by: default avatarSam Ravnborg <sam@ravnborg.org>
      Reviewed-by: default avatarPaulo Marques <pmarques@grupopie.com>
      LKML-Reference: <49BA06E2.7080807@cn.fujitsu.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      b478b782
  15. Jan 14, 2009
  16. Dec 19, 2008
    • Jan Beulich's avatar
      allow stripping of generated symbols under CONFIG_KALLSYMS_ALL · 9bb48247
      Jan Beulich authored
      
      Building upon parts of the module stripping patch, this patch
      introduces similar stripping for vmlinux when CONFIG_KALLSYMS_ALL=y.
      Using CONFIG_KALLSYMS_STRIP_GENERATED reduces the overhead of
      CONFIG_KALLSYMS_ALL from 245k/310k to 65k/80k for the (i386/x86-64)
      kernels I tested with.
      
      The patch also does away with the need to special case the kallsyms-
      internal symbols by making them available even in the first linking
      stage.
      
      While it is a generated file, the patch includes the changes to
      scripts/genksyms/keywords.c_shipped, as I'm unsure what the procedure
      here is.
      
      Signed-off-by: default avatarJan Beulich <jbeulich@novell.com>
      Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
      9bb48247
  17. May 19, 2008
    • Sam Ravnborg's avatar
      kbuild: filter away debug symbols from kernel symbols · aab34ac8
      Sam Ravnborg authored
      
      Andi Kleen <andi@firstfloor.org>
      reported that he saw a lot of symbols like this:
      
      0000000000000b24 N DW.aio.h.903a6d92.2
      0000000000000bce N DW.task_io_accounting.h.8d8de327.0
      0000000000000bec N DW.hrtimer.h.c23659c6.0
      
      in his System.map / kallsyms output.
      
      Simple solution is to skip all debugging
      symbols (they are marked 'N').
      
      Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
      Cc: Paulo Marques <pmarques@grupopie.com>
      aab34ac8
  18. Apr 30, 2008
  19. Feb 06, 2008
  20. Jul 17, 2007
  21. Dec 08, 2006
  22. Dec 07, 2006
  23. Mar 25, 2006
  24. Sep 08, 2005
  25. Jul 27, 2005
  26. May 06, 2005
  27. May 01, 2005
  28. Apr 17, 2005
    • Linus Torvalds's avatar
      Linux-2.6.12-rc2 · 1da177e4
      Linus Torvalds authored
      Initial git repository build. I'm not bothering with the full history,
      even though we have it. We can create a separate "historical" git
      archive of that later if we want to, and in the meantime it's about
      3.2GB when imported into git - space that would just make the early
      git days unnecessarily complicated, when we don't have a lot of good
      infrastructure for it.
      
      Let it rip!
      v2.6.12-rc2
      1da177e4
Loading