[PATCH 0/2] linux-user: Fix siginfo_t contents when jumping to non-readable pages

Ilya Leoshkevich posted 2 patches 1 year, 8 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20220804182359.830058-1-iii@linux.ibm.com
Maintainers: Richard Henderson <richard.henderson@linaro.org>, Paolo Bonzini <pbonzini@redhat.com>, Eduardo Habkost <eduardo@habkost.net>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, "Philippe Mathieu-Daudé" <f4bug@amsat.org>, Yanan Wang <wangyanan55@huawei.com>, Laurent Vivier <laurent@vivier.eu>, "Alex Bennée" <alex.bennee@linaro.org>, David Hildenbrand <david@redhat.com>
There is a newer version of this series
accel/tcg/translate-all.c        |  16 ++--
accel/tcg/translator.c           |  25 ++++++
include/hw/core/cpu.h            |   2 +
linux-user/signal.c              |   5 ++
tests/tcg/multiarch/noexec.h     | 114 ++++++++++++++++++++++++
tests/tcg/s390x/Makefile.target  |   1 +
tests/tcg/s390x/noexec.c         | 145 +++++++++++++++++++++++++++++++
tests/tcg/x86_64/Makefile.target |   3 +-
tests/tcg/x86_64/noexec.c        | 116 +++++++++++++++++++++++++
9 files changed, 421 insertions(+), 6 deletions(-)
create mode 100644 tests/tcg/multiarch/noexec.h
create mode 100644 tests/tcg/s390x/noexec.c
create mode 100644 tests/tcg/x86_64/noexec.c
[PATCH 0/2] linux-user: Fix siginfo_t contents when jumping to non-readable pages
Posted by Ilya Leoshkevich 1 year, 8 months ago
Hi,

I noticed that when we get a SEGV due to jumping to non-readable
memory, sometimes si_addr and program counter in siginfo_t are slightly
off. I tracked this down to the assumption that translators stop before
the end of a page, while in reality they may stop right after it.

Patch 1 fixes the issue, patch 2 adds tests.

Best regards,
Ilya

Ilya Leoshkevich (2):
  linux-user: Fix siginfo_t contents when jumping to non-readable pages
  tests/tcg: Test siginfo_t contents when jumping to non-readable pages

 accel/tcg/translate-all.c        |  16 ++--
 accel/tcg/translator.c           |  25 ++++++
 include/hw/core/cpu.h            |   2 +
 linux-user/signal.c              |   5 ++
 tests/tcg/multiarch/noexec.h     | 114 ++++++++++++++++++++++++
 tests/tcg/s390x/Makefile.target  |   1 +
 tests/tcg/s390x/noexec.c         | 145 +++++++++++++++++++++++++++++++
 tests/tcg/x86_64/Makefile.target |   3 +-
 tests/tcg/x86_64/noexec.c        | 116 +++++++++++++++++++++++++
 9 files changed, 421 insertions(+), 6 deletions(-)
 create mode 100644 tests/tcg/multiarch/noexec.h
 create mode 100644 tests/tcg/s390x/noexec.c
 create mode 100644 tests/tcg/x86_64/noexec.c

-- 
2.35.3