PERFORCE change 112265 for review
Kip Macy
kmacy at FreeBSD.org
Fri Dec 29 04:16:00 PST 2006
http://perforce.freebsd.org/chv.cgi?CH=112265
Change 112265 by kmacy at kmacy_storage:kmacy_wifi on 2006/12/29 02:34:51
IFC
Affected files ...
.. //depot/projects/kmacy_wifi/share/man/man9/kqueue.9#3 integrate
.. //depot/projects/kmacy_wifi/sys/dev/drm/drm_agpsupport.c#2 integrate
.. //depot/projects/kmacy_wifi/sys/powerpc/powerpc/vm_machdep.c#3 integrate
.. //depot/projects/kmacy_wifi/sys/security/audit/audit.c#3 integrate
.. //depot/projects/kmacy_wifi/sys/security/audit/audit_bsm_token.c#3 integrate
.. //depot/projects/kmacy_wifi/sys/security/audit/audit_trigger.c#2 integrate
.. //depot/projects/kmacy_wifi/sys/security/audit/audit_worker.c#3 integrate
.. //depot/projects/kmacy_wifi/sys/security/mac/mac_inet.c#3 integrate
.. //depot/projects/kmacy_wifi/sys/security/mac/mac_internal.h#4 integrate
.. //depot/projects/kmacy_wifi/sys/security/mac/mac_net.c#3 integrate
.. //depot/projects/kmacy_wifi/sys/security/mac/mac_policy.h#3 integrate
.. //depot/projects/kmacy_wifi/sys/security/mac/mac_vfs.c#3 integrate
Differences ...
==== //depot/projects/kmacy_wifi/share/man/man9/kqueue.9#3 (text+ko) ====
@@ -22,9 +22,9 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $FreeBSD: src/share/man/man9/kqueue.9,v 1.4 2006/12/28 19:15:12 jmg Exp $
+.\" $FreeBSD: src/share/man/man9/kqueue.9,v 1.5 2006/12/28 22:28:28 jmg Exp $
.\"
-.Dd October 4, 2006
+.Dd December 28, 2006
.Dt KQUEUE 9
.Os
.Sh NAME
@@ -191,7 +191,7 @@
.Pp
Locks
.Em must not
-be aquired in
+be acquire in
.Va f_event .
If a lock is required in
.Va f_event ,
==== //depot/projects/kmacy_wifi/sys/dev/drm/drm_agpsupport.c#2 (text+ko) ====
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/drm/drm_agpsupport.c,v 1.5 2006/04/09 20:45:44 anholt Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/drm/drm_agpsupport.c,v 1.6 2006/12/28 21:55:47 jhb Exp $");
#include "dev/drm/drmP.h"
@@ -46,7 +46,7 @@
drm_device_find_capability(drm_device_t *dev, int cap)
{
#ifdef __FreeBSD__
-#if __FreeBSD_version >= 700010
+#if __FreeBSD_version >= 602102
return (pci_find_extcap(dev->device, cap, NULL) == 0);
#else
==== //depot/projects/kmacy_wifi/sys/powerpc/powerpc/vm_machdep.c#3 (text+ko) ====
@@ -38,7 +38,7 @@
*
* from: @(#)vm_machdep.c 7.3 (Berkeley) 5/13/91
* Utah $Hdr: vm_machdep.c 1.16.1.1 89/06/23$
- * $FreeBSD: src/sys/powerpc/powerpc/vm_machdep.c,v 1.112 2006/09/01 06:05:40 marcel Exp $
+ * $FreeBSD: src/sys/powerpc/powerpc/vm_machdep.c,v 1.113 2006/12/28 23:56:50 marcel Exp $
*/
/*-
* Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University.
@@ -89,6 +89,7 @@
#include <machine/frame.h>
#include <machine/md_var.h>
#include <machine/pcb.h>
+#include <machine/powerpc.h>
#include <dev/ofw/openfirm.h>
@@ -206,7 +207,7 @@
void
cpu_reset()
{
- OF_exit();
+ OF_reboot();
}
/*
==== //depot/projects/kmacy_wifi/sys/security/audit/audit.c#3 (text) ====
@@ -27,7 +27,7 @@
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
- * $FreeBSD: src/sys/security/audit/audit.c,v 1.22 2006/11/06 13:42:07 rwatson Exp $
+ * $FreeBSD: src/sys/security/audit/audit.c,v 1.23 2006/12/28 22:18:43 rwatson Exp $
*/
#include <sys/param.h>
@@ -312,9 +312,9 @@
return (NULL);
/*
- * XXX: The number of outstanding uncommitted audit records is
- * limited to the number of concurrent threads servicing system
- * calls in the kernel.
+ * Note: the number of outstanding uncommitted audit records is
+ * limited to the number of concurrent threads servicing system calls
+ * in the kernel.
*/
ar = uma_zalloc_arg(audit_record_zone, td, M_WAITOK);
ar->k_ar.ar_event = event;
@@ -503,7 +503,7 @@
* processes, do that here rather than trying to allocate
* another audit record.
*
- * XXXRW: We might wish to be able to continue here in the
+ * Note: we might wish to be able to continue here in the
* future, if the system recovers. That should be possible
* by means of checking the condition in a loop around
* cv_wait(). It might be desirable to reevaluate whether an
==== //depot/projects/kmacy_wifi/sys/security/audit/audit_bsm_token.c#3 (text) ====
@@ -31,7 +31,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*
* $P4: //depot/projects/trustedbsd/audit3/sys/security/audit/audit_bsm_token.c#23 $
- * $FreeBSD: src/sys/security/audit/audit_bsm_token.c,v 1.8 2006/09/20 13:14:47 rwatson Exp $
+ * $FreeBSD: src/sys/security/audit/audit_bsm_token.c,v 1.9 2006/12/28 22:18:43 rwatson Exp $
*/
#include <sys/types.h>
@@ -338,6 +338,8 @@
/*
* token ID 1 byte
* ip header 20 bytes
+ *
+ * The IP header should be submitted in network byte order.
*/
token_t *
au_to_ip(struct ip *ip)
@@ -348,9 +350,6 @@
GET_TOKEN_AREA(t, dptr, sizeof(u_char) + sizeof(struct ip));
ADD_U_CHAR(dptr, AUT_IP);
- /*
- * XXXRW: Any byte order work needed on the IP header before writing?
- */
ADD_MEM(dptr, ip, sizeof(struct ip));
return (t);
==== //depot/projects/kmacy_wifi/sys/security/audit/audit_trigger.c#2 (text) ====
@@ -25,7 +25,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD: src/sys/security/audit/audit_trigger.c,v 1.3 2006/06/08 21:55:39 rwatson Exp $
+ * $FreeBSD: src/sys/security/audit/audit_trigger.c,v 1.4 2006/12/28 22:18:43 rwatson Exp $
*/
#include <sys/param.h>
@@ -42,12 +42,17 @@
/*
* Structures and operations to support the basic character special device
- * used to communicate with userland.
+ * used to communicate with userland. /dev/audit reliably delivers one-byte
+ * messages to a listening application (or discards them if there is no
+ * listening application).
+ *
+ * Currently, select/poll are not supported on the trigger device.
*/
struct trigger_info {
unsigned int trigger;
TAILQ_ENTRY(trigger_info) list;
};
+
static MALLOC_DEFINE(M_AUDITTRIGGER, "audit_trigger", "Audit trigger events");
static struct cdev *audit_dev;
static int audit_isopen = 0;
@@ -132,7 +137,7 @@
return (ENODEV);
/*
- * XXXAUDIT: Use a condition variable instead of msleep/wakeup?
+ * Note: Use a condition variable instead of msleep/wakeup?
*/
ti = malloc(sizeof *ti, M_AUDITTRIGGER, M_WAITOK);
mtx_lock(&audit_trigger_mtx);
==== //depot/projects/kmacy_wifi/sys/security/audit/audit_worker.c#3 (text) ====
@@ -27,7 +27,7 @@
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
- * $FreeBSD: src/sys/security/audit/audit_worker.c,v 1.12 2006/09/24 13:35:58 rwatson Exp $
+ * $FreeBSD: src/sys/security/audit/audit_worker.c,v 1.13 2006/12/28 22:18:43 rwatson Exp $
*/
#include <sys/param.h>
@@ -226,7 +226,7 @@
audit_in_failure = 1;
} else if (audit_in_failure) {
/*
- * XXXRW: If we want to handle recovery, this is the
+ * Note: if we want to handle recovery, this is the
* spot to do it: unset audit_in_failure, and issue a
* wakeup on the cv.
*/
@@ -246,8 +246,8 @@
* true, since audit_in_failure can only be set of audit_fail_stop is
* set.
*
- * XXXRW: If we handle recovery from audit_in_failure, then we need
- * to make panic here conditional.
+ * Note: if we handle recovery from audit_in_failure, then we need to
+ * make panic here conditional.
*/
if (audit_in_failure) {
if (audit_q_len == 0 && audit_pre_q_len == 0) {
@@ -297,9 +297,9 @@
* the global replacement variables. Signal consumers as needed that the
* rotation has taken place.
*
- * XXXRW: The global variables and CVs used to signal the audit_worker to
- * perform a rotation are essentially a message queue of depth 1. It would
- * be much nicer to actually use a message queue.
+ * The global variables and CVs used to signal the audit_worker to perform a
+ * rotation are essentially a message queue of depth 1. It would be much
+ * nicer to actually use a message queue.
*/
static void
audit_worker_rotate(struct ucred **audit_credp, struct vnode **audit_vpp,
@@ -323,9 +323,6 @@
audit_enabled = (*audit_vpp != NULL);
- /*
- * XXX: What to do about write failures here?
- */
if (old_vp != NULL) {
AUDIT_PRINTF(("Closing old audit file\n"));
mtx_unlock(&audit_mtx);
@@ -520,11 +517,9 @@
* this call, so the caller should not release either.
*
* XXXAUDIT: Review synchronize communication logic. Really, this is a
- * message queue of depth 1.
- *
- * XXXAUDIT: Enhance the comments below to indicate that we are basically
- * acquiring ownership of the communications queue, inserting our message,
- * and waiting for an acknowledgement.
+ * message queue of depth 1. We are essentially acquiring ownership of the
+ * communications queue, inserting our message, and waiting for an
+ * acknowledgement.
*/
void
audit_rotate_vnode(struct ucred *cred, struct vnode *vp)
==== //depot/projects/kmacy_wifi/sys/security/mac/mac_inet.c#3 (text+ko) ====
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/security/mac/mac_inet.c,v 1.8 2006/12/22 23:34:44 rwatson Exp $");
+__FBSDID("$FreeBSD: src/sys/security/mac/mac_inet.c,v 1.9 2006/12/28 21:56:39 rwatson Exp $");
#include "opt_mac.h"
@@ -270,8 +270,8 @@
mac_inpcb_sosetlabel(struct socket *so, struct inpcb *inp)
{
- /* XXX: assert socket lock. */
INP_LOCK_ASSERT(inp);
+ SOCK_LOCK_ASSERT(so);
MAC_PERFORM(inpcb_sosetlabel, so, so->so_label, inp, inp->inp_label);
}
==== //depot/projects/kmacy_wifi/sys/security/mac/mac_internal.h#4 (text+ko) ====
@@ -37,9 +37,12 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD: src/sys/security/mac/mac_internal.h,v 1.118 2006/12/28 21:48:38 rwatson Exp $
+ * $FreeBSD: src/sys/security/mac/mac_internal.h,v 1.119 2006/12/28 23:23:35 rwatson Exp $
*/
+#ifndef _SYS_SECURITY_MAC_MAC_INTERNAL_H_
+#define _SYS_SECURITY_MAC_MAC_INTERNAL_H_
+
/*
* MAC Framework sysctl namespace.
*/
@@ -307,3 +310,5 @@
mac_policy_list_unbusy(); \
} \
} while (0)
+
+#endif /* !_SYS_SECURITY_MAC_MAC_INTERNAL_H_ */
==== //depot/projects/kmacy_wifi/sys/security/mac/mac_net.c#3 (text+ko) ====
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/security/mac/mac_net.c,v 1.124 2006/12/22 23:34:44 rwatson Exp $");
+__FBSDID("$FreeBSD: src/sys/security/mac/mac_net.c,v 1.125 2006/12/28 21:57:59 rwatson Exp $");
#include "opt_mac.h"
@@ -75,13 +75,6 @@
#define MAC_IFNET_UNLOCK(ifp) mtx_unlock(&mac_ifnet_mtx)
/*
- * XXXRW: In order to use the MAC label UMA zone for all label allocations,
- * we simply store a pointer to a UMA-allocated label in the mbuf tag. This
- * is inefficient and should likely change to using a label embedded in the
- * tag.
- */
-
-/*
* Retrieve the label associated with an mbuf by searching for the tag.
* Depending on the value of mac_labelmbufs, it's possible that a label will
* not be present, in which case NULL is returned. Policies must handle the
==== //depot/projects/kmacy_wifi/sys/security/mac/mac_policy.h#3 (text+ko) ====
@@ -35,13 +35,13 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD: src/sys/security/mac/mac_policy.h,v 1.83 2006/12/28 21:48:38 rwatson Exp $
+ * $FreeBSD: src/sys/security/mac/mac_policy.h,v 1.84 2006/12/28 23:23:35 rwatson Exp $
*/
/*
* Kernel interface for MAC policy modules.
*/
-#ifndef _SYS_MAC_POLICY_H_
-#define _SYS_MAC_POLICY_H_
+#ifndef _SYS_SECURITY_MAC_MAC_POLICY_H_
+#define _SYS_SECURITY_MAC_MAC_POLICY_H_
/*-
* Pluggable access control policy definition structure.
@@ -971,4 +971,4 @@
*/
#define LABEL_TO_SLOT(l, s) (l)->l_perpolicy[s]
-#endif /* !_SYS_MAC_POLICY_H_ */
+#endif /* !_SYS_SECURITY_MAC_MAC_POLICY_H_ */
==== //depot/projects/kmacy_wifi/sys/security/mac/mac_vfs.c#3 (text+ko) ====
@@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/security/mac/mac_vfs.c,v 1.117 2006/12/22 23:34:45 rwatson Exp $");
+__FBSDID("$FreeBSD: src/sys/security/mac/mac_vfs.c,v 1.118 2006/12/28 22:02:59 rwatson Exp $");
#include "opt_mac.h"
@@ -268,6 +268,15 @@
vp->v_label);
}
+/*
+ * Functions implementing extended-attribute backed labels for file systems
+ * that support it.
+ *
+ * Where possible, we use EA transactions to make writes to multiple
+ * attributes across difference policies mutually atomic. We allow work to
+ * continue on file systems not supporting EA transactions, but generate a
+ * printf warning.
+ */
int
mac_create_vnode_extattr(struct ucred *cred, struct mount *mp,
struct vnode *dvp, struct vnode *vp, struct componentname *cnp)
@@ -279,7 +288,6 @@
error = VOP_OPENEXTATTR(vp, cred, curthread);
if (error == EOPNOTSUPP) {
- /* XXX: Optionally abort if transactions not supported. */
if (ea_warn_once == 0) {
printf("Warning: transactions not supported "
"in EA write.\n");
@@ -297,9 +305,8 @@
}
error = VOP_CLOSEEXTATTR(vp, 1, NOCRED, curthread);
-
if (error == EOPNOTSUPP)
- error = 0; /* XXX */
+ error = 0;
return (error);
}
@@ -314,7 +321,6 @@
error = VOP_OPENEXTATTR(vp, cred, curthread);
if (error == EOPNOTSUPP) {
- /* XXX: Optionally abort if transactions not supported. */
if (ea_warn_once == 0) {
printf("Warning: transactions not supported "
"in EA write.\n");
@@ -331,9 +337,8 @@
}
error = VOP_CLOSEEXTATTR(vp, 1, NOCRED, curthread);
-
if (error == EOPNOTSUPP)
- error = 0; /* XXX */
+ error = 0;
return (error);
}
More information about the p4-projects
mailing list