bug-binutils
[Top][All Lists]
Advanced

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

[Bug binutils/26147] New: nm-new: heap-use-after-free in bfd/elf.c:2604


From: feidiyin at gmail dot com
Subject: [Bug binutils/26147] New: nm-new: heap-use-after-free in bfd/elf.c:2604 bfd_section_from_shdr
Date: Mon, 22 Jun 2020 03:33:49 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=26147

            Bug ID: 26147
           Summary: nm-new: heap-use-after-free in bfd/elf.c:2604
                    bfd_section_from_shdr
           Product: binutils
           Version: 2.34
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: binutils
          Assignee: unassigned at sourceware dot org
          Reporter: feidiyin at gmail dot com
  Target Milestone: ---

Created attachment 12632
  --> https://sourceware.org/bugzilla/attachment.cgi?id=12632&action=edit
The Poc

==3113==ERROR: AddressSanitizer: heap-use-after-free on address 0xf490a230 at
pc 0x081b2101 bp 0xff846998 sp 0xff846988
WRITE of size 4 at 0xf490a230 thread T0
    #0 0x81b2100 in bfd_section_from_shdr
/home/yinqidi/experiment/binutils-2.34/bfd/elf.c:2604
    #1 0x83b639f in bfd_elf32_object_p
/home/yinqidi/experiment/binutils-2.34/bfd/elfcode.h:815
    #2 0x809fb97 in bfd_check_format_matches
/home/yinqidi/experiment/binutils-2.34/bfd/format.c:328
    #3 0x805ae22 in display_file
/home/yinqidi/experiment/binutils-2.34/binutils/nm.c:1375
    #4 0x804f335 in main
/home/yinqidi/experiment/binutils-2.34/binutils/nm.c:1860
    #5 0xf78a3636 in __libc_start_main (/lib/i386-linux-gnu/libc.so.6+0x18636)
    #6 0x8050efb 
(/home/yinqidi/experiment/binutils-2.34/binutils/nm-new+0x8050efb)

0xf490a230 is located 304 bytes inside of 4064-byte region
[0xf490a100,0xf490b0e0)
freed by thread T0 here:
    #0 0xf7adca84 in free (/usr/lib32/libasan.so.2+0x96a84)
    #1 0x864f6ea in objalloc_free_block objalloc.c:248

previously allocated by thread T0 here:
    #0 0xf7adcdee in malloc (/usr/lib32/libasan.so.2+0x96dee)
    #1 0x864ea08 in _objalloc_alloc objalloc.c:159

SUMMARY: AddressSanitizer: heap-use-after-free
/home/yinqidi/experiment/binutils-2.34/bfd/elf.c:2604 bfd_section_from_shdr
Shadow bytes around the buggy address:
  0x3e9213f0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x3e921400: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x3e921410: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x3e921420: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x3e921430: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
=>0x3e921440: fd fd fd fd fd fd[fd]fd fd fd fd fd fd fd fd fd
  0x3e921450: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x3e921460: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x3e921470: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x3e921480: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x3e921490: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07
  Heap left redzone:       fa
  Heap right redzone:      fb
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack partial redzone:   f4
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
==3113==ABORTING

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]