Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 12 Jul 2016 03:52:05 +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: r302613 - head/sys/kern
Message-ID:  <201607120352.u6C3q567027206@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Tue Jul 12 03:52:05 2016
New Revision: 302613
URL: https://svnweb.freebsd.org/changeset/base/302613

Log:
  Add assert to complement r302328.
  
  AST must not execute with TDF_SBDRY or TDF_SEINTR/TDF_SERESTART thread
  flags set, which is asserted in userret(). As the consequence, -1 return
  from cursig() must not be possible.
  
  Tested by:	pho
  Sponsored by:	The FreeBSD Foundation
  MFC after:	1 week

Modified:
  head/sys/kern/subr_trap.c

Modified: head/sys/kern/subr_trap.c
==============================================================================
--- head/sys/kern/subr_trap.c	Tue Jul 12 03:38:29 2016	(r302612)
+++ head/sys/kern/subr_trap.c	Tue Jul 12 03:52:05 2016	(r302613)
@@ -274,8 +274,10 @@ ast(struct trapframe *framep)
 	    !SIGISEMPTY(p->p_siglist)) {
 		PROC_LOCK(p);
 		mtx_lock(&p->p_sigacts->ps_mtx);
-		while ((sig = cursig(td)) != 0)
+		while ((sig = cursig(td)) != 0) {
+			KASSERT(sig >= 0, ("sig %d", sig));
 			postsig(sig);
+		}
 		mtx_unlock(&p->p_sigacts->ps_mtx);
 		PROC_UNLOCK(p);
 	}



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