[Bug libelf/28685] UBSan: member access within misaligned address 0x7ff316818032 for type 'struct Elf32_Phdr'

mark at klomp dot org sourceware-bugzilla@sourceware.org
Fri Dec 17 09:34:10 GMT 2021


Mark Wielaard <mark at klomp dot org> changed:

           What    |Removed                     |Added
   Last reconfirmed|                            |2021-12-17
             Status|UNCONFIRMED                 |ASSIGNED
     Ever confirmed|0                           |1
           Assignee|unassigned at sourceware dot org   |mark at klomp dot org
                 CC|                            |mark at klomp dot org

--- Comment #1 from Mark Wielaard <mark at klomp dot org> ---
> gelf_xlate.h:42:1: runtime error: member access within misaligned address 0x7f019ba78032 for type 'struct Elf32_Phdr', which requires 4 byte alignment
> [...]
>   #0 0x7f019d8fa5ea in Elf32_cvt_Phdr /home/vagrant/elfutils/libelf/gelf_xlate.h:42
    #1 0x7f019d8f85f3 in elf32_xlatetom
    #2 0x7f019d827a76 in dwfl_segment_report_module

I have to think about this one.

Should we try to handle unaligned access in the xlateto functions?
Those functions make use of a lot of tricky macros, which depend on the types
passed in.

Or should we fix the called (dwfl_segment_report_module) to only pass correctly
aligned buffers to the xlateto function?

The xlate functions translate between big/little endian on-disk/in-memory Elf
datastructure representations.

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

More information about the Elfutils-devel mailing list