public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
From: "evvers at ya dot ru" <sourceware-bugzilla@sourceware.org>
To: elfutils-devel@sourceware.org
Subject: [Bug libelf/28685] UBSan: member access within misaligned address 0x7ff316818032 for type 'struct Elf32_Phdr'
Date: Mon, 20 Dec 2021 13:19:18 +0000	[thread overview]
Message-ID: <bug-28685-10460-akhncidseE@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-28685-10460@http.sourceware.org/bugzilla/>

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

--- Comment #5 from Evgeny Vereshchagin <evvers at ya dot ru> ---
Created attachment 13867
  --> https://sourceware.org/bugzilla/attachment.cgi?id=13867&action=edit
regression

I ran the fuzzer a bit longer and it seems
https://sourceware.org/pipermail/elfutils-devel/2021q4/004562.html introduced a
regression:
```
$ LD_LIBRARY_PATH="./libdw;./libelf" ./src/stack --core
../crash-83c981b28f378121157262f840b36f1ba7089a21
=================================================================
==323325==ERROR: AddressSanitizer: unknown-crash on address 0x7f54aacd7000 at
pc 0x0000004c3efa bp 0x7ffd969da5b0 sp 0x7ffd969d9d60
READ of size 2097120 at 0x7f54aacd7000 thread T0
    #0 0x4c3ef9 in __asan_memcpy (/home/vagrant/elfutils/src/stack+0x4c3ef9)
    #1 0x7f54ac1b21f4 in memcpy /usr/include/bits/string_fortified.h:29:10
    #2 0x7f54ac1b21f4 in dwfl_segment_report_module
/home/vagrant/elfutils/libdwfl/dwfl_segment_report_module.c:466:7
    #3 0x7f54ac1c09f8 in dwfl_core_file_report@@ELFUTILS_0.158
/home/vagrant/elfutils/libdwfl/core-file.c:559:17
    #4 0x4fe447 in parse_opt /home/vagrant/elfutils/src/stack.c:595:8
    #5 0x7f54abbcb471 in argp_parse (/lib64/libc.so.6+0x11e471)
    #6 0x4fd99d in main /home/vagrant/elfutils/src/stack.c:695:3
    #7 0x7f54abada55f in __libc_start_call_main (/lib64/libc.so.6+0x2d55f)
    #8 0x7f54abada60b in __libc_start_main@GLIBC_2.2.5
(/lib64/libc.so.6+0x2d60b)
    #9 0x41d6c4 in _start (/home/vagrant/elfutils/src/stack+0x41d6c4)

Address 0x7f54aacd7000 is a wild pointer inside of access range of size
0x0000001fffe0.
SUMMARY: AddressSanitizer: unknown-crash
(/home/vagrant/elfutils/src/stack+0x4c3ef9) in __asan_memcpy
Shadow bytes around the buggy address:
  0x0feb15592db0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0feb15592dc0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0feb15592dd0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0feb15592de0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0feb15592df0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x0feb15592e00:[fe]fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe
  0x0feb15592e10: fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe
  0x0feb15592e20: fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe
  0x0feb15592e30: fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe
  0x0feb15592e40: fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe
  0x0feb15592e50: fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe
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
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  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
  Left alloca redzone:     ca
  Right alloca redzone:    cb
==323325==ABORTING
```

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

  parent reply	other threads:[~2021-12-20 13:19 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-11 21:32 [Bug libelf/28685] New: " evvers at ya dot ru
2021-12-17  9:34 ` [Bug libelf/28685] " mark at klomp dot org
2021-12-17  9:54 ` evvers at ya dot ru
2021-12-19 23:57 ` mark at klomp dot org
2021-12-20 11:34 ` evvers at ya dot ru
2021-12-20 13:19 ` evvers at ya dot ru [this message]
2021-12-20 17:27 ` mark at klomp dot org
2021-12-20 19:01 ` evvers at ya dot ru
2021-12-20 22:34 ` evvers at ya dot ru
2021-12-21  0:01 ` mark at klomp dot org
2021-12-21  1:51 ` evvers at ya dot ru
2021-12-21 11:13 ` mark at klomp dot org

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=bug-28685-10460-akhncidseE@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=elfutils-devel@sourceware.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).