From mboxrd@z Thu Jan 1 00:00:00 1970 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 7A58A206F23; Tue, 26 Aug 2025 12:54:04 +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=1756212844; cv=none; b=a90tHeBUco0o6MDoQLGv6lBPbAGCj/J5fQO/6ZM2t6goU1zfaz+LWY+SWFzn4thYoybn7bmIKKHcDb8i7BngCfq5gOd2MR8Z4/UdRU7NBiKmy9N3VzbptT1g57JM41JE//2c5Ni1HUEAJwTde8VkMBZhn5uUh6uk3Ymm51K6nBs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756212844; c=relaxed/simple; bh=kftSc76U4+CRwj4G0R2HLC2tzQ52s+2dbiRmbNa6liE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=p9FwyrpD+O7ueNN3m7vFgWel0dAmcdOFFma838i8k2z44WKFq0hNuabAxpGCLsP481Kc4rk2uwS+GIg7DaqMH+UmRBBb1cNQgN1OV8RQsN0HCmyo58rebtecnniyOR9zuapvy+2bT5LD4yEGxZSgBepCRoRiirZL+Z+nlsoNPZE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=upRS4KF0; 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="upRS4KF0" Received: by smtp.kernel.org (Postfix) with ESMTPSA id DEE9BC113CF; Tue, 26 Aug 2025 12:54:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1756212844; bh=kftSc76U4+CRwj4G0R2HLC2tzQ52s+2dbiRmbNa6liE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=upRS4KF00wUgVy8a85+DHeZiRwgT1jKuh0QjCqY25LQdAAQANy6udON+NzQxTG4th G699AXvrD91meETFgUb8rbDqqCTzws0kuTp6pEGERmplqqk1/mUcuX4xk6AC1TfgGc 3zt8foKX5G32RU+Bn3pvHaMsRGudCygvENJLmZ+M= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Shuai Xue , Jarkko Sakkinen , Jonathan Cameron , Yazen Ghannam , Jane Chu , Hanjun Guo , "Rafael J. Wysocki" , Sasha Levin Subject: [PATCH 6.6 092/587] ACPI: APEI: send SIGBUS to current task if synchronous memory error not recovered Date: Tue, 26 Aug 2025 13:04:01 +0200 Message-ID: <20250826110955.277208963@linuxfoundation.org> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250826110952.942403671@linuxfoundation.org> References: <20250826110952.942403671@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org 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: Shuai Xue [ Upstream commit 79a5ae3c4c5eb7e38e0ebe4d6bf602d296080060 ] If a synchronous error is detected as a result of user-space process triggering a 2-bit uncorrected error, the CPU will take a synchronous error exception such as Synchronous External Abort (SEA) on Arm64. The kernel will queue a memory_failure() work which poisons the related page, unmaps the page, and then sends a SIGBUS to the process, so that a system wide panic can be avoided. However, no memory_failure() work will be queued when abnormal synchronous errors occur. These errors can include situations like invalid PA, unexpected severity, no memory failure config support, invalid GUID section, etc. In such a case, the user-space process will trigger SEA again. This loop can potentially exceed the platform firmware threshold or even trigger a kernel hard lockup, leading to a system reboot. Fix it by performing a force kill if no memory_failure() work is queued for synchronous errors. Signed-off-by: Shuai Xue Reviewed-by: Jarkko Sakkinen Reviewed-by: Jonathan Cameron Reviewed-by: Yazen Ghannam Reviewed-by: Jane Chu Reviewed-by: Hanjun Guo Link: https://patch.msgid.link/20250714114212.31660-2-xueshuai@linux.alibaba.com [ rjw: Changelog edits ] Signed-off-by: Rafael J. Wysocki Signed-off-by: Sasha Levin --- drivers/acpi/apei/ghes.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c index 2abf20736702..22db720b128b 100644 --- a/drivers/acpi/apei/ghes.c +++ b/drivers/acpi/apei/ghes.c @@ -715,6 +715,17 @@ static bool ghes_do_proc(struct ghes *ghes, } } + /* + * If no memory failure work is queued for abnormal synchronous + * errors, do a force kill. + */ + if (sync && !queued) { + dev_err(ghes->dev, + HW_ERR GHES_PFX "%s:%d: synchronous unrecoverable error (SIGBUS)\n", + current->comm, task_pid_nr(current)); + force_sig(SIGBUS); + } + return queued; } -- 2.39.5