From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 91316606A322 for ; Thu, 3 Dec 2026 05:03:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.u-boot-project.org header.i=@lists.u-boot-project.org header.a=rsa-sha256 header.s=default header.b=nR4pzXGj; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20260707 header.b=iEYYOEj1 Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 61B7A85ACA; Thu, 3 Dec 2026 05:03:55 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id qgomARdOYYLj; Thu, 3 Dec 2026 05:03:54 +0000 (UTC) ARC-Filter: OpenARC Filter v1.3.2 smtp1.osuosl.org 8AF8D850BC Authentication-Results: smtp1.osuosl.org; arc=none smtp.remote-ip=140.211.166.142 ARC-Seal: i=1; d=osuosl.org; s=arc; a=rsa-sha256; cv=none; t=1796274234; b=ZSFaCcLbs8vmhA8AV2kgFYMrx0TFoBkqDVIzZEJkpB5zgUqKYr5dgeSXdYwVuOD+/V+d RGjG3VXy1MrOr7kyYjhipyimZMfyYXGxTLTrQ0ifZhSzLSbBX2ErTQcUhntft72wGZv84 Llnbu2W1uMQHN8SZhtVmOCK+2TRQ49WSPfwpz6PY2zMClvtwgzjhAmgiXHei5YNP8LiLj 9XZ3XBIpnciIdcOi/g4F0QUHjQK+a/bUWutk6Yh62OtAYa1j9p641riyMFBuk6JFNGf55 HNdCfk7eD3k/ekG/jHQnot//J0aVN9LmliUYVpTJJAsy0gsXuBr7LOSN8Scru/x+p7A== ARC-Message-Signature: i=1; d=osuosl.org; s=arc; a=rsa-sha256; c=relaxed/relaxed; t=1796274234; h=X-Comment:DKIM-Signature:X-Original-To:Delivered-To:Received: Received:X-Virus-Scanned:X-Spam-Flag:X-Spam-Score:X-Spam-Level: X-Spam-Status:Received:ARC-Filter:Received-SPF:Received:Received: DKIM-Signature:X-Google-DKIM-Signature:X-Gm-Message-State:X-Received: Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From:To: Cc:Content-Type:X-Mailman-Approved-At:X-BeenThere:X-Mailman-Version: Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help: List-Subscribe:Errors-To; bh=e7GGCakjX6tFV5L5KxdMx2P2VaK5lhsgV6ogR7KgVvY=; b=LuhEqFrKItbJNezxUQrdSm4bvg5ztZmWbTOvpGjLPJnQOiJ5DZ7LnxASF56CRkgwDtqL FZTwrHXDXsUrMhBm4VWbvgvZoLditjoa1Z4IxS7p0WEw5fTUsfX5X/zw/up7inycDHkjF S19YaGLKTBUDS4TQ9c20V3eAeriYwh4xK6a4cSCpEbuFK0XmP/+RUVG5i4hOJYIXkRxWf x0HDrOtoN+g9W1cJexal4lzcutonxona0KBYiKzKFwIci1VE82wTx8CNbLTtak+ZVWo3i wm25RgwHYTpPfsobCr0QLjhdOFLdpWBcprAR5YJKiEKNRrbMkLKiae7PVB+94CU/GrQ== ARC-Authentication-Results: i=1; smtp1.osuosl.org; arc=none smtp.remote-ip=140.211.166.142 X-Comment: SPF check N/A for local connections - client-ip=140.211.166.142; helo=lists1.osuosl.org; envelope-from=u-boot-bounces@lists.u-boot-project.org; receiver= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lists.u-boot-project.org; s=default; t=1796274234; bh=e7GGCakjX6tFV5L5KxdMx2P2VaK5lhsgV6ogR7KgVvY=; h=Date:In-Reply-To:References:Subject:From:To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=nR4pzXGj8mSmn3CbBjB68kV2PmS0/67XFyTmvJScCRb8DHvLzBllBzrTwTDFl+1vu 1BXQpx12NC8p/J5qFMR/yNeUpGzzIiAAF1kKuOV2SGIjtPh35lfxxWb0X3LWu9m+s/ TQLbBSwXmGT71UhD1zzcQxtqV7ok/qCrYED2+Q4zZ916qOQ333xWjIPX8P5qKGg0Oo uQtMNKvWtrgBNepXh5jNFt2psyTA1M351kahDWuBVbBvPSPaFKE4WpaKZkhxvd/qb4 R2FWjqznbPkOiJhpPqGwsOoJyUwx7zbEG95/GUoXVVqIJp17grTPnymnsyuDXH/lH1 Grdga4s31vcTw== Received: from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142]) by smtp1.osuosl.org (Postfix) with ESMTP id 8AF8D850BC; Thu, 3 Dec 2026 05:03:54 +0000 (UTC) Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by lists1.osuosl.org (Postfix) with ESMTP id 7D28433E for ; Thu, 3 Dec 2026 02:22:12 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 6EDBD400DB for ; Thu, 3 Dec 2026 02:22:12 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id rGYg6o5_FZuH for ; Thu, 3 Dec 2026 02:22:11 +0000 (UTC) ARC-Filter: OpenARC Filter v1.3.2 smtp2.osuosl.org B1EA44009D Authentication-Results: smtp2.osuosl.org; arc=none smtp.remote-ip="2001:4860:4864:20::47" Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2001:4860:4864:20::47; helo=mail-oa1-x47.google.com; envelope-from=3udiqawgkbpg59gde6ke8gg8d6.4gem-3ggldaklk.m-3ggl-hjgb64l.gj8@flex--dholmesm.bounces.google.com; receiver= Authentication-Results: smtp2.osuosl.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp2.osuosl.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20260707 header.b=iEYYOEj1 Received: from mail-oa1-x47.google.com (mail-oa1-x47.google.com [IPv6:2001:4860:4864:20::47]) by smtp2.osuosl.org (Postfix) with ESMTPS id B1EA44009D for ; Thu, 3 Dec 2026 02:22:11 +0000 (UTC) Received: by mail-oa1-x47.google.com with SMTP id 586e51a60fabf-4b6c84feb67so12055733fac.2 for ; Wed, 02 Dec 2026 18:22:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20260707; t=1796264530; x=1796869330; darn=lists.u-boot-project.org; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:from:to:cc:subject:date:message-id:reply-to :content-type; bh=e7GGCakjX6tFV5L5KxdMx2P2VaK5lhsgV6ogR7KgVvY=; b=iEYYOEj1AjCFBmnwN1DddIr08xYbPKIHP5XBWPoZscuB7mEyYcnY3UILVfxrbJvn+e ok79lzpbn9BpW0AnXh2giL3e4DtcVn2tA36XRfps3C5kb6gj5qDA5m1/T/UTGGaqaalA bhzoNSpdDQepRpebOh4+rsKwgYSJi7tlxYNbq3VgMpiQIrS6oBscRvX+50TTgEkqN7OS p4JZChoocIUJRHvKtBu3f0A6uryfXwW8l54mZqG/Acv3PAztz1Q0fYEKl90Bv6CQ1VHW rlrX1OVsrR3zqblpLOdSyNK2vJBeNzrVQfEtBRxwDc7dLUxHlB7fc3q3w/Kc0SThgU8T PbPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796264530; x=1796869330; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=e7GGCakjX6tFV5L5KxdMx2P2VaK5lhsgV6ogR7KgVvY=; b=LFw076yzi4c3LhAaFlfjfNeAnsUvtD8nuCs/b1KJfFi+g0baa2YriJctfT4qYdot2v SdvluzlTKk76YD9dE1Ze+sdDbENz8pb0F7tRkZg+R+/fkzsW4r4LkxPfueXo7ZTHKIqs JmffyREL3DUetMTtXNrMtjh8HXeDvh8mxv/hXuim1gVIKsxzZPg08NGdF6ga6VNy5352 H0xU21T2DOyPo22Ke32qTUyknQmVenN3URrvkHlPCK1IE6iT4shfg/a4kZRy1g4spMQ1 8trcttnJJc2XjXUCQvVJI3R4/wGAuW81qT6dLLjQP4aroeOs4lPQYpHV6FJgSkZ4q4TH uRtQ== X-Gm-Message-State: APuU4Z/6Gx2OYZEFEsV+vliFIU9s3alAvm6y+W82YluvcVFOIvQ4dUES 3BWo1pAKs4ppfmUyMvx5H3lPJMqz9uCHPz9vYLPbbaIZuF6uV6ZcaBiMyKvImMUnYuqX9eyVxD6 zHkRpfJnJ6EhuNjSyLytRr4ZhplwHjF/I+eh7YvBZce7tf32oikLqx4ptUIyIwO3N/vZGP206d+ adhmHciZhoG0gQk+OSj0mSL+4gpxquu9i+qxRf2K1mY7rDUpbHXUrcBDQ0cJ4= X-Received: from oaciw6.prod.google.com ([2002:a05:6871:cd86:b0:4a7:348d:4121]) (user=dholmesm job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6870:7d18:b0:4ae:11ae:9b85 with SMTP id 586e51a60fabf-4bc849264b9mr36755800fac.40.1796264529886; Wed, 02 Dec 2026 18:22:09 -0800 (PST) Date: Thu, 03 Dec 2026 02:21:10 GMT In-Reply-To: <20261203022028.04-00-dholmesm@google.com> X-Archived-By: Mime-Version: 1.0 References: <20261203022028.04-00-dholmesm@google.com> Message-ID: <20261203022028.04-02-dholmesm@google.com> Subject: [PATCH 2/4] qfw/acpi: Guard ACPI 1.0 RSDP bounds and NULL lookup From: Dan Holmes-Mitra To: u-boot@lists.u-boot-project.org Cc: Tom Rini , Heinrich Schuchardt , Ilias Apalodimas Content-Type: text/plain; charset="UTF-8" X-Mailman-Approved-At: Thu, 03 Dec 2026 05:03:38 +0000 X-BeenThere: u-boot@lists.u-boot-project.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: U-Boot discussion List-Archive: List-Post: List-Help: List-Subscribe: , X-Spam-Status: No, score=-23.4 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 QEMU x86 i440fx provides a 20-byte ACPI 1.0 RSDP (revision 0) in etc/acpi/rsdp. Unconditionally writing rsdp->length (offset 20) and rsdp->ext_checksum (offset 32) overflowed 16 bytes past the end of the allocation into adjacent table memory. Only update the ACPI 2.0 extended fields when rsdp->revision >= ACPI_RSDP_REV_ACPI_2_0, recompute the 20-byte base checksum, and guard against a NULL file pointer in acpi_get_rsdp_addr() when etc/acpi/rsdp is absent. Signed-off-by: Dan Holmes-Mitra --- drivers/misc/qfw_acpi.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/misc/qfw_acpi.c b/drivers/misc/qfw_acpi.c index 7cb81eb222..580bef4adb 100644 --- a/drivers/misc/qfw_acpi.c +++ b/drivers/misc/qfw_acpi.c @@ -272,9 +272,14 @@ out: } struct acpi_rsdp *rsdp = ctx->rsdp; - rsdp->length = sizeof(*rsdp); - rsdp->ext_checksum = 0; - rsdp->ext_checksum = table_compute_checksum((u8 *)rsdp, sizeof(*rsdp)); + rsdp->checksum = 0; + rsdp->checksum = table_compute_checksum((u8 *)rsdp, 20); + if (rsdp->revision >= ACPI_RSDP_REV_ACPI_2_0) { + rsdp->length = sizeof(*rsdp); + rsdp->ext_checksum = 0; + rsdp->ext_checksum = table_compute_checksum((u8 *)rsdp, + sizeof(*rsdp)); + } gd_set_acpi_start(acpi_get_rsdp_addr()); @@ -294,7 +299,7 @@ ulong acpi_get_rsdp_addr(void) } file = qfw_find_file(dev, "etc/acpi/rsdp"); - return file->addr; + return file ? file->addr : 0; } void acpi_write_rsdp(struct acpi_rsdp *rsdp, struct acpi_rsdt *rsdt, -- 2.56.1.911.g883d8bcb20-goog