From owner-p4-projects@FreeBSD.ORG Tue Aug 15 18:04:07 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 E61E416A4DA; Tue, 15 Aug 2006 18:04:06 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C164616A4E0 for ; Tue, 15 Aug 2006 18:04:06 +0000 (UTC) (envelope-from millert@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9512543DA2 for ; Tue, 15 Aug 2006 18:02:47 +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 k7FI2lDo037324 for ; Tue, 15 Aug 2006 18:02:47 GMT (envelope-from millert@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k7FI2lgf037321 for perforce@freebsd.org; Tue, 15 Aug 2006 18:02:47 GMT (envelope-from millert@freebsd.org) Date: Tue, 15 Aug 2006 18:02:47 GMT Message-Id: <200608151802.k7FI2lgf037321@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 104078 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: Tue, 15 Aug 2006 18:04:07 -0000 http://perforce.freebsd.org/chv.cgi?CH=104078 Change 104078 by millert@millert_macbook on 2006/08/15 18:01:55 If the message number is bad, only return failure if we are in enforcing mode. Fix some whitespace here too. Affected files ... .. //depot/projects/trustedbsd/sedarwin8/policies/sedarwin/sedarwin/ss/mach_av.c#2 edit Differences ... ==== //depot/projects/trustedbsd/sedarwin8/policies/sedarwin/sedarwin/ss/mach_av.c#2 (text+ko) ==== @@ -129,8 +129,8 @@ sebsd_check_ipc_method1(int subj, int obj, int msgid) { struct msgid_classinfo *mcl; - u32 perms; - int cl; + u32 perms; + int cl; /* * Return allowed for messages in an unknown subsystem. @@ -142,10 +142,14 @@ return 0; cl = (msgid - mcl->baseid) / (8 * sizeof(u32)); - if (cl >= mcl->nclasses) - return (1); /* bad message, access denied */ + if (cl >= mcl->nclasses) { + /* bad message */ + if (selinux_enforcing) + return (EACCES); + else + return (0); + } - perms = (u32)1 << - (msgid - mcl->baseid - (cl * 8 * sizeof(u32))); + perms = (u32)1 << (msgid - mcl->baseid - (cl * 8 * sizeof(u32))); return avc_has_perm(subj, obj, mcl->classes[cl], perms, NULL); }