[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] 82991b: linux-user: Put PPC AT_IGNOREPPC auxv

From: GitHub
Subject: [Qemu-commits] [qemu/qemu] 82991b: linux-user: Put PPC AT_IGNOREPPC auxv entries in t...
Date: Thu, 29 Jun 2017 03:44:11 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 82991bed738783d68c9950840b2e98d84b9f0621
  Author: Peter Maydell <address@hidden>
  Date:   2017-06-29 (Thu, 29 Jun 2017)

  Changed paths:
    M linux-user/elfload.c

  Log Message:
  linux-user: Put PPC AT_IGNOREPPC auxv entries in the right place

The 32-bit PPC auxv is a bit complicated because in the
mists of time it used to be 16-aligned rather than directly
after the environment. Older glibc versions had code to
try to probe for whether it needed alignment or not:
and the kernel has code which puts some magic entries at
the bottom to ensure that the alignment probe fails:

QEMU has similar code too, but it was broken by commit
7c4ee5bcc82e64, which changed elfload.c from filling in
the auxv starting at the highest address and working down
to starting at the lowest address and working up. This
means that the ARCH_DLINFO hook must now be invoked first
rather than last, and the entries in it for PPC must
be reversed so that the magic AT_IGNOREPPC entries come
at the lowest address in the auxv as they should.

The effect of this was that if running a guest binary that
used an old glibc with the alignment probing the guest ld.so
code would segfault if the size of the guest environment and
argv happened to put the auxv at an address that triggered
the alignment code in the guest glibc.

Signed-off-by: Peter Maydell <address@hidden>
Reviewed-by: Richard Henderson <address@hidden>
Tested-by: Richard Henderson <address@hidden>
Message-id: address@hidden

reply via email to

[Prev in Thread] Current Thread [Next in Thread]