Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 385F83B8BA4; Mon, 23 Mar 2026 15:21:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774279291; cv=none; b=uxy/4a81CMlCSzVJ9oLrnPbIo0/HXuuU0qjwwM/QKHyKfm3yDMJXkwWxVDBfuD/2DKuXwRV+qydqM7MdzmwqgL6v4dLFAPcc9EYChF5krkbBf6qjNYNZY9BCuOetjWURJE8Jl+qaoubMmNcX4ykfeiv31iburYOobZa++Vk5Iqg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774279291; c=relaxed/simple; bh=jdLC6YuO8fOq/YYALT0DQtrmaqGYkcFtR2u1wz9Tv+Y=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=EBcQr9SBkQ0zFjRnxcIiUL4SFlpNiad87UawTq0mWpzSzVDyrvQKN2ec/YeCU5PdrIbRlKHKyNLf616NdBHV0BLLroaPwOcCXsPEUA5Hi4RHvRoCLByBvxt3aXP2MTkcHoCJ1L3vNFyLRcXmcMunxEabRGMACFL27OqxU9ztecc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=lnl8o8OZ; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="lnl8o8OZ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B37BFC2BCB1; Mon, 23 Mar 2026 15:21:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1774279291; bh=jdLC6YuO8fOq/YYALT0DQtrmaqGYkcFtR2u1wz9Tv+Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lnl8o8OZKLUIVjwKSln60lNL3J+4VZ7InZWSbh4B6dvnVg4av33TuJ9uP3rxOE6Nd UDDlNW7/yNiwUy230uLPGUj5++7pJJFff2IKlU9gVIXJ7Ai0eC0cIqGVPoyMsa9R6U j77T7P9yt0fq/M+CnhQnrE1CRzhg0/VHY88X/7Ok= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Guenter Roeck , "Rafael J. Wysocki" , Sasha Levin Subject: [PATCH 6.6 536/567] ACPI: processor: Fix previous acpi_processor_errata_piix4() fix Date: Mon, 23 Mar 2026 14:47:36 +0100 Message-ID: <20260323134547.264581110@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260323134533.749096647@linuxfoundation.org> References: <20260323134533.749096647@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Rafael J. Wysocki [ Upstream commit bf504b229cb8d534eccbaeaa23eba34c05131e25 ] After commi f132e089fe89 ("ACPI: processor: Fix NULL-pointer dereference in acpi_processor_errata_piix4()"), device pointers may be dereferenced after dropping references to the device objects pointed to by them, which may cause a use-after-free to occur. Moreover, debug messages about enabling the errata may be printed if the errata flags corresponding to them are unset. Address all of these issues by moving message printing to the points in the code where the errata flags are set. Fixes: f132e089fe89 ("ACPI: processor: Fix NULL-pointer dereference in acpi_processor_errata_piix4()") Reported-by: Guenter Roeck Closes: https://lore.kernel.org/linux-acpi/938e2206-def5-4b7a-9b2c-d1fd37681d8a@roeck-us.net/ Reviewed-by: Guenter Roeck Signed-off-by: Rafael J. Wysocki Link: https://patch.msgid.link/5975693.DvuYhMxLoT@rafael.j.wysocki Signed-off-by: Sasha Levin --- drivers/acpi/acpi_processor.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/drivers/acpi/acpi_processor.c b/drivers/acpi/acpi_processor.c index 5e409f86f0709..55f0ea3535055 100644 --- a/drivers/acpi/acpi_processor.c +++ b/drivers/acpi/acpi_processor.c @@ -102,6 +102,10 @@ static int acpi_processor_errata_piix4(struct pci_dev *dev) PCI_ANY_ID, PCI_ANY_ID, NULL); if (ide_dev) { errata.piix4.bmisx = pci_resource_start(ide_dev, 4); + if (errata.piix4.bmisx) + dev_dbg(&ide_dev->dev, + "Bus master activity detection (BM-IDE) erratum enabled\n"); + pci_dev_put(ide_dev); } @@ -120,20 +124,17 @@ static int acpi_processor_errata_piix4(struct pci_dev *dev) if (isa_dev) { pci_read_config_byte(isa_dev, 0x76, &value1); pci_read_config_byte(isa_dev, 0x77, &value2); - if ((value1 & 0x80) || (value2 & 0x80)) + if ((value1 & 0x80) || (value2 & 0x80)) { errata.piix4.fdma = 1; + dev_dbg(&isa_dev->dev, + "Type-F DMA livelock erratum (C3 disabled)\n"); + } pci_dev_put(isa_dev); } break; } - if (ide_dev) - dev_dbg(&ide_dev->dev, "Bus master activity detection (BM-IDE) erratum enabled\n"); - - if (isa_dev) - dev_dbg(&isa_dev->dev, "Type-F DMA livelock erratum (C3 disabled)\n"); - return 0; } -- 2.51.0