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 A2C75322769; Mon, 18 Aug 2025 13:21:26 +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=1755523286; cv=none; b=rC2R2AentOO5dUS8ZCBfs9shTR9RgBfE9vORGK8t9gExSsZwDtl2ajPYr72txpPkKffJd6bpFerxfqvaszDJv0a+HH/viiWzERXgeXuY1zRIxFspIyCnG8yVQPhihrcrwwSZVcase+40XHO20FTQWCuWJLWjO0OSBXxxyJq5Jvo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755523286; c=relaxed/simple; bh=SvyoVHezy36cHOFZRzShHs2KtLEkkP4Px5ujm4DwHlU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=i1D4WPowcGkX9t4GX9gBQHSR+m8lyUFebrruXQwbLWu9Bpg7FLxkxKDaNKyzON9zRVkn3KuBZNHUQ5OWlpri2+6Uw9gkZ8B9zFHd0Nj1Y7rZ58RZnUgj5ozF4CEGTPLl0tZlEebJuzYHMVLNBCIuXShEDJfZ/0BJElLEBtRGJzM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=uNkwvd0+; 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="uNkwvd0+" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D236CC4CEEB; Mon, 18 Aug 2025 13:21:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1755523286; bh=SvyoVHezy36cHOFZRzShHs2KtLEkkP4Px5ujm4DwHlU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uNkwvd0+tEuWLOprQTFY391xNHb/QLNF3gAY/ox4JxxhDcEBp3LhMbwCJxaysChuQ xRQ9BDQfLT2n5LkbNeTU2JagCKN4Duev8HGlwXcmbDcslGV4R0jUYrInqqXxAaG0TP /8I6zYMrsTlNsfAQ7ou8Bjg01VtE6j1SgekLQXKc= 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.15 125/515] ACPI: APEI: send SIGBUS to current task if synchronous memory error not recovered Date: Mon, 18 Aug 2025 14:41:51 +0200 Message-ID: <20250818124503.193319907@linuxfoundation.org> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250818124458.334548733@linuxfoundation.org> References: <20250818124458.334548733@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.15-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 0f3c663c1b0a..fe9bd27367ee 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