public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug other/67446] New: libiberty sha1.c:324 sanitizer runtime error: load of misaligned address 0x62f00011847e for type 'const sha1_uint32', which requires 4 byte alignment
@ 2015-09-04  6:13 zeccav at gmail dot com
  2015-09-04  6:41 ` [Bug other/67446] " pinskia at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: zeccav at gmail dot com @ 2015-09-04  6:13 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67446

            Bug ID: 67446
           Summary: libiberty sha1.c:324 sanitizer runtime error: load of
                    misaligned address 0x62f00011847e for type 'const
                    sha1_uint32', which requires 4 byte alignment
           Product: gcc
           Version: 5.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: other
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zeccav at gmail dot com
  Target Milestone: ---

While building the Fedora 21 kernel 4.1.6-100 with a sanitized version of ld
I got the following sanitizer messages (sha1.c compiled with 
gcc -fsanitize=undefined)
This is sha1.c in libiberty

sha1.c:324:11: runtime error: load of misaligned address 0x62f00011847e for
type 'const sha1_uint32', which requires 4 byte alignment
0x62f00011847e: note: pointer points here
 84 00 00 00 00 00  55 be 1a 00 00 00 48 c7  c7 60 7f c1 82 48 89 e5  e8 7b 03
ed fe 5d c3 66  0f 1f
             ^ 
sha1.c:324:11: runtime error: load of misaligned address 0x62f00011847e for
type 'const sha1_uint32', which requires 4 byte alignment
0x62f00011847e: note: pointer points here
 84 00 00 00 00 00  55 be 1a 00 00 00 48 c7  c7 60 7f c1 82 48 89 e5  e8 7b 03
ed fe 5d c3 66  0f 1f
             ^ 
sha1.c:324:11: runtime error: load of misaligned address 0x62f00011847e for
type 'const sha1_uint32', which requires 4 byte alignment
0x62f00011847e: note: pointer points here
 84 00 00 00 00 00  55 be 1a 00 00 00 48 c7  c7 60 7f c1 82 48 89 e5  e8 7b 03
ed fe 5d c3 66  0f 1f
             ^ 
sha1.c:324:11: runtime error: load of misaligned address 0x62f00011847e for
type 'const sha1_uint32', which requires 4 byte alignment
0x62f00011847e: note: pointer points here
 84 00 00 00 00 00  55 be 1a 00 00 00 48 c7  c7 60 7f c1 82 48 89 e5  e8 7b 03
ed fe 5d c3 66  0f 1f

sha1.c:324 is

x[t] = SWAP (*words);

so it seems that words is not a multiple of four, but it should point to type
sha1_uint32 which is four bytes aligned.
This is on x86-64 building "LD      init/built-in.o" and the command is

ld -m elf_x86_64 --build-id -X -o .tmp_vmlinux1 -T
./arch/x86/kernel/vmlinux.lds arch/x86/kernel/head_64.o
arch/x86/kernel/head64.o arch/x86/kernel/head.o init/built-in.o --start-group
usr/built-in.o arch/x86/built-in.o kernel/built-in.o mm/built-in.o
fs/built-in.o ipc/built-in.o security/built-in.o crypto/built-in.o
block/built-in.o lib/lib.a arch/x86/lib/lib.a lib/built-in.o
arch/x86/lib/built-in.o drivers/built-in.o sound/built-in.o firmware/built-in.o
arch/x86/pci/built-in.o arch/x86/power/built-in.o arch/x86/video/built-in.o
net/built-in.o --end-group


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

* [Bug other/67446] libiberty sha1.c:324 sanitizer runtime error: load of misaligned address 0x62f00011847e for type 'const sha1_uint32', which requires 4 byte alignment
  2015-09-04  6:13 [Bug other/67446] New: libiberty sha1.c:324 sanitizer runtime error: load of misaligned address 0x62f00011847e for type 'const sha1_uint32', which requires 4 byte alignment zeccav at gmail dot com
@ 2015-09-04  6:41 ` pinskia at gcc dot gnu.org
  2015-09-04  7:40 ` miyuki at gcc dot gnu.org
  2015-09-04  7:44 ` pinskia at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2015-09-04  6:41 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67446

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
According to the source, it assumes the input to the sha1_process_block is
aligned correctly.  It might be a bug in ld passing an incorrect aligned block
to that function.


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

* [Bug other/67446] libiberty sha1.c:324 sanitizer runtime error: load of misaligned address 0x62f00011847e for type 'const sha1_uint32', which requires 4 byte alignment
  2015-09-04  6:13 [Bug other/67446] New: libiberty sha1.c:324 sanitizer runtime error: load of misaligned address 0x62f00011847e for type 'const sha1_uint32', which requires 4 byte alignment zeccav at gmail dot com
  2015-09-04  6:41 ` [Bug other/67446] " pinskia at gcc dot gnu.org
@ 2015-09-04  7:40 ` miyuki at gcc dot gnu.org
  2015-09-04  7:44 ` pinskia at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: miyuki at gcc dot gnu.org @ 2015-09-04  7:40 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67446

Mikhail Maltsev <miyuki at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |miyuki at gcc dot gnu.org

--- Comment #2 from Mikhail Maltsev <miyuki at gcc dot gnu.org> ---
BTW, a similar bug reproduces during GCC bootstrap with ubsan:

/home/jenkins/workspace/ubsan-bootstrap/src/libiberty/md5.c:336:7: runtime
error: load of misaligned address 0x7fff91f9983a for type 'const md5_uint32',
which requires 4 byte alignment
0x7fff91f9983a: note: pointer points here
 00 00  f4 48 00 00 00 00 00 00  0a 00 00 00 0e 00 00 00  0d 01 00 00 00 00 00
00  07 49 00 00 00 00
              ^


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

* [Bug other/67446] libiberty sha1.c:324 sanitizer runtime error: load of misaligned address 0x62f00011847e for type 'const sha1_uint32', which requires 4 byte alignment
  2015-09-04  6:13 [Bug other/67446] New: libiberty sha1.c:324 sanitizer runtime error: load of misaligned address 0x62f00011847e for type 'const sha1_uint32', which requires 4 byte alignment zeccav at gmail dot com
  2015-09-04  6:41 ` [Bug other/67446] " pinskia at gcc dot gnu.org
  2015-09-04  7:40 ` miyuki at gcc dot gnu.org
@ 2015-09-04  7:44 ` pinskia at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2015-09-04  7:44 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67446

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Mikhail Maltsev from comment #2)
> BTW, a similar bug reproduces during GCC bootstrap with ubsan:
> 
> /home/jenkins/workspace/ubsan-bootstrap/src/libiberty/md5.c:336:7: runtime
> error: load of misaligned address 0x7fff91f9983a for type 'const
> md5_uint32', which requires 4 byte alignment
> 0x7fff91f9983a: note: pointer points here
>  00 00  f4 48 00 00 00 00 00 00  0a 00 00 00 0e 00 00 00  0d 01 00 00 00 00
> 00 00  07 49 00 00 00 00
>               ^

But those are two different issues.  Also the md5 code explicitly checks to see
if unaligned loads are supported though, it could be better about it.  Please
file this as a separate bug and also note both of these functions really come
from glibc so you might want to file it there (but there might be another
upstream code too).


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

end of thread, other threads:[~2015-09-04  7:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-04  6:13 [Bug other/67446] New: libiberty sha1.c:324 sanitizer runtime error: load of misaligned address 0x62f00011847e for type 'const sha1_uint32', which requires 4 byte alignment zeccav at gmail dot com
2015-09-04  6:41 ` [Bug other/67446] " pinskia at gcc dot gnu.org
2015-09-04  7:40 ` miyuki at gcc dot gnu.org
2015-09-04  7:44 ` pinskia at gcc dot gnu.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).