From nobody Sat Sep 12 11:35:21 2026 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4hhq8p0VR8z6s0jb for ; Sat, 12 Sep 2026 11:35:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "YR2" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4hhq8n4n0Yz4SVn for ; Sat, 12 Sep 2026 11:35:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1789212921; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kOCs/X0XCmjaZvUrpR4J8lhO8u1fhjYrlRwifk+YumQ=; b=BvQFoLLNTm/8aHrUutedwCbg8siXuopP9X79PnygjMXi0qnwnpYnbjFupqVSIxeZ0Gxlli AbN/AWif4IzKpLWYlmGyWA+bDjTdadYuwZtDoo90a0aNWFw4ZD6s18AsHWa5HXm3SxA/nM UEfZiDm0EfgTpmrVZEH8Thfb07vkkytUMW7j83d2Xl7gThZ1mrtM5wz7WLjql4oigjevbG O3xYQLg/MEOR5QqP6TYEQHg2+wUxY85o+B1lBiPrFOH3NtL4IOTthapOv7sGa7pm94c80o 1QjsURuwnzWpHnSuLMdxo+Kos/5G89gmsWpUIBrCOdqggeCjZsDCnbm0b+q0CA== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1789212921; b=mfw0+QmNAxGIrBFy8lbphSKWXobnSsCHh91+CBSeMQMYZOCwwekfz5OEpOUcUFneVEHH0H B6WDT+HzhhCadCET6BLVBQgYD6wBZ8hcy23/MX4PbJcUZz8Q6MHzqGonQxKg+gnru0Ey0E FRltRRIn0kRSBCJhN8YSELhT+POAW/A2OPxUxiRUOGBReR9V7nIUMJHxuWUbwn53/cowtx 9Kk9D0AWZxaXJ/porvMZj5BiU0QkBXveRNRqudffc/YMt8z1VhGKi3xQYdqKExQq8C1wWi bmmbhcA1WUyHOnZ2Ei+/1tsiwzCcJogW1mCV/2ROVNoJIBPUNtCfFGNBz+/frQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1789212921; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kOCs/X0XCmjaZvUrpR4J8lhO8u1fhjYrlRwifk+YumQ=; b=LSaNPAQGw6TCIc8hoHKQwpS3QVrcXCWoLUQgGE6YjuHIUR3YccOf+A/Qbd8qHdUmhePsUS VgkGBE3ZqPUILakTezrm3I8/PQUt0EqeywHktNoUJQ9Z9ux1nZ3ljaTe47pZlK0V93AAbN Jc3wTAQlcGbXsiHn1g1THPOK+DxuwLT6zSfdOqfbcUDLbhHDq9XeWK8rGuNJ7kOqJo8fpr UUTcEmR+15MkxIGVdlgEqYJSHrxXwJzfdA2FP+3jK/XxpSBqHGsBpvFVZjsqIcQYwdQrzl D6tEYBHwXKuKAsn/Y6tY+RXlvPz9Mc2lHtBH3Un1NYJu5k9N9TsElbb2FwY0Wg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hhq8n3s9MzxVn for ; Sat, 12 Sep 2026 11:35:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 45dd6 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 12 Sep 2026 11:35:21 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Aymeric Wibo Subject: git: 508efe35e577 - main - acpi_spmc: Check Intel constraint packages List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: obiwac X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 508efe35e577e322ab839def893f9ccb9826a9e4 Auto-Submitted: auto-generated Date: Sat, 12 Sep 2026 11:35:21 +0000 Message-Id: <6aa538f9.45dd6.15a3f9d0@gitrepo.freebsd.org> The branch main has been updated by obiwac: URL: https://cgit.FreeBSD.org/src/commit/?id=508efe35e577e322ab839def893f9ccb9826a9e4 commit 508efe35e577e322ab839def893f9ccb9826a9e4 Author: Aymeric Wibo AuthorDate: 2026-09-10 09:40:35 +0000 Commit: Aymeric Wibo CommitDate: 2026-09-12 11:28:59 +0000 acpi_spmc: Check Intel constraint packages Some firmware inexplicably decides to do non-standard and annoying stuff here, e.g. the Fujitsu Futro S940 with an Intel Pentium J5005 sometimes returns the following when calling the DEVICE_CONSTRAINTS function on the Intel DSM: Return (Package (0x01) { Zero }) (Package elements here are supposed to be constraint packages, not just a single value.) First reported in the following forum post: https://forum.netgate.com/topic/201090/2.9.0-beta-leads-to-kernel-panic-on-boot Reported by: TampertK on forum.netgate.com Reviewed by: olce Sponsored by: The FreeBSD Foundation Event: EuroBSDCon Devsummit 2026 Differential Revision: https://reviews.freebsd.org/D59566 --- sys/dev/acpica/acpi_spmc.c | 50 +++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 45 insertions(+), 5 deletions(-) diff --git a/sys/dev/acpica/acpi_spmc.c b/sys/dev/acpica/acpi_spmc.c index 8691354ff4d9..d91df4d56afc 100644 --- a/sys/dev/acpica/acpi_spmc.c +++ b/sys/dev/acpica/acpi_spmc.c @@ -636,13 +636,38 @@ acpi_spmc_parse_constraints_intel(struct acpi_spmc_softc *sc, ACPI_OBJECT *objec constraint_obj = &object->Package.Elements[i]; constraint = &sc->constraints[j]; + if (constraint_obj->Type != ACPI_TYPE_PACKAGE) { + device_printf(sc->dev, "Intel: Wrong element type for " + "constraint %zu.\n", i); + goto skip; + } + if (constraint_obj->Package.Count != 3) { + device_printf(sc->dev, "Intel: Wrong package length " + "for constraint %zu's package.\n", i); + goto skip; + } + + name_obj = &constraint_obj->Package.Elements[0]; constraint->enabled = constraint_obj->Package.Elements[1].Integer.Value; + detail = &constraint_obj->Package.Elements[2]; - name_obj = &constraint_obj->Package.Elements[0]; - constraint->name = strdup(name_obj->String.Pointer, M_TEMP); + if (name_obj->Type != ACPI_TYPE_STRING) { + device_printf(sc->dev, + "Intel: Constraint %zu's name is not string.\n", i); + goto skip; + } + if (detail->Type != ACPI_TYPE_PACKAGE) { + device_printf(sc->dev, "Intel: Wrong element type for " + "constraint %zu's detail package.\n", i); + goto skip; + } + if (detail->Package.Count != 2) { + device_printf(sc->dev, "Intel: Wrong package length " + "for constraint %zu's detail package.\n", i); + goto skip; + } - detail = &constraint_obj->Package.Elements[2]; /* * The first element in the device constraint detail package is * the revision, and should always be zero. @@ -656,12 +681,24 @@ acpi_spmc_parse_constraints_intel(struct acpi_spmc_softc *sc, ACPI_OBJECT *objec "Intel: Unknown revision %d for " "constraint %zu's detail package\n", revision, i); - sc->constraint_count--; - continue; + goto skip; } constraint_package = &detail->Package.Elements[1]; + if (constraint_package->Type != ACPI_TYPE_PACKAGE) { + device_printf(sc->dev, "Intel: Wrong element type for " + "constraint %zu's constraint package.\n", i); + goto skip; + } + if (constraint_package->Package.Count != 3) { + device_printf(sc->dev, "Intel: Wrong package length " + "for constraint %zu's constraint package.\n", i); + goto skip; + } + + constraint->name = strdup(name_obj->String.Pointer, M_TEMP); + constraint->lpi_uid = constraint_package->Package.Elements[0].Integer.Value; constraint->min_d_state = @@ -670,6 +707,9 @@ acpi_spmc_parse_constraints_intel(struct acpi_spmc_softc *sc, ACPI_OBJECT *objec constraint_package->Package.Elements[2].Integer.Value; j++; + continue; +skip: + sc->constraint_count--; } return (0);