<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/scripts/kallsyms.c, branch v3.13</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v3.13</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v3.13'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2013-11-15T22:06:38Z</updated>
<entry>
<title>Merge branch 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild</title>
<updated>2013-11-15T22:06:38Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2013-11-15T22:06:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=762fb1ddd561aac5b14afac19287672b99242811'/>
<id>urn:sha1:762fb1ddd561aac5b14afac19287672b99242811</id>
<content type='text'>
Pull kbuild changes from Michal Marek:
 - LTO fixes, but the kallsyms part had to be reverted
 - Pass -Werror=implicit-int and -Werror=strict-prototypes to the
   compiler by default
 - snprintf fix in modpost
 - remove GREP_OPTIONS from the environment to be immune against exotic
   grep option settings

* 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
  kallsyms: Revert back to 128 max symbol length
  Kbuild: Ignore GREP_OPTIONS env variable
  scripts: kallsyms: Use %zu to print 'size_t'
  scripts/bloat-o-meter: use .startswith rather than fragile slicing
  scripts/bloat-o-meter: ignore changes in the size of linux_banner
  kbuild: replace unbounded sprintf call in modpost
  kbuild, bloat-o-meter: fix static detection
  Kbuild: Handle longer symbols in kallsyms.c
  kbuild: Increase kallsyms max symbol length
  Makefile: enable -Werror=implicit-int and -Werror=strict-prototypes by default
</content>
</entry>
<entry>
<title>kallsyms: Revert back to 128 max symbol length</title>
<updated>2013-11-13T14:58:19Z</updated>
<author>
<name>Michal Marek</name>
<email>mmarek@suse.cz</email>
</author>
<published>2013-11-11T13:23:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=480f439c3db0d45d817d66caf3fa8e81a6fac01a'/>
<id>urn:sha1:480f439c3db0d45d817d66caf3fa8e81a6fac01a</id>
<content type='text'>
This reverts commits
f3462aa (Kbuild: Handle longer symbols in kallsyms.c) and
eea0e9c (kbuild: Increase kallsyms max symbol length)
except for the added overflow check. The reason is a regression caused
by increasing the buffer:
http://marc.info/?l=linux-kernel&amp;m=138387700415675.

Reported-by: Fengguang Wu &lt;fengguang.wu@intel.com&gt;
Cc: Andi Kleen &lt;ak@linux.intel.com&gt;
Cc: Joe Mario &lt;jmario@redhat.com&gt;
Signed-off-by: Michal Marek &lt;mmarek@suse.cz&gt;
</content>
</entry>
<entry>
<title>scripts: kallsyms: Use %zu to print 'size_t'</title>
<updated>2013-11-08T09:05:20Z</updated>
<author>
<name>Fabio Estevam</name>
<email>fabio.estevam@freescale.com</email>
</author>
<published>2013-11-08T02:45:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=6f62259b1a7696a335d5c3f2c89cce1d28912bf2'/>
<id>urn:sha1:6f62259b1a7696a335d5c3f2c89cce1d28912bf2</id>
<content type='text'>
Commit f3462aa95 (Kbuild: Handle longer symbols in kallsyms.c) introduced the
following warning on ARM:

scripts/kallsyms.c:121:4: warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'size_t' [-Wformat]

Use %zu to print 'size_t'.

Signed-off-by: Fabio Estevam &lt;fabio.estevam@freescale.com&gt;
Signed-off-by: Michal Marek &lt;mmarek@suse.cz&gt;
</content>
</entry>
<entry>
<title>Kbuild: Handle longer symbols in kallsyms.c</title>
<updated>2013-11-06T21:25:49Z</updated>
<author>
<name>Andi Kleen</name>
<email>andi@firstfloor.org</email>
</author>
<published>2013-10-23T13:07:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f3462aa952cfc8f4b095103cb9b3d306dd216558'/>
<id>urn:sha1:f3462aa952cfc8f4b095103cb9b3d306dd216558</id>
<content type='text'>
Also warn for too long symbols

v2: Add missing newline. Use 255 max (Joe Perches)
Signed-off-by: Andi Kleen &lt;ak@linux.intel.com&gt;
Signed-off-by: Michal Marek &lt;mmarek@suse.cz&gt;
</content>
</entry>
<entry>
<title>scripts/kallsyms: filter symbols not in kernel address space</title>
<updated>2013-11-01T22:43:02Z</updated>
<author>
<name>Ming Lei</name>
<email>tom.leiming@gmail.com</email>
</author>
<published>2013-11-01T22:41:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f6537f2f0eba4eba3354e48dbe3047db6d8b6254'/>
<id>urn:sha1:f6537f2f0eba4eba3354e48dbe3047db6d8b6254</id>
<content type='text'>
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 b9b32bf70f2fb710b07c94e13afbc729afe221da)

Cc: Russell King &lt;linux@arm.linux.org.uk&gt;
Cc: linux-arm-kernel@lists.infradead.org
Cc: Michal Marek &lt;mmarek@suse.cz&gt;
Signed-off-by: Ming Lei &lt;tom.leiming@gmail.com&gt;
Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
Cc: stable@vger.kernel.org
</content>
</entry>
<entry>
<title>scripts/kallsyms.c: fix potential segfault</title>
<updated>2011-05-12T15:23:40Z</updated>
<author>
<name>Xiaochen Wang</name>
<email>wangxiaochen0@gmail.com</email>
</author>
<published>2011-05-01T03:41:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e0a04b11e4059cab033469617c2a3ce2d8cab416'/>
<id>urn:sha1:e0a04b11e4059cab033469617c2a3ce2d8cab416</id>
<content type='text'>
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 &lt;asm/types.h&gt;
   ......
   ......
   .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: Xiaochen Wang &lt;wangxiaochen0@gmail.com&gt;
Acked-by: Paulo Marques &lt;pmarques@grupopie.com&gt;
Signed-off-by: Michal Marek &lt;mmarek@suse.cz&gt;
</content>
</entry>
<entry>
<title>scripts/kallsyms: Enable error messages while hush up unnecessary warnings</title>
<updated>2010-09-29T14:18:27Z</updated>
<author>
<name>Jean Sacren</name>
<email>sakiwit@gmail.com</email>
</author>
<published>2010-09-11T05:13:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ef894870c6c38580e540c29cfb22a827d54a950a'/>
<id>urn:sha1:ef894870c6c38580e540c29cfb22a827d54a950a</id>
<content type='text'>
As no error was handled, we wouldn't be able to know when an error does
occur. The fix preserves error messages while it doesn't let unnecessary
compiling warnings show up.

Signed-off-by: Jean Sacren &lt;sakiwit@gmail.com&gt;
Signed-off-by: Michal Marek &lt;mmarek@suse.cz&gt;
</content>
</entry>
<entry>
<title>scripts/kallsyms: suppress build warning</title>
<updated>2010-02-02T13:33:56Z</updated>
<author>
<name>Himanshu Chauhan</name>
<email>hschauhan@nulltrace.org</email>
</author>
<published>2010-01-28T00:53:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=71d41aed9468a1239cff1b2d928954885b09de6c'/>
<id>urn:sha1:71d41aed9468a1239cff1b2d928954885b09de6c</id>
<content type='text'>
Suppress a warn_unused_result warning.

fgets is called as a part of error handling.  It is called just to drop a
line and return immediately.  read_map is reading the file in a loop and
read_symbol reads line by line.  So I think there is no point in using
return value for useful checking.  Other checks like 3 items were returned
or !EOF have already been done.

Signed-off-by: Himanshu Chauhan &lt;hschauhan@nulltrace.org&gt;
Cc: WANG Cong &lt;xiyou.wangcong@gmail.com&gt;
Cc: Michal Marek &lt;mmarek@suse.cz&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Michal Marek &lt;mmarek@suse.cz&gt;
</content>
</entry>
<entry>
<title>kallsyms: fix segfault in prefix_underscores_count()</title>
<updated>2009-09-23T14:39:30Z</updated>
<author>
<name>Paul Mundt</name>
<email>lethal@linux-sh.org</email>
</author>
<published>2009-09-22T23:44:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a9ece53c4089ef23d4002d34c4c7148d94622a40'/>
<id>urn:sha1:a9ece53c4089ef23d4002d34c4c7148d94622a40</id>
<content type='text'>
Commit b478b782e110fdb4135caa3062b6d687e989d994 "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 &gt; .tmp_kallsyms1.S
make: *** [.tmp_kallsyms1.S] Error 139

This simplifies the logic and just does a straightforward count.

Signed-off-by: Paul Mundt &lt;lethal@linux-sh.org&gt;
Reviewed-by: Li Zefan &lt;lizf@cn.fujitsu.com&gt;
Cc: Lai Jiangshan &lt;laijs@cn.fujitsu.com&gt;
Cc: Sam Ravnborg &lt;sam@ravnborg.org&gt;
Cc: Paulo Marques &lt;pmarques@grupopie.com&gt;
Cc: Ingo Molnar &lt;mingo@elte.hu&gt;
Cc: &lt;stable@kernel.org&gt;		[2.6.30.x, 2.6.31.x]
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>kallsyms: fix inverted valid symbol checking</title>
<updated>2009-06-20T11:33:23Z</updated>
<author>
<name>Mike Frysinger</name>
<email>vapier@gentoo.org</email>
</author>
<published>2009-06-15T11:52:48Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ac6ca5c86c63dd95acc6a34dff8d33c23b703a37'/>
<id>urn:sha1:ac6ca5c86c63dd95acc6a34dff8d33c23b703a37</id>
<content type='text'>
The previous commit (17b1f0de) introduced a slightly broken consolidation
of the memory text range checking.

Signed-off-by: Mike Frysinger &lt;vapier@gentoo.org&gt;
Signed-off-by: Sam Ravnborg &lt;sam@ravnborg.org&gt;
</content>
</entry>
</feed>
