Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ARM: ensure interrupts are enabled in __do_user_fault()

__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 <yadi.hu@windriver.com>
Reviewed-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>

+5 -1
+5 -1
arch/arm/mm/fault.c
··· 190 190 191 191 /* 192 192 * Something tried to access memory that isn't in our memory map.. 193 - * User mode accesses just cause a SIGSEGV 193 + * User mode accesses just cause a SIGSEGV. Ensure interrupts are enabled 194 + * for preempt RT. 194 195 */ 195 196 static void 196 197 __do_user_fault(unsigned long addr, unsigned int fsr, unsigned int sig, 197 198 int code, struct pt_regs *regs) 198 199 { 199 200 struct task_struct *tsk = current; 201 + 202 + local_irq_enable(); 200 203 201 204 #ifdef CONFIG_DEBUG_USER 202 205 if (((user_debug & UDBG_SEGV) && (sig == SIGSEGV)) || ··· 271 268 * should not be faulting in kernel space, which includes the 272 269 * vector/khelper page. Handle the branch predictor hardening 273 270 * while interrupts are still disabled, then send a SIGSEGV. 271 + * Note that __do_user_fault() will enable interrupts. 274 272 */ 275 273 harden_branch_predictor(); 276 274 __do_user_fault(addr, fsr, SIGSEGV, SEGV_MAPERR, regs);