From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 7B1AF4EDCB0; Wed, 30 Sep 2026 15:47:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790783266; cv=none; b=cVW5KQDuulVvi7RCwgZgRGDIzE1iGW0giqUB/E3+C3AbLDhkJiG1GXCqpq3/TSwEyzMSgkolqXD1PsTqeikey3JdsKSKY/dX6cr3imLq61pefUf8TR0AdmpUeSVLeeNEWMaWy/TRoFDzt37NnBD4zWwhWGr5PUHAWAROskU9aU0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790783266; c=relaxed/simple; bh=m8bSsSnQoaZ3t0Hh5i7Bi6MAvaFVbrTAJgwVdTLruDQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=O8Tq5pwJ1KrOSM5buvl8vv9ak5v/QEjsDO58K0Ix0hfjaD4k+FOlnOGgxgXpuw1DQU5cwNu8QCI0S9MJbCQpmhntQGTN8taNIxNlNnUdcJif/x+A/a9QXgbD7JOshSKYf7QOMkggwQrty9ZzeLQrPh6uSxjlE9M/GHYEz7KPVG8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=DwEgaxhf; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="DwEgaxhf" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1608C1F0089C; Wed, 30 Sep 2026 15:47:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1790783262; bh=rzuA1bmiT/MuuEr17/JrbSZuDQRS8SLcRqhmmZYp1o4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=DwEgaxhfjpu26i4/Xlzi+JBA6OWLSbLIiuoSI+0iLNeWkhHc12wavVp/nw1lH7dOS aeqafBvCEPiQEuQ9RIlv0lCjDxFMa8cRkWPFovJIk1J7C4uDPBMHv/swzhzDtME/+Z p4R311jgFRVsqKJXBgy8ZRMI3lQNcvmdd0od2/mo= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, "Yadi.hu" , Sebastian Andrzej Siewior , "Russell King (Oracle)" , Xie Yuanbin , Sasha Levin Subject: [PATCH 5.10 336/595] ARM: ensure interrupts are enabled in __do_user_fault() Date: Wed, 30 Sep 2026 17:23:49 +0200 Message-ID: <20260930152354.908472344@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260930152347.700140858@linuxfoundation.org> References: <20260930152347.700140858@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 5.10-stable review patch. If anyone has any objections, please let me know. ------------------ From: Russell King (Oracle) [ Upstream commit 59e4f3b45b96a24fc9b7a89e5f8a2168b30f95af ] __do_user_fault() may be called from fault handling paths where the interrupts are enabled or disabled. E.g. do_page_fault() calls this with interrupts enabled, whereas do_sect_fault()->do_bad_area() will call this with interrupts disabled. Since this is a userspace fault, we know that interrupts were enabled in the parent context, so call local_irq_enable() here to give a consistent interrupt state. This is necessary for force_sig_info() when PREEMPT_RT is enabled. Reported-by: Yadi.hu Reviewed-by: Sebastian Andrzej Siewior Signed-off-by: Russell King (Oracle) Signed-off-by: Xie Yuanbin Signed-off-by: Sasha Levin --- arch/arm/mm/fault.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c index b186a31b3cf72..7ac46e1b85a61 100644 --- a/arch/arm/mm/fault.c +++ b/arch/arm/mm/fault.c @@ -137,7 +137,8 @@ __do_kernel_fault(struct mm_struct *mm, unsigned long addr, unsigned int fsr, /* * Something tried to access memory that isn't in our memory map.. - * User mode accesses just cause a SIGSEGV + * User mode accesses just cause a SIGSEGV. Ensure interrupts are enabled + * for preempt RT. */ static void __do_user_fault(unsigned long addr, unsigned int fsr, unsigned int sig, @@ -145,6 +146,8 @@ __do_user_fault(unsigned long addr, unsigned int fsr, unsigned int sig, { struct task_struct *tsk = current; + local_irq_enable(); + #ifdef CONFIG_DEBUG_USER if (((user_debug & UDBG_SEGV) && (sig == SIGSEGV)) || ((user_debug & UDBG_BUS) && (sig == SIGBUS))) { @@ -254,6 +257,7 @@ do_kernel_address_page_fault(struct mm_struct *mm, unsigned long addr, * should not be faulting in kernel space, which includes the * vector/khelper page. Handle the branch predictor hardening * while interrupts are still disabled, then send a SIGSEGV. + * Note that __do_user_fault() will enable interrupts. */ harden_branch_predictor(); __do_user_fault(addr, fsr, SIGSEGV, SEGV_MAPERR, regs); -- 2.53.0