From owner-freebsd-bugs@FreeBSD.ORG Wed May 9 05:10:08 2012 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 590771065670 for ; Wed, 9 May 2012 05:10:08 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 133D58FC12 for ; Wed, 9 May 2012 05:10:08 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q495A7P2099962 for ; Wed, 9 May 2012 05:10:07 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q495A7Kl099961; Wed, 9 May 2012 05:10:07 GMT (envelope-from gnats) Resent-Date: Wed, 9 May 2012 05:10:07 GMT Resent-Message-Id: <201205090510.q495A7Kl099961@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Jinjun Gao Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 72B97106564A for ; Wed, 9 May 2012 05:06:39 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id 5DF778FC0A for ; Wed, 9 May 2012 05:06:39 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.4/8.14.4) with ESMTP id q4956dtX004767 for ; Wed, 9 May 2012 05:06:39 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.4/8.14.4/Submit) id q4956dvV004766; Wed, 9 May 2012 05:06:39 GMT (envelope-from nobody) Message-Id: <201205090506.q4956dvV004766@red.freebsd.org> Date: Wed, 9 May 2012 05:06:39 GMT From: Jinjun Gao To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: kern/167727: may missing PROC_UNLOCK() in kproc_suspend() of kern_kthread.c X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 May 2012 05:10:08 -0000 >Number: 167727 >Category: kern >Synopsis: may missing PROC_UNLOCK() in kproc_suspend() of kern_kthread.c >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed May 09 05:10:07 UTC 2012 >Closed-Date: >Last-Modified: >Originator: Jinjun Gao >Release: 7-release >Organization: >Environment: FreeBSD 7.0-RELEASE FreeBSD 7-RELEASE #0: Sun Feb 24 10:35:36 UTC 2008 root@driscoll.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC amd64 >Description: In kernel's thread suspend code, maybe miss PROC_UNLOCK call. kernel code: sys/kern/kern_kthread.c ... /* * Advise a kernel process to suspend (or resume) in its main loop. * Participation is voluntary. */ int kproc_suspend(struct proc *p, int timo) { /* * Make sure this is indeed a system process and we can safely * use the p_siglist field. */ PROC_LOCK(p); if ((p->p_flag & P_KTHREAD) == 0) { PROC_UNLOCK(p); return (EINVAL); } SIGADDSET(p->p_siglist, SIGSTOP); wakeup(p); return msleep(&p->p_siglist, &p->p_mtx, PPAUSE | PDROP, "suspkp", timo); } We should add PROC_UNLOCK(p) after SIGADDSET(p->p_siglist, SIGSTOP). >How-To-Repeat: You can find these code at kernel source code. >Fix: add PROC_UNLOCK(p) after SIGADDSET(p->p_siglist, SIGSTOP); >Release-Note: >Audit-Trail: >Unformatted: