From: Tao Cui <cui.tao@linux.dev>
To: qemu-devel@nongnu.org
Cc: richard.henderson@linaro.org, pbonzini@redhat.com,
cuitao@kylinos.cn, cui.tao@linux.dev
Subject: [PATCH v1 0/2] accel/tcg: fix crash on instruction straddling address-space end
Date: Thu, 9 Jul 2026 10:05:27 +0800 [thread overview]
Message-ID: <20260709020529.126652-1-cui.tao@linux.dev> (raw)
From: Tao Cui <cuitao@kylinos.cn>
translator_ld() asserts that a page-crossing instruction reads its two
pages from virtually-contiguous addresses (page0 + TARGET_PAGE_SIZE). On
32-bit targets a guest can defeat this by executing an instruction at
the very end of the address space, which wraps the second page back to
the start; the assert fires and QEMU aborts. This is a guest-triggered
host crash (DoS).
Patch 1 takes the second page from pc when the linear page0 +
TARGET_PAGE_SIZE does not land on pc's page, handling both the normal
contiguous case and the wraparound case without needing the
address-space width.
Patch 2 adds a multiboot regression test (tests/multiboot/wraparound)
that runs on qemu-system-i386 and aborts without the fix.
Tao Cui (2):
accel/tcg: fix crash on instruction straddling address-space end
tests/multiboot: add regression test for translator_ld wraparound
accel/tcg/translator.c | 16 ++++++------
tests/multiboot/Makefile | 7 +++++-
tests/multiboot/run_test.sh | 8 +++++-
tests/multiboot/wraparound.c | 46 ++++++++++++++++++++++++++++++++++
tests/multiboot/wraparound.out | 5 ++++
5 files changed, 72 insertions(+), 10 deletions(-)
create mode 100644 tests/multiboot/wraparound.c
create mode 100644 tests/multiboot/wraparound.out
--
2.43.0
next reply other threads:[~2026-07-09 2:06 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-09 2:05 Tao Cui [this message]
2026-07-09 2:05 ` [PATCH v1 1/2] accel/tcg: fix crash on instruction straddling address-space end Tao Cui
2026-07-09 2:05 ` [PATCH v1 2/2] tests/multiboot: add regression test for translator_ld wraparound Tao Cui
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260709020529.126652-1-cui.tao@linux.dev \
--to=cui.tao@linux.dev \
--cc=cuitao@kylinos.cn \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.