From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C72E7C43458 for ; Thu, 9 Jul 2026 02:06:38 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1whe97-0004ep-Ia; Wed, 08 Jul 2026 22:05:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1whe95-0004eN-8d for qemu-devel@nongnu.org; Wed, 08 Jul 2026 22:05:47 -0400 Received: from out-172.mta0.migadu.com ([2001:41d0:1004:224b::ac]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1whe92-0006jq-P2 for qemu-devel@nongnu.org; Wed, 08 Jul 2026 22:05:46 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1783562741; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=11VJzCJmNpneVi+9tRrTkSmP3PfhrWHRWs+ymedDS/Y=; b=iZGnrtvv+qcMzhYg5+0oE/Jj3FNpx2+MaX3QxJw/DBVkJ1ILFbl55kO9hcHcYYRPE0r/RU Q/LLVZ5UFzvJrplUMVBouIhsOKR3peplD6KNtm6wl+Zs9Sixkt8Fgq05oB1BvB2eUdqz1j V0FUTfPoT1XJw/G9gyTkOJN1RrSaMUk= From: Tao Cui 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 Message-ID: <20260709020529.126652-1-cui.tao@linux.dev> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT Received-SPF: pass client-ip=2001:41d0:1004:224b::ac; envelope-from=cui.tao@linux.dev; helo=out-172.mta0.migadu.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Tao Cui 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