From owner-p4-projects@FreeBSD.ORG Mon Dec 4 18:30:13 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 2FA9A16A47B; Mon, 4 Dec 2006 18:30:13 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 08E3616A416 for ; Mon, 4 Dec 2006 18:30:13 +0000 (UTC) (envelope-from millert@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [69.147.83.41]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4EBB043CBE for ; Mon, 4 Dec 2006 18:29:38 +0000 (GMT) (envelope-from millert@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 kB4IUCab087879 for ; Mon, 4 Dec 2006 18:30:12 GMT (envelope-from millert@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id kB4IUCdb087876 for perforce@freebsd.org; Mon, 4 Dec 2006 18:30:12 GMT (envelope-from millert@freebsd.org) Date: Mon, 4 Dec 2006 18:30:12 GMT Message-Id: <200612041830.kB4IUCdb087876@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to millert@freebsd.org using -f From: Todd Miller To: Perforce Change Reviews Cc: Subject: PERFORCE change 111041 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, 04 Dec 2006 18:30:13 -0000 http://perforce.freebsd.org/chv.cgi?CH=111041 Change 111041 by millert@millert_g5tower on 2006/12/04 18:29:50 Eliminate 'data' argument to fsctl()/ioctl() framework/policy entrypoints. Affected files ... .. //depot/projects/trustedbsd/sedarwin8/darwin/xnu/bsd/kern/sys_pipe.c#5 edit .. //depot/projects/trustedbsd/sedarwin8/darwin/xnu/bsd/vfs/vfs_syscalls.c#18 edit .. //depot/projects/trustedbsd/sedarwin8/darwin/xnu/bsd/vfs/vfs_vnops.c#8 edit .. //depot/projects/trustedbsd/sedarwin8/darwin/xnu/security/mac_framework.h#23 edit .. //depot/projects/trustedbsd/sedarwin8/darwin/xnu/security/mac_pipe.c#8 edit .. //depot/projects/trustedbsd/sedarwin8/darwin/xnu/security/mac_policy.h#31 edit .. //depot/projects/trustedbsd/sedarwin8/darwin/xnu/security/mac_vfs.c#22 edit Differences ... ==== //depot/projects/trustedbsd/sedarwin8/darwin/xnu/bsd/kern/sys_pipe.c#5 (text+ko) ==== @@ -1300,7 +1300,7 @@ PIPE_LOCK(mpipe); #ifdef MAC - error = mac_pipe_check_ioctl(kauth_cred_get(), mpipe, cmd, data); + error = mac_pipe_check_ioctl(kauth_cred_get(), mpipe, cmd); if (error) { PIPE_UNLOCK(mpipe); ==== //depot/projects/trustedbsd/sedarwin8/darwin/xnu/bsd/vfs/vfs_syscalls.c#18 (text+ko) ==== @@ -5337,7 +5337,7 @@ if ((error = namei(&nd))) goto FSCtl_Exit; #ifdef MAC - error = mac_mount_check_fsctl(context.vc_ucred, vnode_mount(nd.ni_vp), cmd, data); + error = mac_mount_check_fsctl(context.vc_ucred, vnode_mount(nd.ni_vp), cmd); if (error) { vnode_put(nd.ni_vp); nameidone(&nd); ==== //depot/projects/trustedbsd/sedarwin8/darwin/xnu/bsd/vfs/vfs_vnops.c#8 (text+ko) ==== @@ -857,7 +857,7 @@ context.vc_ucred = p->p_ucred; /* XXX kauth_cred_get() ??? */ #ifdef MAC - error = mac_vnode_check_ioctl(context.vc_ucred, vp, com, data); + error = mac_vnode_check_ioctl(context.vc_ucred, vp, com); if (error) goto out; #endif ==== //depot/projects/trustedbsd/sedarwin8/darwin/xnu/security/mac_framework.h#23 (text+ko) ==== @@ -161,8 +161,7 @@ void mac_mbuf_tag_copy(struct m_tag *m, struct m_tag *mtag); void mac_mbuf_tag_destroy(struct m_tag *mtag); int mac_mbuf_tag_init(struct m_tag *, int how); -int mac_mount_check_fsctl(struct ucred *cred, struct mount *mp, - int com, caddr_t data); +int mac_mount_check_fsctl(struct ucred *cred, struct mount *mp, int com); int mac_mount_check_getattr(struct ucred *cred, struct mount *mp, struct vfs_attr *vfa); int mac_mount_check_label_update(struct ucred *cred, struct mount *mp); @@ -181,7 +180,7 @@ void mac_mount_label_init(struct mount *); int mac_mount_label_internalize(struct label *, char *string); int mac_pipe_check_ioctl(struct ucred *cred, struct pipe *cpipe, - unsigned long cmd, void *data); + unsigned long cmd); int mac_pipe_check_kqfilter(struct ucred *cred, struct knote *kn, struct pipe *cpipe); int mac_pipe_check_read(struct ucred *cred, struct pipe *cpipe); @@ -342,8 +341,7 @@ struct attrlist *alist); int mac_vnode_check_getextattr(struct ucred *cred, struct vnode *vp, const char *name, struct uio *uio); -int mac_vnode_check_ioctl(struct ucred *cred, struct vnode *vp, int com, - caddr_t data); +int mac_vnode_check_ioctl(struct ucred *cred, struct vnode *vp, int com); int mac_vnode_check_kqfilter(struct ucred *active_cred, struct ucred *file_cred, struct knote *kn, struct vnode *vp); int mac_vnode_check_label_update(struct ucred *cred, struct vnode *vp, ==== //depot/projects/trustedbsd/sedarwin8/darwin/xnu/security/mac_pipe.c#8 (text+ko) ==== @@ -122,12 +122,11 @@ return (error); } int -mac_pipe_check_ioctl(struct ucred *cred, struct pipe *cpipe, - unsigned long cmd, void *data) +mac_pipe_check_ioctl(struct ucred *cred, struct pipe *cpipe, unsigned long cmd) { int error; - MAC_CHECK(pipe_check_ioctl, cred, cpipe, cpipe->pipe_label, cmd, data); + MAC_CHECK(pipe_check_ioctl, cred, cpipe, cpipe->pipe_label, cmd); return (error); } ==== //depot/projects/trustedbsd/sedarwin8/darwin/xnu/security/mac_policy.h#31 (text+ko) ==== @@ -1111,7 +1111,6 @@ @param mp The mount point @param label Label associated with the mount point @param com Filesystem-dependent request code; see fsctl(2) - @param data Request-specific information; see fsctl(2) Determine whether the subject identified by the credential can perform the volume operation indicated by com. @@ -1128,8 +1127,7 @@ struct ucred *cred, struct mount *mp, struct label *label, - int com, - caddr_t data + int com ); /** @brief Access control check for the retrieval of file system attributes @@ -1360,7 +1358,6 @@ @param cpipe Object to be accessed @param pipelabel The label on the pipe @param cmd The ioctl command; see ioctl(2) - @param data Request-specific information; see ioctl(2) Determine whether the subject identified by the credential can perform the ioctl operation indicated by cmd. @@ -1377,8 +1374,7 @@ struct ucred *cred, struct pipe *cpipe, struct label *pipelabel, - unsigned long cmd, - void *data + unsigned long cmd ); /** @brief Access control check for pipe kqfilter @@ -4092,7 +4088,6 @@ @param vp Object vnode @param label Policy label for vp @param com Device-dependent request code; see ioctl(2) - @param data Request-specific information; see ioctl(2) Determine whether the subject identified by the credential can perform the ioctl operation indicated by com. @@ -4109,8 +4104,7 @@ struct ucred *cred, struct vnode *vp, struct label *label, - int com, - caddr_t data + int com ); /** @brief Access control check for vnode kqfilter ==== //depot/projects/trustedbsd/sedarwin8/darwin/xnu/security/mac_vfs.c#22 (text+ko) ==== @@ -504,12 +504,11 @@ } int -mac_vnode_check_ioctl(struct ucred *cred, struct vnode *vp, int com, - caddr_t data) +mac_vnode_check_ioctl(struct ucred *cred, struct vnode *vp, int com) { int error; - MAC_CHECK(vnode_check_ioctl, cred, vp, vp->v_label, com, data); + MAC_CHECK(vnode_check_ioctl, cred, vp, vp->v_label, com); return (error); } @@ -876,12 +875,11 @@ } int -mac_mount_check_fsctl(struct ucred *cred, struct mount *mp, int com, - caddr_t data) +mac_mount_check_fsctl(struct ucred *cred, struct mount *mp, int com) { int error; - MAC_CHECK(mount_check_fsctl, cred, mp, mp->mnt_mntlabel, com, data); + MAC_CHECK(mount_check_fsctl, cred, mp, mp->mnt_mntlabel, com); return (error); }