From owner-svn-src-stable@FreeBSD.ORG Fri Dec 30 20:21:54 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4ABBE106566C; Fri, 30 Dec 2011 20:21:54 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 38DA58FC12; Fri, 30 Dec 2011 20:21:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pBUKLsnh028783; Fri, 30 Dec 2011 20:21:54 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pBUKLsXY028781; Fri, 30 Dec 2011 20:21:54 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201112302021.pBUKLsXY028781@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 30 Dec 2011 20:21:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229021 - stable/9/sys/fs/procfs X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2011 20:21:54 -0000 Author: kib Date: Fri Dec 30 20:21:53 2011 New Revision: 229021 URL: http://svn.freebsd.org/changeset/base/229021 Log: MFC r227393: Lock the thread lock around block that retrieves td_wmesg. Otherwise, procfs could see a thread with assigned td_wchan but still NULL td_wmesg. Modified: stable/9/sys/fs/procfs/procfs_status.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/fs/procfs/procfs_status.c ============================================================================== --- stable/9/sys/fs/procfs/procfs_status.c Fri Dec 30 20:12:50 2011 (r229020) +++ stable/9/sys/fs/procfs/procfs_status.c Fri Dec 30 20:21:53 2011 (r229021) @@ -113,12 +113,14 @@ procfs_doprocstatus(PFS_FILL_ARGS) } tdfirst = FIRST_THREAD_IN_PROC(p); + thread_lock(tdfirst); if (tdfirst->td_wchan != NULL) { KASSERT(tdfirst->td_wmesg != NULL, ("wchan %p has no wmesg", tdfirst->td_wchan)); wmesg = tdfirst->td_wmesg; } else wmesg = "nochan"; + thread_unlock(tdfirst); if (p->p_flag & P_INMEM) { struct timeval start, ut, st;