Deleted Added
full compact
mac_syscalls.c (182063) mac_syscalls.c (184412)
1/*-
2 * Copyright (c) 1999-2002, 2006 Robert N. M. Watson
3 * Copyright (c) 2001 Ilmar S. Habibulin
4 * Copyright (c) 2001-2005 Networks Associates Technology, Inc.
5 * Copyright (c) 2005-2006 SPARTA, Inc.
6 * Copyright (c) 2008 Apple Inc.
7 * All rights reserved.
8 *

--- 26 unchanged lines hidden (view full) ---

35 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
36 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
37 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
38 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
39 * SUCH DAMAGE.
40 */
41
42#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1999-2002, 2006 Robert N. M. Watson
3 * Copyright (c) 2001 Ilmar S. Habibulin
4 * Copyright (c) 2001-2005 Networks Associates Technology, Inc.
5 * Copyright (c) 2005-2006 SPARTA, Inc.
6 * Copyright (c) 2008 Apple Inc.
7 * All rights reserved.
8 *

--- 26 unchanged lines hidden (view full) ---

35 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
36 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
37 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
38 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
39 * SUCH DAMAGE.
40 */
41
42#include <sys/cdefs.h>
43__FBSDID("$FreeBSD: head/sys/security/mac/mac_syscalls.c 182063 2008-08-23 15:26:36Z rwatson $");
43__FBSDID("$FreeBSD: head/sys/security/mac/mac_syscalls.c 184412 2008-10-28 12:49:07Z rwatson $");
44
45#include "opt_mac.h"
46
47#include <sys/param.h>
48#include <sys/fcntl.h>
49#include <sys/kernel.h>
50#include <sys/lock.h>
51#include <sys/malloc.h>

--- 146 unchanged lines hidden (view full) ---

198 goto out;
199 }
200
201 setsugid(p);
202 crcopy(newcred, oldcred);
203 mac_cred_relabel(newcred, intlabel);
204 p->p_ucred = newcred;
205
44
45#include "opt_mac.h"
46
47#include <sys/param.h>
48#include <sys/fcntl.h>
49#include <sys/kernel.h>
50#include <sys/lock.h>
51#include <sys/malloc.h>

--- 146 unchanged lines hidden (view full) ---

198 goto out;
199 }
200
201 setsugid(p);
202 crcopy(newcred, oldcred);
203 mac_cred_relabel(newcred, intlabel);
204 p->p_ucred = newcred;
205
206 /*
207 * Grab additional reference for use while revoking mmaps, prior to
208 * releasing the proc lock and sharing the cred.
209 */
210 crhold(newcred);
211 PROC_UNLOCK(p);
206 PROC_UNLOCK(p);
212
213 mac_cred_mmapped_drop_perms(td, newcred);
214
215 crfree(newcred); /* Free revocation reference. */
216 crfree(oldcred);
207 crfree(oldcred);
208 mac_proc_vm_revoke(td);
217
218out:
219 mac_cred_label_free(intlabel);
220 return (error);
221}
222
223int
224__mac_get_fd(struct thread *td, struct __mac_get_fd_args *uap)

--- 507 unchanged lines hidden ---
209
210out:
211 mac_cred_label_free(intlabel);
212 return (error);
213}
214
215int
216__mac_get_fd(struct thread *td, struct __mac_get_fd_args *uap)

--- 507 unchanged lines hidden ---