Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 9 Jan 2016 18:17:58 +0000 (UTC)
From:      Dmitry Chagin <dchagin@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r293603 - stable/10/sys/compat/linux
Message-ID:  <201601091817.u09IHwe0075178@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dchagin
Date: Sat Jan  9 18:17:58 2016
New Revision: 293603
URL: https://svnweb.freebsd.org/changeset/base/293603

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

Modified:
  stable/10/sys/compat/linux/linux_emul.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/compat/linux/linux_emul.c
==============================================================================
--- stable/10/sys/compat/linux/linux_emul.c	Sat Jan  9 18:16:36 2016	(r293602)
+++ stable/10/sys/compat/linux/linux_emul.c	Sat Jan  9 18:17:58 2016	(r293603)
@@ -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?201601091817.u09IHwe0075178>