From owner-p4-projects@FreeBSD.ORG Mon Oct 19 15:23:55 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 9CC921065672; Mon, 19 Oct 2009 15:23:55 +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 61356106566C for ; Mon, 19 Oct 2009 15:23:55 +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 4DB0C8FC17 for ; Mon, 19 Oct 2009 15:23:55 +0000 (UTC) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n9JFNsod075303 for ; Mon, 19 Oct 2009 15:23:54 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n9JFNseu075301 for perforce@freebsd.org; Mon, 19 Oct 2009 15:23:54 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Mon, 19 Oct 2009 15:23:54 GMT Message-Id: <200910191523.n9JFNseu075301@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 Precedence: bulk Cc: Subject: PERFORCE change 169596 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2009 15:23:55 -0000 http://p4web.freebsd.org/chv.cgi?CH=169596 Change 169596 by rwatson@rwatson_vimage_client on 2009/10/19 15:23:30 amd64 also requires capability mode checks. Affected files ... .. //depot/projects/trustedbsd/capabilities/src/sys/amd64/amd64/trap.c#7 edit Differences ... ==== //depot/projects/trustedbsd/capabilities/src/sys/amd64/amd64/trap.c#7 (text+ko) ==== @@ -44,6 +44,7 @@ * AMD64 Trap and System call handling */ +#include "opt_capabilities.h" #include "opt_clock.h" #include "opt_cpu.h" #include "opt_hwpmc_hooks.h" @@ -68,6 +69,7 @@ #include #include #include +#include #include #include #ifdef KTRACE @@ -969,6 +971,18 @@ td->td_syscalls++; +#ifdef CAPABILITIES + /* + * In capabilities mode, we only allow access to system calls flagged + * SYF_CAPENABLED. + */ + if (error == 0) { + if (!(callp->sy_flags & SYF_CAPENABLED) && + (td->td_ucred->cr_flags & CRED_FLAG_CAPMODE)) + error = ENOSYS; + } +#endif + if (error == 0) { td->td_retval[0] = 0; td->td_retval[1] = frame->tf_rdx;