From owner-p4-projects@FreeBSD.ORG Sun Aug 24 20:50:30 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 9993D1065683; Sun, 24 Aug 2008 20:50:30 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5D42F1065681 for ; Sun, 24 Aug 2008 20:50:30 +0000 (UTC) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 5E67D8FC0C for ; Sun, 24 Aug 2008 20:50:30 +0000 (UTC) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.2/8.14.2) with ESMTP id m7OKoUuv064837 for ; Sun, 24 Aug 2008 20:50:30 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.2/8.14.1/Submit) id m7OKoUw1064835 for perforce@freebsd.org; Sun, 24 Aug 2008 20:50:30 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Sun, 24 Aug 2008 20:50:30 GMT Message-Id: <200808242050.m7OKoUw1064835@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Cc: Subject: PERFORCE change 148281 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: Sun, 24 Aug 2008 20:50:30 -0000 http://perforce.freebsd.org/chv.cgi?CH=148281 Change 148281 by rwatson@rwatson_freebsd_capabilities on 2008/08/24 20:50:22 Don't allow setuid/setgid/MAC transition in capability mode for reasons of conservatism; comment on this. Affected files ... .. //depot/projects/trustedbsd/capabilities/src/sys/kern/kern_exec.c#12 edit Differences ... ==== //depot/projects/trustedbsd/capabilities/src/sys/kern/kern_exec.c#12 (text+ko) ==== @@ -631,6 +631,13 @@ * Don't honor setuid/setgid if the filesystem prohibits it or if * the process is being traced. * + * We disable setuid/setgid/etc in capability mode on the basis that + * most setugid applications are not written with that environment in + * mind, and will therefore almost certainly operate incorrectly. In + * principle there's no reason that setugid applications might not be + * useful in capability mode, so we may want to reconsider this + * conservative design choice in the future. + * * XXXMAC: For the time being, use NOSUID to also prohibit * transitions on the file system. */ @@ -647,6 +654,7 @@ #endif if (credential_changing && + (oldcred->cr_flags & CRED_FLAG_CAPMODE) == 0 && (imgp->vp->v_mount->mnt_flag & MNT_NOSUID) == 0 && (p->p_flag & P_TRACED) == 0) { /*