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: Fri, 17 Dec 2021 09:54:33 +0000	[thread overview]
Message-ID: <bug-28685-10460-Kz1L7oCrtB@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 #2 from Evgeny Vereshchagin <evvers at ya dot ru> ---
> 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?
> 

I think it depends on how libelf is supposed to be used. If callers are
expected to pass correctly aligned buffers it seems dwfl_segment_report_module
should be fixed. But it seems that callers can sometimes assume that it should
be fine to pass unaligned data. For example, (even though it has nothing to do
with the xlateto functions) in one of libbpf issues it was pointed out that "I
don't see anywhere the requirement that bytes passed to the elf_memory() should
be aligned, so this does seem like libelf bug."

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

  parent reply	other threads:[~2021-12-17  9:54 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 [this message]
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
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-Kz1L7oCrtB@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).