qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] d9fe91: linux-user: Use correct alignment for


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] d9fe91: linux-user: Use correct alignment for long long on...
Date: Thu, 04 Aug 2016 12:00:03 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: d9fe91d8689b078acfd27bc7c4a4e1efd5bbcf65
      
https://github.com/qemu/qemu/commit/d9fe91d8689b078acfd27bc7c4a4e1efd5bbcf65
  Author: Peter Maydell <address@hidden>
  Date:   2016-08-04 (Thu, 04 Aug 2016)

  Changed paths:
    M include/exec/user/abitypes.h

  Log Message:
  -----------
  linux-user: Use correct alignment for long long on i386 guests

For i386, the ABI specifies that 'long long' (8 byte values)
need only be 4 aligned, but we were requiring them to be
8-aligned. This meant we were laying out the target_epoll_event
structure wrongly. Add a suitable ifdef to abitypes.h to
specify the i386-specific alignment requirement.

Reported-by: Icenowy Zheng <address@hidden>
Signed-off-by: Peter Maydell <address@hidden>
Reviewed-by: Laurent Vivier <address@hidden>
Signed-off-by: Riku Voipio <address@hidden>


  Commit: ba4b3f668abf1fcde204c8f3185ea6edeec6eaa3
      
https://github.com/qemu/qemu/commit/ba4b3f668abf1fcde204c8f3185ea6edeec6eaa3
  Author: Peter Maydell <address@hidden>
  Date:   2016-08-04 (Thu, 04 Aug 2016)

  Changed paths:
    M linux-user/syscall.c

  Log Message:
  -----------
  linux-user: Fix memchr() argument in open_self_cmdline()

In open_self_cmdline() we look for a 0 in the buffer we read
from /prc/self/cmdline. We were incorrectly passing the length
of our buf[] array to memchr() as the length to search, rather
than the number of bytes we actually read into it, which could
be shorter. This was spotted by Coverity (because it could
result in our trying to pass a negative length argument to
write()).

Signed-off-by: Peter Maydell <address@hidden>
Signed-off-by: Riku Voipio <address@hidden>


  Commit: 332c9781f6a7c496adf605a1be72776598c7adc2
      
https://github.com/qemu/qemu/commit/332c9781f6a7c496adf605a1be72776598c7adc2
  Author: Peter Maydell <address@hidden>
  Date:   2016-08-04 (Thu, 04 Aug 2016)

  Changed paths:
    M linux-user/syscall.c

  Log Message:
  -----------
  linux-user: Don't write off end of new_utsname buffer

Use g_strlcpy() rather than strcpy() to copy the uname string
into the structure we return to the guest for the uname syscall.
This avoids overrunning the buffer if the user passed us an
overlong string via the QEMU command line.

We fix a comment typo while we're in the neighbourhood.

Signed-off-by: Peter Maydell <address@hidden>
Signed-off-by: Riku Voipio <address@hidden>


  Commit: 005eb2ae1ff6728de7e6998b7456bd72d4456383
      
https://github.com/qemu/qemu/commit/005eb2ae1ff6728de7e6998b7456bd72d4456383
  Author: Peter Maydell <address@hidden>
  Date:   2016-08-04 (Thu, 04 Aug 2016)

  Changed paths:
    M linux-user/syscall.c
    M linux-user/x86_64/target_structs.h

  Log Message:
  -----------
  linux-user: Fix target_semid_ds structure definition

The target_semid_ds structure is not correct for all
architectures: the padding fields should only exist for:
 * 32-bit ABIs
 * x86

It is also misnamed, since it is following the kernel
semid64_ds structure (QEMU doesn't support the legacy
semid_ds structure at all). Rename the struct, provide
a correct generic definition and allow the oddball x86
architecture to provide its own version.

This fixes broken SYSV semaphores for all our 64-bit
architectures except x86 and ppc.

Signed-off-by: Peter Maydell <address@hidden>
Signed-off-by: Riku Voipio <address@hidden>


  Commit: ef4330c23bb47b97a859dbdbae1c784fd2ca402f
      
https://github.com/qemu/qemu/commit/ef4330c23bb47b97a859dbdbae1c784fd2ca402f
  Author: Peter Maydell <address@hidden>
  Date:   2016-08-04 (Thu, 04 Aug 2016)

  Changed paths:
    M linux-user/syscall.c

  Log Message:
  -----------
  linux-user: Handle brk() attempts with very large sizes

In do_brk(), we were inadvertently truncating the size
of a requested brk() from the guest by putting it into an
'int' variable. This meant that we would incorrectly report
success back to the guest rather than a failed allocation,
typically resulting in the guest then segfaulting. Use
abi_ulong instead.

This fixes a crash in the '31370.cc' test in the gcc libstdc++ test
suite (the test case starts by trying to allocate a very large
size and reduces the size until the allocation succeeds).

Signed-off-by: Peter Maydell <address@hidden>
Signed-off-by: Riku Voipio <address@hidden>


  Commit: 42e0d60f1615ef63d16e41bb1668805560c37870
      
https://github.com/qemu/qemu/commit/42e0d60f1615ef63d16e41bb1668805560c37870
  Author: Peter Maydell <address@hidden>
  Date:   2016-08-04 (Thu, 04 Aug 2016)

  Changed paths:
    M include/exec/user/abitypes.h
    M linux-user/syscall.c
    M linux-user/x86_64/target_structs.h

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/riku/tags/pull-linux-user-20160804' 
into staging

linux-user important fixes for 2.7

# gpg: Signature made Thu 04 Aug 2016 15:10:57 BST
# gpg:                using RSA key 0xB44890DEDE3C9BC0
# gpg: Good signature from "Riku Voipio <address@hidden>"
# gpg:                 aka "Riku Voipio <address@hidden>"
# Primary key fingerprint: FF82 03C8 C391 98AE 0581  41EF B448 90DE DE3C 9BC0

* remotes/riku/tags/pull-linux-user-20160804:
  linux-user: Handle brk() attempts with very large sizes
  linux-user: Fix target_semid_ds structure definition
  linux-user: Don't write off end of new_utsname buffer
  linux-user: Fix memchr() argument in open_self_cmdline()
  linux-user: Use correct alignment for long long on i386 guests

Signed-off-by: Peter Maydell <address@hidden>


Compare: https://github.com/qemu/qemu/compare/09704e6ded83...42e0d60f1615

reply via email to

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