From owner-svn-src-all@FreeBSD.ORG Tue Oct 28 17:01:17 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4348B106566B; Tue, 28 Oct 2008 17:01:17 +0000 (UTC) (envelope-from csjp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 32AE78FC08; Tue, 28 Oct 2008 17:01:17 +0000 (UTC) (envelope-from csjp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9SH1HJo099159; Tue, 28 Oct 2008 17:01:17 GMT (envelope-from csjp@svn.freebsd.org) Received: (from csjp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9SH1H89099158; Tue, 28 Oct 2008 17:01:17 GMT (envelope-from csjp@svn.freebsd.org) Message-Id: <200810281701.m9SH1H89099158@svn.freebsd.org> From: "Christian S.J. Peron" Date: Tue, 28 Oct 2008 17:01:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184417 - in stable/7/sys: . kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Oct 2008 17:01:17 -0000 Author: csjp Date: Tue Oct 28 17:01:16 2008 New Revision: 184417 URL: http://svn.freebsd.org/changeset/base/184417 Log: MFC SVN rev 181647 - Reduce the scope of the vnode lock such that it does not cover the various copyouts associated with initializing the process's argv/env data in userspace. It is possible that these copyout operations can fault under memory pressure, possibly resulting in dead locks. Approved by: re@ (kib) Modified: stable/7/sys/ (props changed) stable/7/sys/kern/kern_exec.c Modified: stable/7/sys/kern/kern_exec.c ============================================================================== --- stable/7/sys/kern/kern_exec.c Tue Oct 28 15:17:59 2008 (r184416) +++ stable/7/sys/kern/kern_exec.c Tue Oct 28 17:01:16 2008 (r184417) @@ -476,6 +476,11 @@ interpret: } /* + * NB: We unlock the vnode here because it is believed that none + * of the sv_copyout_strings/sv_fixup operations require the vnode. + */ + VOP_UNLOCK(imgp->vp, 0, td); + /* * Copy out strings (args and env) and initialize stack base */ if (p->p_sysent->sv_copyout_strings) @@ -512,7 +517,6 @@ interpret: } /* close files on exec */ - VOP_UNLOCK(imgp->vp, 0, td); fdcloseexec(td); vn_lock(imgp->vp, LK_EXCLUSIVE | LK_RETRY, td);