Skip to contentSkip to conversation

UML - Fix a signal race

PATCH New Jeff Dike 1 participant 1 message Sep 14, 2004 User-mode Linux (UML)

lore
Share & tools
lore

Jeff Dike

author
#0 lore raw

PATCH 1/1 UML - Fix a signal race

This patch saves and restores UML's idea of user mode across an interrupt. Without this, an interrupt arriving at the wrong time can cause UML to lose track of whether an interrupted handler is handing a userspace interrupt.

Quoted 1 line

From Ingo Molnar

arch/um/kernel/skas/trap_user.c +3 -0
Index: 2.6.9-rc2/arch/um/kernel/skas/trap_user.c
===================================================================
@@ -19,8 +19,10 @@
 	struct skas_regs *r;
 	struct signal_info *info;
 	int save_errno = errno;
+	int save_user;
 
 	r = &TASK_REGS(get_current())->skas;
+	save_user = r->is_user;
 	r->is_user = 0;
 	r->fault_addr = SC_FAULT_ADDR(sc);
 	r->fault_type = SC_FAULT_TYPE(sc);
@@ -33,6 +35,7 @@
 	(*info->handler)(sig, (union uml_pt_regs *) r);
 
 	errno = save_errno;
+	r->is_user = save_user;
 }
 
 void user_signal(int sig, union uml_pt_regs *regs)