From owner-p4-projects@FreeBSD.ORG Mon Dec 11 22:07:39 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 C502C16A58C; Mon, 11 Dec 2006 22:07:39 +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 33C6416A501 for ; Mon, 11 Dec 2006 22:07:39 +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 3BA424405D for ; Mon, 11 Dec 2006 21:46:30 +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 kBBLlcqt097981 for ; Mon, 11 Dec 2006 21:47:38 GMT (envelope-from millert@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id kBBLlcJX097978 for perforce@freebsd.org; Mon, 11 Dec 2006 21:47:38 GMT (envelope-from millert@freebsd.org) Date: Mon, 11 Dec 2006 21:47:38 GMT Message-Id: <200612112147.kBBLlcJX097978@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 111494 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, 11 Dec 2006 22:07:40 -0000 http://perforce.freebsd.org/chv.cgi?CH=111494 Change 111494 by millert@millert_g5tower on 2006/12/11 21:46:49 Add code and error fields to mac_thread_userret() and move it to mac_process.c where it belongs. Affected files ... .. //depot/projects/trustedbsd/sedarwin8/darwin/xnu/bsd/dev/ppc/systemcalls.c#4 edit .. //depot/projects/trustedbsd/sedarwin8/darwin/xnu/security/mac_base.c#32 edit .. //depot/projects/trustedbsd/sedarwin8/darwin/xnu/security/mac_framework.h#27 edit .. //depot/projects/trustedbsd/sedarwin8/darwin/xnu/security/mac_policy.h#35 edit .. //depot/projects/trustedbsd/sedarwin8/darwin/xnu/security/mac_process.c#13 edit Differences ... ==== //depot/projects/trustedbsd/sedarwin8/darwin/xnu/bsd/dev/ppc/systemcalls.c#4 (text+ko) ==== @@ -221,7 +221,7 @@ error = (*(callp->sy_call))(proc, (void *)uthread->uu_arg, &(uthread->uu_rval[0])); #ifdef MAC AUDIT_SYSCALL_EXIT(code, error, proc, uthread); - mac_thread_userret(thread_act); + mac_thread_userret(code, error, thread_act); #else AUDIT_SYSCALL_EXIT(error, proc, uthread); #endif ==== //depot/projects/trustedbsd/sedarwin8/darwin/xnu/security/mac_base.c#32 (text+ko) ==== @@ -1162,14 +1162,6 @@ return (error); } -void -mac_thread_userret(struct thread *thread) -{ - - if (mac_late) - MAC_PERFORM(thread_userret, thread); -} - /* system calls */ int ==== //depot/projects/trustedbsd/sedarwin8/darwin/xnu/security/mac_framework.h#27 (text+ko) ==== @@ -328,7 +328,7 @@ void mac_sysvshm_label_init(struct shmid_kernel* shmsegptr); void mac_sysvshm_label_recycle(struct shmid_kernel *shmsegptr); int mac_task_check_get_port(struct ucred *cred, struct task *task); -void mac_thread_userret(struct thread *thread); +void mac_thread_userret(int code, int error, struct thread *thread); int mac_vnode_check_access(struct ucred *cred, struct vnode *vp, int acc_mode); int mac_vnode_check_chdir(struct ucred *cred, struct vnode *dvp); ==== //depot/projects/trustedbsd/sedarwin8/darwin/xnu/security/mac_policy.h#35 (text+ko) ==== @@ -3844,13 +3844,17 @@ ); /** @brief Perform MAC-related events when a thread returns to user space - @param thread Mach thread that is returning + @param code The number of the syscall/trap that has finished + @param error The error code that will be returned to user space + @param thread Mach (not BSD) thread that is returning This entry point permits policy modules to perform MAC-related events when a thread returns to user space, via a system call return, trap return, or otherwise. */ typedef void mpo_thread_userret_t( + int code, + int error, struct thread *thread ); /** ==== //depot/projects/trustedbsd/sedarwin8/darwin/xnu/security/mac_process.c#13 (text+ko) ==== @@ -398,3 +398,10 @@ return (error); } +void +mac_thread_userret(int code, int error, struct thread *thread) +{ + + if (mac_late) + MAC_PERFORM(thread_userret, code, error, thread); +}