Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 17 Mar 2017 13:37:37 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r315453 - head/sys/kern
Message-ID:  <201703171337.v2HDbbqn050402@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Fri Mar 17 13:37:37 2017
New Revision: 315453
URL: https://svnweb.freebsd.org/changeset/base/315453

Log:
  When clearing altsigstack settings on exec, do it to the right thread.
  
  Diagnosed by:	smh
  Sponsored by:	The FreeBSD Foundation
  MFC after:	1 week

Modified:
  head/sys/kern/kern_sig.c

Modified: head/sys/kern/kern_sig.c
==============================================================================
--- head/sys/kern/kern_sig.c	Fri Mar 17 13:31:24 2017	(r315452)
+++ head/sys/kern/kern_sig.c	Fri Mar 17 13:37:37 2017	(r315453)
@@ -976,7 +976,6 @@ execsigs(struct proc *p)
 	 * and are now ignored by default).
 	 */
 	PROC_LOCK_ASSERT(p, MA_OWNED);
-	td = FIRST_THREAD_IN_PROC(p);
 	ps = p->p_sigacts;
 	mtx_lock(&ps->ps_mtx);
 	while (SIGNOTEMPTY(ps->ps_sigcatch)) {
@@ -1007,6 +1006,8 @@ execsigs(struct proc *p)
 	 * Reset stack state to the user stack.
 	 * Clear set of signals caught on the signal stack.
 	 */
+	td = curthread;
+	MPASS(td->td_proc == p);
 	td->td_sigstk.ss_flags = SS_DISABLE;
 	td->td_sigstk.ss_size = 0;
 	td->td_sigstk.ss_sp = 0;



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