From owner-p4-projects@FreeBSD.ORG Thu Feb 26 11:12:39 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 6861A16A4D0; Thu, 26 Feb 2004 11:12:39 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 42BB516A4CE for ; Thu, 26 Feb 2004 11:12:39 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3E19543D1D for ; Thu, 26 Feb 2004 11:12:39 -0800 (PST) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i1QJCdGe070162 for ; Thu, 26 Feb 2004 11:12:39 -0800 (PST) (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i1QJCcrG070159 for perforce@freebsd.org; Thu, 26 Feb 2004 11:12:38 -0800 (PST) (envelope-from jhb@freebsd.org) Date: Thu, 26 Feb 2004 11:12:38 -0800 (PST) Message-Id: <200402261912.i1QJCcrG070159@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jhb@freebsd.org using -f From: John Baldwin To: Perforce Change Reviews Subject: PERFORCE change 47703 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Feb 2004 19:12:39 -0000 http://perforce.freebsd.org/chv.cgi?CH=47703 Change 47703 by jhb@jhb_slimer on 2004/02/26 11:12:06 After talking with Robert, re-sync exec'ing thread credentials with process credentials rather than vice versa. Affected files ... .. //depot/projects/smpng/sys/kern/kern_exec.c#66 edit .. //depot/projects/smpng/sys/notes#9 edit Differences ... ==== //depot/projects/smpng/sys/kern/kern_exec.c#66 (text+ko) ==== @@ -223,7 +223,7 @@ { struct proc *p = td->td_proc; struct nameidata nd, *ndp; - struct ucred *newcred = NULL, *oldcred; + struct ucred *newcred = NULL, *oldcred = NULL; struct uidinfo *euip; register_t *stack_base; int error, len, i; @@ -269,12 +269,14 @@ td->td_mailbox = NULL; thread_single_end(); if (td->td_ucred != p->p_ucred) { - crfree(p->p_ucred); - p->p_ucred = crhold(td->td_ucred); + oldcred = td->td_ucred; + td->td_ucred = crhold(p->p_ucred); } } p->p_flag |= P_INEXEC; PROC_UNLOCK(p); + if (oldcred != NULL) + crfree(oldcred); /* * Initialize part of the common data ==== //depot/projects/smpng/sys/notes#9 (text+ko) ==== @@ -26,10 +26,9 @@ - Untested - Fixup asm constraints for i386/isa/bs/bsif.h - Untested -- Fixup p_ucred to use the ucred of the thread doing the actual execve() - during an exec. This change is actually split across the jhb_proc and - smpng branches. - - Untested, also not sure if this is strictly correct. +- Fixup td_ucred of thread doing execve() to re-sync with process ucred + after single threading during an exec. + - Untested - Move lock checks and enabling of an ithread's interrupt source earlier in ithread_loop(). - Tested only on my laptop