public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
* [Bug libdw/28720] New: UBSan: member access within misaligned address 0x7f6e8d80f142 for type 'struct Elf32_Phdr', which requires 4 byte alignment
@ 2021-12-22  0:35 evvers at ya dot ru
  2021-12-22  1:00 ` [Bug libdw/28720] " evvers at ya dot ru
                   ` (17 more replies)
  0 siblings, 18 replies; 19+ messages in thread
From: evvers at ya dot ru @ 2021-12-22  0:35 UTC (permalink / raw)
  To: elfutils-devel

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

            Bug ID: 28720
           Summary: UBSan: member access within misaligned address
                    0x7f6e8d80f142 for type 'struct Elf32_Phdr', which
                    requires 4 byte alignment
           Product: elfutils
           Version: unspecified
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: libdw
          Assignee: unassigned at sourceware dot org
          Reporter: evvers at ya dot ru
                CC: elfutils-devel at sourceware dot org
  Target Milestone: ---

Created attachment 13872
  --> https://sourceware.org/bugzilla/attachment.cgi?id=13872&action=edit
File triggering misaligned access

While I was testing
https://sourceware.org/pipermail/elfutils-devel/2021q4/004584.html I passed
FUZZ_TIME=3600 to the test to run it for an hour and in the process it ran into
another misaligned access. Just to make sure it isn't
https://sourceware.org/bugzilla/show_bug.cgi?id=28685 I pulled the master
branch with the "fuzz" branch included. It can be reproduced with
`./src/stack`:
```
autoreconf -i -f
./configure --enable-maintainer-mode --enable-sanitize-undefined
make  -j$(nproc) V=1
UBSAN_OPTIONS=print_stacktrace=1:print_summary=1
LD_LIBRARY_PATH="./libdw;./libelf" ./src/stack --core
../SIGABRT.PC.7fffe516d84c.STACK.d7ffe76d7.CODE.-6.ADDR.0.INSTR.mov____%eax,%ebp.fuzz
gelf_xlate.h:42:1: runtime error: member access within misaligned address
0x7f3827783142 for type 'struct Elf32_Phdr', which requires 4 byte alignment
0x7f3827783142: note: pointer points here
 00 00  00 10 00 00 00 00 00 c5  00 10 00 00 00 00 00 00  00 10 00 00 00 00 00
00  01 00 00 00 06 15
              ^
    #0 0x7f38295f992c in Elf32_cvt_Phdr
/home/vagrant/elfutils/libelf/gelf_xlate.h:42
    #1 0x7f38295f8363 in elf32_xlatetom
/home/vagrant/elfutils/libelf/elf32_xlatetom.c:104
    #2 0x7f382952a821 in dwfl_link_map_report
/home/vagrant/elfutils/libdwfl/link_map.c:925
    #3 0x7f382952de80 in _new.dwfl_core_file_report
/home/vagrant/elfutils/libdwfl/core-file.c:548
    #4 0x402fa0 in parse_opt /home/vagrant/elfutils/src/stack.c:595
    #5 0x7f382878b471 in argp_parse (/lib64/libc.so.6+0x11e471)
    #6 0x4026aa in main /home/vagrant/elfutils/src/stack.c:695
    #7 0x7f382869a55f in __libc_start_call_main (/lib64/libc.so.6+0x2d55f)
    #8 0x7f382869a60b in __libc_start_main_impl (/lib64/libc.so.6+0x2d60b)
    #9 0x402944 in _start (/home/vagrant/elfutils/src/stack+0x402944)

SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior gelf_xlate.h:42:1 in
```

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

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2022-01-07 16:39 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-22  0:35 [Bug libdw/28720] New: UBSan: member access within misaligned address 0x7f6e8d80f142 for type 'struct Elf32_Phdr', which requires 4 byte alignment evvers at ya dot ru
2021-12-22  1:00 ` [Bug libdw/28720] " evvers at ya dot ru
2021-12-24  1:10 ` mark at klomp dot org
2021-12-24  8:05 ` evvers at ya dot ru
2021-12-24  8:06 ` evvers at ya dot ru
2021-12-24  8:07 ` evvers at ya dot ru
2021-12-24  8:17 ` evvers at ya dot ru
2022-01-03 23:42 ` mark at klomp dot org
2022-01-04 18:58 ` evvers at ya dot ru
2022-01-04 19:21 ` evvers at ya dot ru
2022-01-04 21:37 ` mark at klomp dot org
2022-01-04 22:02 ` evvers at ya dot ru
2022-01-06  0:51 ` evvers at ya dot ru
2022-01-06 15:55 ` mark at klomp dot org
2022-01-06 16:41 ` mark at klomp dot org
2022-01-06 17:04 ` mark at klomp dot org
2022-01-06 17:36 ` evvers at ya dot ru
2022-01-06 20:52 ` evvers at ya dot ru
2022-01-07 16:39 ` mark at klomp dot org

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).