From owner-p4-projects@FreeBSD.ORG Mon Aug 25 01:45:42 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id E45E41065679; Mon, 25 Aug 2008 01:45:41 +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 A8837106564A for ; Mon, 25 Aug 2008 01:45:41 +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 B619B8FC15 for ; Mon, 25 Aug 2008 01:45:41 +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 m7P1jf7a007756 for ; Mon, 25 Aug 2008 01:45:41 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 m7P1jfSs007754 for perforce@freebsd.org; Mon, 25 Aug 2008 01:45:41 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Mon, 25 Aug 2008 01:45:41 GMT Message-Id: <200808250145.m7P1jfSs007754@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 148315 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: Mon, 25 Aug 2008 01:45:42 -0000 http://perforce.freebsd.org/chv.cgi?CH=148315 Change 148315 by rwatson@rwatson_freebsd_capabilities on 2008/08/25 01:45:26 Audit extended file descriptor information for cap_new(2) so that we see information on the underlying object a capability is created for in the audit trail. Right now the utility functions in audit_bsm.c doesn't properly capture all of this in the BSM trail, which needs to be fixed. Affected files ... .. //depot/projects/trustedbsd/capabilities/src/sys/kern/sys_capability.c#20 edit .. //depot/projects/trustedbsd/capabilities/src/sys/security/audit/audit_bsm.c#6 edit Differences ... ==== //depot/projects/trustedbsd/capabilities/src/sys/kern/sys_capability.c#20 (text+ko) ==== @@ -50,7 +50,7 @@ #include "opt_capabilities.h" #include -__FBSDID("$P4: //depot/projects/trustedbsd/capabilities/src/sys/kern/sys_capability.c#19 $"); +__FBSDID("$P4: //depot/projects/trustedbsd/capabilities/src/sys/kern/sys_capability.c#20 $"); #include #include @@ -246,6 +246,8 @@ if (error) goto fail; + AUDIT_ARG(file, td->td_proc, fp); + /* * If a new capability is being derived from an existing capability, * then the new capability rights must be a subset of the existing ==== //depot/projects/trustedbsd/capabilities/src/sys/security/audit/audit_bsm.c#6 (text) ==== @@ -1423,10 +1423,10 @@ break; case AUE_CAP_NEW: - if (ARG_IS_VALID(kar, ARG_FD)) { - tok = au_to_arg32(1, "fd", ar->ar_arg_fd); - kau_write(rec, tok); - } + /* + * XXXRW: Would be nice to audit socket/etc information also. + */ + FD_VNODE1_TOKENS; if (ARG_IS_VALID(kar, ARG_RIGHTS)) { tok = au_to_arg64(2, "rights", ar->ar_arg_rights); kau_write(rec, tok);