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 0AB52335BA7; Mon, 18 Aug 2025 13:52:19 +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=1755525139; cv=none; b=VtdtD5w+JplZneEPf2aJ9x7IbKCcIecxpVoE/aabSXE8E1DunUWtjB6ALyx5fl5YRcMlE/nn1tNA7fNn3pVCTQVfArH1A/vqmtjK6UXmzZZjtaR5Ka5wp6su7x5Jt0rjjdk9lX3oRbF5iZ0TarQ+3LmdKRJHBsRlsR6uUIZ3DFQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755525139; c=relaxed/simple; bh=sZeAPqqVSGuDVFP+ULeKRMHp/U/XWU8XaHobUw1b1HY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jKMx/GKOEBWN3WGEi6IL5jW3gfkyVFP6tN+EJbyG0I6OQLY7binzROutw9t5Cb5xNIDQcUAY01zo1FjrTmXP9F7MysTh0jBPMLCYv9VJZZ1fEmczR7tgWID7nLGSrLwRn5/s5efyOhL27ZimC8vnDFBvma284nTrMEOpexS22YE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=O0jBfBzR; 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="O0jBfBzR" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 68CA8C113D0; Mon, 18 Aug 2025 13:52:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1755525138; bh=sZeAPqqVSGuDVFP+ULeKRMHp/U/XWU8XaHobUw1b1HY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=O0jBfBzRSIW34ktwXk8F40uV9ekRbYezXwVKcxiHMIZXMiMsLE350davvg3xu19OJ XBTgUMFxRCuuytGlivDRJ51Q2AU8gdDLu6poF60t5n1w7+n8ZppTAYgfzZ4BEt2uqF 2TOTyL0S6f+jm/ggvVltNsUKAig47vzjtzlwD7Ps= 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.16 138/570] ACPI: APEI: send SIGBUS to current task if synchronous memory error not recovered Date: Mon, 18 Aug 2025 14:42:05 +0200 Message-ID: <20250818124511.138074816@linuxfoundation.org> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250818124505.781598737@linuxfoundation.org> References: <20250818124505.781598737@linuxfoundation.org> User-Agent: quilt/0.68 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.16-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 f0584ccad451..281a0a2f6730 100644 --- a/drivers/acpi/apei/ghes.c +++ b/drivers/acpi/apei/ghes.c @@ -902,6 +902,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