public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
To: elfutils-devel@lists.fedorahosted.org
Subject: Re: out-of-bounds read / crash in elfutils tools (readelf, nm, ...) with malformed file
Date: Sun, 09 Nov 2014 22:59:46 +0100	[thread overview]
Message-ID: <20141109225946.43440e09@pc> (raw)
In-Reply-To: 1415552277.19702.38.camel@bordewijk.wildebeest.org

[-- Attachment #1: Type: text/plain, Size: 3762 bytes --]

Am Sun, 09 Nov 2014 17:57:57 +0100
schrieb Mark Wielaard <mjw@redhat.com>:

> > , however here are three more in
> > nm. Seems they only crash on 32 bit.
> 
> I cannot get these to crash on either a fedora 20 x86_64 setup, nor
> on a fedora 21-beta i686 setup. Could you run under gdb and provide a
> backtrace?

Backtrace 1, id:000010,src:000000,op:flip1,pos:5556:
Program received signal SIGSEGV, Segmentation fault.
0x0804be85 in sort_by_name (p1=0xffffc310, p2=0xffffc330) at nm.c:1146
1146	  const char *n1 = sort_by_name_strtab->d_buf + s1->sym.st_name;
(gdb) bt
#0  0x0804be85 in sort_by_name (p1=0xffffc310, p2=0xffffc330) at nm.c:1146
#1  0xf7cce30d in msort_with_tmp.part () from /lib32/libc.so.6
#2  0xf7cce217 in msort_with_tmp.part () from /lib32/libc.so.6
#3  0xf7cce200 in msort_with_tmp.part () from /lib32/libc.so.6
#4  0xf7cce200 in msort_with_tmp.part () from /lib32/libc.so.6
#5  0xf7cce200 in msort_with_tmp.part () from /lib32/libc.so.6
#6  0xf7cce200 in msort_with_tmp.part () from /lib32/libc.so.6
#7  0xf7cce787 in qsort_r () from /lib32/libc.so.6
#8  0xf7cce85a in qsort () from /lib32/libc.so.6
#9  0x0804ca6b in show_symbols (ebl=0x8055690, ehdr=0xffffcc3c, scn=0x8055580, xndxscn=0x0, shdr=0xffffcc7c, 
    prefix=0x0, fname=0xffffd056 "id:000010,src:000000,op:flip1,pos:5556", 
    fullname=0xffffcb70 "id:000010,src:000000,op:flip1,pos:5556") at nm.c:1360
#10 0x0804d19a in handle_elf (elf=0x8054898, prefix=0x0, fname=0xffffd056 "id:000010,src:000000,op:flip1,pos:5556", 
    suffix=0x0) at nm.c:1485
#11 0x08049f06 in process_file (fname=0xffffd056 "id:000010,src:000000,op:flip1,pos:5556", more_than_one=false)
    at nm.c:391
#12 0x08049b31 in main (argc=2, argv=0xffffcea4) at nm.c:252


Backtrace 2, id:000113,src:000000,op:flip32,pos:5474:
Program received signal SIGSEGV, Segmentation fault.
0xf7dce3ab in __strcmp_ssse3 () from /lib32/libc.so.6
(gdb) bt
#0  0xf7dce3ab in __strcmp_ssse3 () from /lib32/libc.so.6
#1  0xf7f6686d in ?? () from /usr/lib32/libdw.so.1
#2  0xf7f66d80 in dwarf_begin_elf () from /usr/lib32/libdw.so.1
#3  0x0804c14c in show_symbols (ebl=0x8055690, ehdr=0xffffcc3c, scn=0x8055580, xndxscn=0x0, shdr=0xffffcc7c, 
    prefix=0x0, fname=0xffffd055 "id:000113,src:000000,op:flip32,pos:5474", 
    fullname=0xffffcb70 "id:000113,src:000000,op:flip32,pos:5474") at nm.c:1194
#4  0x0804d19a in handle_elf (elf=0x8054898, prefix=0x0, fname=0xffffd055 "id:000113,src:000000,op:flip32,pos:5474", 
    suffix=0x0) at nm.c:1485
#5  0x08049f06 in process_file (fname=0xffffd055 "id:000113,src:000000,op:flip32,pos:5474", more_than_one=false)
    at nm.c:391
#6  0x08049b31 in main (argc=2, argv=0xffffcea4) at nm.c:252

Backtrace 3, id:000116,src:000000,op:flip32,pos:5554
Program received signal SIGSEGV, Segmentation fault.
0xf7d20a72 in __strlen_sse2_bsf () from /lib32/libc.so.6
(gdb) bt
#0  0xf7d20a72 in __strlen_sse2_bsf () from /lib32/libc.so.6
#1  0x0804c4d8 in show_symbols (ebl=0x8055690, ehdr=0xffffcc3c, scn=0x8055580, xndxscn=0x0, shdr=0xffffcc7c, 
    prefix=0x0, fname=0xffffd055 "id:000116,src:000000,op:flip32,pos:5554", 
    fullname=0xffffcb70 "id:000116,src:000000,op:flip32,pos:5554") at nm.c:1264
#2  0x0804d19a in handle_elf (elf=0x8054898, prefix=0x0, fname=0xffffd055 "id:000116,src:000000,op:flip32,pos:5554", 
    suffix=0x0) at nm.c:1485
#3  0x08049f06 in process_file (fname=0xffffd055 "id:000116,src:000000,op:flip32,pos:5554", more_than_one=false)
    at nm.c:391
#4  0x08049b31 in main (argc=2, argv=0xffffcea4) at nm.c:252


I compiled elfutils git head with
./configure --enable-maintainer-mode CFLAGS="-m32 -ggdb" ; make

-- 
Hanno Böck
http://hboeck.de/

mail/jabber: hanno@hboeck.de
GPG: BBB51E42

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

             reply	other threads:[~2014-11-09 21:59 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-09 21:59  [this message]
  -- strict thread matches above, loose matches on Subject: below --
2014-11-13 21:55 
2014-11-13 21:51 Mark Wielaard
2014-11-13 19:39 
2014-11-13 14:45 Mark Wielaard
2014-11-11 16:57 Mark Wielaard
2014-11-11 13:57 
2014-11-11 13:53 Mark Wielaard
2014-11-11 13:49 Petr Machata
2014-11-11 13:40 
2014-11-11 13:30 Petr Machata
2014-11-11 13:15 Mark Wielaard
2014-11-11 10:31 
2014-11-10 20:58 Mark Wielaard
2014-11-09 16:57 Mark Wielaard
2014-11-08 16:10 
2014-11-08 15:32 Mark Wielaard
2014-11-08 14:04 Mark Wielaard
2014-11-07 16:13 
2014-11-07 15:45 Mark Wielaard
2014-11-07 15:32 
2014-11-07 11:58 Mark Wielaard
2014-11-07 11:51 Mark Wielaard
2014-11-07  0:27 
2014-11-06 18:25 Roland McGrath
2014-11-06 16:05 Mark Wielaard
2014-11-06 15:11 Mark Wielaard
2014-10-31 16:13 

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=20141109225946.43440e09@pc \
    --to=elfutils-devel@lists.fedorahosted.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).