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 89E7C3218C0; Mon, 18 Aug 2025 12:55:33 +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=1755521733; cv=none; b=E/Z1mCdS4boCGjEQDyuLtUVjWErgTAAHZTjtOrJBgp2s4bcbWB0si1TSnoTPsLBmZCCM9zF3oZhLiYwEonfUOxTHzZVWDEUPa15TWmGgcrwEa4n++P2tulYxxxEFvddqBgMgPiA2373oEEbjSoWA3iSQ9zY1uHQru5MDx13CyPM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755521733; c=relaxed/simple; bh=/cgF0UROp3Bt+ibA0Z7JFLNtC/EZP/STlsL8HBdvAJI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=UzxbrGqu4yerT8nzZt663svFyj9kEaDaXNvB+diOWntVcUsL5jDmHEJ3IJcGtXRmWMUGe5g2KnOVhdqBLhtOHmhuIwH7wSB2+QGPeTe2Z4VjovKXNmpCVv1zvHr4KUGeBHQ1WehMgtxZS1fy3OtBKt1kWj5UP3jZnOjCiBRzenA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=J2YcPEGa; 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="J2YcPEGa" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 107ACC4CEEB; Mon, 18 Aug 2025 12:55:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1755521733; bh=/cgF0UROp3Bt+ibA0Z7JFLNtC/EZP/STlsL8HBdvAJI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=J2YcPEGamf/lyBTMChWPbLEVTzHpjCpqhm5ek4chSyJCIN5XFx1X11TjmaqypkTq4 WOPi4c7emsxHYcd1S6h2FQAbkClDTzoXbQaUE9SyHkVbCVcJiwV7+xoNbHrw2cmFlI eB8Q8HezkHIh6tV9/EOfPPCJEqB/ot4sDlv891js= 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.12 105/444] ACPI: APEI: send SIGBUS to current task if synchronous memory error not recovered Date: Mon, 18 Aug 2025 14:42:11 +0200 Message-ID: <20250818124452.875876270@linuxfoundation.org> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250818124448.879659024@linuxfoundation.org> References: <20250818124448.879659024@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.12-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 6cf40e8ac321..94e3d3fe11ae 100644 --- a/drivers/acpi/apei/ghes.c +++ b/drivers/acpi/apei/ghes.c @@ -799,6 +799,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