[prev in list] [next in list] [prev in thread] [next in thread] 

List:       qemu-commits
Subject:    [Qemu-commits] [qemu/qemu] 38138f: linux-user/mmap.c: handle invalid len maps correct...
From:       GitHub <noreply () github ! com>
Date:       2018-07-31 14:01:25
Message-ID: 5b606bb5e7e8_4fb52aeae93b4f8010177a () hookshot-fe-b0febf1 ! cp1-iad ! github ! net ! mail
[Download RAW message or body]


  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 38138fab93584ad3560ddfcd70efbd5bb6b4a6f0
      https://github.com/qemu/qemu/commit/38138fab93584ad3560ddfcd70efbd5=
bb6b4a6f0
  Author: Alex Benn=C3=A9e <alex.bennee@linaro.org>
  Date:   2018-07-31 (Tue, 31 Jul 2018)

  Changed paths:
    M linux-user/mmap.c

  Log Message:
  -----------
  linux-user/mmap.c: handle invalid len maps correctly

I've slightly re-organised the check to more closely match the
sequence that the kernel uses in do_mmap(). We check for both the zero
case (EINVAL) and the overflow length case (ENOMEM).

Signed-off-by: Alex Benn=C3=A9e <alex.bennee@linaro.org>
Cc: umarcor <1783362@bugs.launchpad.net>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20180730134321.19898-2-alex.bennee@linaro.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>


  Commit: 28cbb997d66e4d1904a231bef1ce15c2cbb6bf73
      https://github.com/qemu/qemu/commit/28cbb997d66e4d1904a231bef1ce15c=
2cbb6bf73
  Author: Alex Benn=C3=A9e <alex.bennee@linaro.org>
  Date:   2018-07-31 (Tue, 31 Jul 2018)

  Changed paths:
    M tests/tcg/multiarch/test-mmap.c

  Log Message:
  -----------
  tests: add check_invalid_maps to test-mmap

This adds a test to make sure we fail properly for a 0 length mmap.
There are most likely other failure conditions we should also check.

Signed-off-by: Alex Benn=C3=A9e <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Cc: umarcor <1783362@bugs.launchpad.net>
Message-Id: <20180730134321.19898-3-alex.bennee@linaro.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>


  Commit: 5d9f3ea0817215ad4baac5aa30414e9ebbaaf0d6
      https://github.com/qemu/qemu/commit/5d9f3ea0817215ad4baac5aa30414e9=
ebbaaf0d6
  Author: Shivaprasad G Bhat <sbhat@linux.vnet.ibm.com>
  Date:   2018-07-31 (Tue, 31 Jul 2018)

  Changed paths:
    M linux-user/host/ppc64/safe-syscall.inc.S

  Log Message:
  -----------
  linux-user: ppc64: don't use volatile register during safe_syscall

r11 is a volatile register on PPC as per calling conventions.
The safe_syscall code uses it to check if the signal_pending
is set during the safe_syscall. When a syscall is interrupted
on return from signal handling, the r11 might be corrupted
before we retry the syscall leading to a crash. The registers
r0-r13 are not to be used here as they have
volatile/designated/reserved usages.

Change the code to use r14 which is non-volatile.
Use SP+16 which is a slot for LR, for save/restore of previous value
of r14. SP+16 can be used, as LR is preserved across the syscall.

Steps to reproduce:
On PPC host, issue `qemu-x86_64 /usr/bin/cc -E -`
Attempt Ctrl-C, the issue is reproduced.

Reference:
https://refspecs.linuxfoundation.org/ELF/ppc64/PPC-elf64abi-1.9.html#REG
https://openpowerfoundation.org/wp-content/uploads/2016/03/ABI64BitOpenPO=
WERv1.1_16July2015_pub4.pdf

Signed-off-by: Shivaprasad G Bhat <sbhat@linux.vnet.ibm.com>
Tested-by: Richard Henderson <richard.henderson@linaro.org>
Tested-by: Laurent Vivier <laurent@vivier.eu>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <153301568965.30312.10498134581068746871.stgit@dhcp-9-109-246=
-16>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>


  Commit: 42e76456cf68dc828b8dbd3c7e255197e9b5e57d
      https://github.com/qemu/qemu/commit/42e76456cf68dc828b8dbd3c7e25519=
7e9b5e57d
  Author: Peter Maydell <peter.maydell@linaro.org>
  Date:   2018-07-31 (Tue, 31 Jul 2018)

  Changed paths:
    M linux-user/host/ppc64/safe-syscall.inc.S
    M linux-user/mmap.c
    M tests/tcg/multiarch/test-mmap.c

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/vivier2/tags/linux-user-for-3.0-p=
ull-request' into staging

Fix safe_syscall() on ppc64 host
Fix mmap() 0 length error case

# gpg: Signature made Tue 31 Jul 2018 09:41:07 BST
# gpg:                using RSA key F30C38BD3F2FBE3C
# gpg: Good signature from "Laurent Vivier <lvivier@redhat.com>"
# gpg:                 aka "Laurent Vivier <laurent@vivier.eu>"
# gpg:                 aka "Laurent Vivier (Red Hat) <lvivier@redhat.com>=
"
# Primary key fingerprint: CD2F 75DD C8E3 A4DC 2E4F  5173 F30C 38BD 3F2F =
BE3C

* remotes/vivier2/tags/linux-user-for-3.0-pull-request:
  linux-user: ppc64: don't use volatile register during safe_syscall
  tests: add check_invalid_maps to test-mmap
  linux-user/mmap.c: handle invalid len maps correctly

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>


Compare: https://github.com/qemu/qemu/compare/45a505d0a4b3...42e76456cf68=

      **NOTE:** This service has been marked for deprecation: https://dev=
eloper.github.com/changes/2018-04-25-github-services-deprecation/

      Functionality will be removed from GitHub.com on January 31st, 2019=
.


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic