qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] bd4b7f: linux-user/hppa: Fix segfaults on pag


From: Peter Maydell
Subject: [Qemu-commits] [qemu/qemu] bd4b7f: linux-user/hppa: Fix segfaults on page zero
Date: Tue, 26 Jul 2022 07:30:26 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: bd4b7fd6ba98e2d660356f1f52edcec5c51b0991
      
https://github.com/qemu/qemu/commit/bd4b7fd6ba98e2d660356f1f52edcec5c51b0991
  Author: Helge Deller <deller@gmx.de>
  Date:   2022-07-25 (Mon, 25 Jul 2022)

  Changed paths:
    M linux-user/hppa/cpu_loop.c

  Log Message:
  -----------
  linux-user/hppa: Fix segfaults on page zero

This program:

    int main(void) { asm("bv %r0(%r0)"); return 0; }

produces on real hppa hardware the expected segfault:

    SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0x3} ---
    killed by SIGSEGV +++
    Segmentation fault

But when run on linux-user you get instead internal qemu errors:

ERROR: linux-user/hppa/cpu_loop.c:172:cpu_loop: code should not be reached
Bail out! ERROR: linux-user/hppa/cpu_loop.c:172:cpu_loop: code should not be 
reached
ERROR: accel/tcg/cpu-exec.c:933:cpu_exec: assertion failed: (cpu == current_cpu)
Bail out! ERROR: accel/tcg/cpu-exec.c:933:cpu_exec: assertion failed: (cpu == 
current_cpu)

Fix it by adding the missing case for the EXCP_IMP trap in
cpu_loop() and raise a segfault.

Signed-off-by: Helge Deller <deller@gmx.de>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-Id: <YtWNC56seiV6VenA@p100>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>


  Commit: 499d8055379f5beb2ca155c668eca52b8a24321a
      
https://github.com/qemu/qemu/commit/499d8055379f5beb2ca155c668eca52b8a24321a
  Author: Helge Deller <deller@gmx.de>
  Date:   2022-07-25 (Mon, 25 Jul 2022)

  Changed paths:
    M linux-user/syscall.c
    M meson.build

  Log Message:
  -----------
  linux-user: Unconditionally use pipe2() syscall

The pipe2() syscall is available on all Linux platforms since kernel
2.6.27, so use it unconditionally to emulate pipe() and pipe2().

Signed-off-by: Helge Deller <deller@gmx.de>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-Id: <YtbZ2ojisTnzxN9Y@p100>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>


  Commit: 6f200f51869ff0de7ea0343dd7104362e994b382
      
https://github.com/qemu/qemu/commit/6f200f51869ff0de7ea0343dd7104362e994b382
  Author: Helge Deller <deller@gmx.de>
  Date:   2022-07-25 (Mon, 25 Jul 2022)

  Changed paths:
    M linux-user/syscall.c

  Log Message:
  -----------
  linux-user: Use target abi_int type for pipefd[1] in pipe()

When writing back the fd[1] pipe file handle to emulated userspace
memory, use sizeof(abi_int) as offset insted of the hosts's int type.
There is no functional change in this patch.

Signed-off-by: Helge Deller <deller@gmx.de>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

Message-Id: <YtQ3Id6z8slpVr7r@p100>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>


  Commit: d1c912b816844aa045082595eba796b5a025dbc4
      
https://github.com/qemu/qemu/commit/d1c912b816844aa045082595eba796b5a025dbc4
  Author: Peter Maydell <peter.maydell@linaro.org>
  Date:   2022-07-26 (Tue, 26 Jul 2022)

  Changed paths:
    M linux-user/hppa/cpu_loop.c
    M linux-user/syscall.c
    M meson.build

  Log Message:
  -----------
  Merge tag 'linux-user-for-7.1-pull-request' of 
https://gitlab.com/laurent_vivier/qemu into staging

linux-user pull request 20220726

# gpg: Signature made Tue 26 Jul 2022 10:44:29 BST
# gpg:                using RSA key CD2F75DDC8E3A4DC2E4F5173F30C38BD3F2FBE3C
# gpg:                issuer "laurent@vivier.eu"
# gpg: Good signature from "Laurent Vivier <lvivier@redhat.com>" [full]
# gpg:                 aka "Laurent Vivier <laurent@vivier.eu>" [full]
# gpg:                 aka "Laurent Vivier (Red Hat) <lvivier@redhat.com>" 
[full]
# Primary key fingerprint: CD2F 75DD C8E3 A4DC 2E4F  5173 F30C 38BD 3F2F BE3C

* tag 'linux-user-for-7.1-pull-request' of 
https://gitlab.com/laurent_vivier/qemu:
  linux-user: Use target abi_int type for pipefd[1] in pipe()
  linux-user: Unconditionally use pipe2() syscall
  linux-user/hppa: Fix segfaults on page zero

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


Compare: https://github.com/qemu/qemu/compare/0d0275c31f00...d1c912b81684



reply via email to

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