From owner-svn-src-head@freebsd.org Tue Jul 12 03:52:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E4174B923EC; Tue, 12 Jul 2016 03:52:06 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ACF771F2A; Tue, 12 Jul 2016 03:52:06 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6C3q5p7027207; Tue, 12 Jul 2016 03:52:05 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6C3q567027206; Tue, 12 Jul 2016 03:52:05 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201607120352.u6C3q567027206@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 12 Jul 2016 03:52:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302613 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jul 2016 03:52:07 -0000 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); }