patch-1.3.9 linux/kernel/exec_domain.c

Next file: linux/kernel/ksyms.c
Previous file: linux/kernel/Makefile
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v1.3.8/linux/kernel/exec_domain.c linux/kernel/exec_domain.c
@@ -28,6 +28,27 @@
 
 static asmlinkage void no_lcall7(struct pt_regs * regs)
 {
+
+  /*
+   * This may have been a static linked SVr4 binary, so we would have the
+   * personality set incorrectly.  Check to see whether SVr4 is available,
+   * and use it, otherwise give the user a SEGV.
+   */
+	if (current->exec_domain && current->exec_domain->use_count)
+		(*current->exec_domain->use_count)--;
+
+	current->personality = PER_SVR4;
+	current->exec_domain = lookup_exec_domain(current->personality);
+
+	if (current->exec_domain && current->exec_domain->use_count)
+		(*current->exec_domain->use_count)++;
+
+	if (current->exec_domain && current->exec_domain->handler
+	&& current->exec_domain->handler != no_lcall7) {
+		current->exec_domain->handler(regs);
+		return;
+	}
+
 	send_sig(SIGSEGV, current, 1);
 }
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov with Sam's (original) version
of this