Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 6 Jun 2015 06:12:15 +0000 (UTC)
From:      Dmitry Chagin <dchagin@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r284051 - head/sys/compat/linux
Message-ID:  <201506060612.t566CF50026492@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dchagin
Date: Sat Jun  6 06:12:14 2015
New Revision: 284051
URL: https://svnweb.freebsd.org/changeset/base/284051

Log:
  Finish r283544. In exec case properly detach threads from user space
  before suicide.

Modified:
  head/sys/compat/linux/linux_emul.c

Modified: head/sys/compat/linux/linux_emul.c
==============================================================================
--- head/sys/compat/linux/linux_emul.c	Sat Jun  6 01:18:28 2015	(r284050)
+++ head/sys/compat/linux/linux_emul.c	Sat Jun  6 06:12:14 2015	(r284051)
@@ -219,6 +219,18 @@ void 
 linux_proc_exec(void *arg __unused, struct proc *p, struct image_params *imgp)
 {
 	struct thread *td = curthread;
+	struct thread *othertd;
+
+	/*
+	 * In a case of execing from linux binary properly detach
+	 * other threads from the user space.
+	 */
+	if (__predict_false(SV_PROC_ABI(p) == SV_ABI_LINUX)) {
+		FOREACH_THREAD_IN_PROC(p, othertd) {
+			if (td != othertd)
+				(p->p_sysent->sv_thread_detach)(othertd);
+		}
+	}
 
 	/*
 	 * In a case of execing to linux binary we create linux



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201506060612.t566CF50026492>