From owner-p4-projects@FreeBSD.ORG Sat Aug 5 03:14:54 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id EEF9D16A4E0; Sat, 5 Aug 2006 03:14:53 +0000 (UTC) X-Original-To: perforce@freebsd.org 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 AFF6216A4DD for ; Sat, 5 Aug 2006 03:14:53 +0000 (UTC) (envelope-from jb@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5B73343D45 for ; Sat, 5 Aug 2006 03:14:53 +0000 (GMT) (envelope-from jb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k753ErPv095358 for ; Sat, 5 Aug 2006 03:14:53 GMT (envelope-from jb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k753ErMm095355 for perforce@freebsd.org; Sat, 5 Aug 2006 03:14:53 GMT (envelope-from jb@freebsd.org) Date: Sat, 5 Aug 2006 03:14:53 GMT Message-Id: <200608050314.k753ErMm095355@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jb@freebsd.org using -f From: John Birrell To: Perforce Change Reviews Cc: Subject: PERFORCE change 103221 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Aug 2006 03:14:54 -0000 http://perforce.freebsd.org/chv.cgi?CH=103221 Change 103221 by jb@jb_freebsd2 on 2006/08/05 03:14:16 Sync to current. (Not sure why the IFCs didn't pick these changes up.) Affected files ... .. //depot/projects/dtrace/src/sys/kern/kern_sysctl.c#4 edit Differences ... ==== //depot/projects/dtrace/src/sys/kern/kern_sysctl.c#4 (text+ko) ==== @@ -1225,25 +1225,19 @@ if (error) return (error); - if ((oid->oid_kind & CTLFLAG_MPSAFE) == 0) - mtx_lock(&Giant); if ((oid->oid_kind & CTLTYPE) == CTLTYPE_NODE) { /* * You can't call a sysctl when it's a node, but has * no handler. Inform the user that it's a node. * The indx may or may not be the same as namelen. */ - if (oid->oid_handler == NULL) { - error = EISDIR; - goto done; - } + if (oid->oid_handler == NULL) + return (EISDIR); } /* Is this sysctl writable? */ - if (req->newptr && !(oid->oid_kind & CTLFLAG_WR)) { - error = EPERM; - goto done; - } + if (req->newptr && !(oid->oid_kind & CTLFLAG_WR)) + return (EPERM); KASSERT(req->td != NULL, ("sysctl_root(): req->td == NULL")); @@ -1252,7 +1246,7 @@ lvl = (oid->oid_kind & CTLMASK_SECURE) >> CTLSHIFT_SECURE; error = securelevel_gt(req->td->td_ucred, lvl); if (error) - goto done; + return (error); } /* Is this sysctl writable by only privileged users? */ @@ -1265,13 +1259,11 @@ flags = 0; error = suser_cred(req->td->td_ucred, flags); if (error) - goto done; + return (error); } - if (!oid->oid_handler) { - error = EINVAL; - goto done; - } + if (!oid->oid_handler) + return (EINVAL); if ((oid->oid_kind & CTLTYPE) == CTLTYPE_NODE) { arg1 = (int *)arg1 + indx; @@ -1284,12 +1276,10 @@ error = mac_check_system_sysctl(req->td->td_ucred, oid, arg1, arg2, req); if (error != 0) - goto done; + return (error); #endif error = oid->oid_handler(oid, arg1, arg2, req); -done: - if ((oid->oid_kind & CTLFLAG_MPSAFE) == 0) - mtx_unlock(&Giant); + return (error); } @@ -1320,6 +1310,8 @@ if (error) return (error); + mtx_lock(&Giant); + error = userland_sysctl(td, name, uap->namelen, uap->old, uap->oldlenp, 0, uap->new, uap->newlen, &j, 0); @@ -1331,6 +1323,7 @@ error = i; } done2: + mtx_unlock(&Giant); return (error); }