Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 11 Feb 2011 10:30:28 +0100
From:      Alexander Leidinger <Alexander@Leidinger.net>
To:        hackers@freebsd.org
Cc:        kibab@freebsd.org
Subject:   CFR: FEATURE macros for AUDIT/CAM/IPC/KTR/MAC/NFS/NTP/PMC/SYSV/...
Message-ID:  <20110211103028.12684f54yrw8tgqo@webmail.leidinger.net>

next in thread | raw e-mail | index | archive | help
This message is in MIME format.

--=_3y2cjioe7e80
Content-Type: text/plain;
 charset=UTF-8;
 DelSp="Yes";
 format="flowed"
Content-Disposition: inline
Content-Transfer-Encoding: 7bit

Hi,

during the last GSoC various FEATURE macros where added to the system.  
Before committing them, I would like to get some review (like if macro  
is in the correct file, and for those FEATURES where the description  
was not taken from NOTES if the description is OK).

If nobody complains, I would like to commit this in 1-2 weeks. If you  
need more time to review, just tell me.

Here is the list of affected files (for those impatient ones which do  
not want to look at the attached patch before noticing that they are  
not interested to look at it):
---snip---
cam/cam.c
fs/nfsclient/nfs_clvfsops.c
fs/nfsserver/nfs_nfsdport.c
kern/kern_dtrace.c
kern/kern_ktr.c
kern/kern_ktrace.c
kern/kern_lock.c
kern/kern_lockstat.c
kern/kern_ntptime.c
kern/kern_pmc.c
kern/kern_prot.c
kern/ksched.c
kern/subr_mchain.c
kern/subr_stack.c
kern/sysv_msg.c
kern/sysv_sem.c
kern/sysv_shm.c
kern/uipc_cow.c
kern/uipc_mqueue.c
kern/uipc_sem.c
nfsclient/nfs_vfsops.c
nfsserver/nfs_serv.c
security/audit/audit.c
security/mac/mac_syscalls.c
---snip---

Thanks,
Alexander.

-- 
Most people in this society who aren't actively mad are,
at best, reformed or potential lunatics.
		-- Susan Sontag

http://www.Leidinger.net    Alexander @ Leidinger.net: PGP ID = B0063FE7
http://www.FreeBSD.org       netchild @ FreeBSD.org  : PGP ID = 72077137

--=_3y2cjioe7e80
Content-Type: text/x-patch;
 charset=UTF-8;
 name="features_rest.diff"
Content-Disposition: attachment;
 filename="features_rest.diff"
Content-Transfer-Encoding: 7bit

Index: cam/cam.c
===================================================================
--- cam/cam.c	(Revision 218482)
+++ cam/cam.c	(Arbeitskopie)
@@ -51,6 +51,9 @@
 #include <sys/libkern.h>
 #include <cam/cam_queue.h>
 #include <cam/cam_xpt.h>
+
+FEATURE(scbus, "SCSI devices support");
+
 #endif
 
 static int	camstatusentrycomp(const void *key, const void *member);
Index: fs/nfsclient/nfs_clvfsops.c
===================================================================
--- fs/nfsclient/nfs_clvfsops.c	(Revision 218482)
+++ fs/nfsclient/nfs_clvfsops.c	(Arbeitskopie)
@@ -73,6 +73,8 @@
 #include <fs/nfsclient/nfs.h>
 #include <fs/nfsclient/nfsdiskless.h>
 
+FEATURE(nfscl, "NFSv4 client");
+
 extern int nfscl_ticks;
 extern struct timeval nfsboottime;
 extern struct nfsstats	newnfsstats;
Index: fs/nfsserver/nfs_nfsdport.c
===================================================================
--- fs/nfsserver/nfs_nfsdport.c	(Revision 218482)
+++ fs/nfsserver/nfs_nfsdport.c	(Arbeitskopie)
@@ -46,6 +46,8 @@
 #include <nlm/nlm_prot.h>
 #include <nlm/nlm.h>
 
+FEATURE(nfsd, "NFSv4 server");
+
 extern u_int32_t newnfs_true, newnfs_false, newnfs_xdrneg1;
 extern int nfsrv_useacl;
 extern int newnfs_numnfsd;
Index: kern/kern_dtrace.c
===================================================================
--- kern/kern_dtrace.c	(Revision 218482)
+++ kern/kern_dtrace.c	(Arbeitskopie)
@@ -37,10 +37,14 @@
 #include <sys/malloc.h>
 #include <sys/proc.h>
 #include <sys/dtrace_bsd.h>
+#include <sys/sysctl.h>
 
 #define KDTRACE_PROC_SIZE	64
 #define	KDTRACE_THREAD_SIZE	256
 
+FEATURE(kdtrace_hooks,
+    "Kernel DTrace hooks which are required to load DTrace kernel modules");
+
 MALLOC_DEFINE(M_KDTRACE, "kdtrace", "DTrace hooks");
 
 /* Return the DTrace process data size compiled in the kernel hooks. */
Index: kern/kern_ktr.c
===================================================================
--- kern/kern_ktr.c	(Revision 218482)
+++ kern/kern_ktr.c	(Arbeitskopie)
@@ -80,6 +80,8 @@
 #define	KTR_CPU		PCPU_GET(cpuid)
 #endif
 
+FEATURE(ktr, "Kernel support for KTR kernel tracing facility");
+
 SYSCTL_NODE(_debug, OID_AUTO, ktr, CTLFLAG_RD, 0, "KTR options");
 
 int	ktr_cpumask = KTR_CPUMASK;
Index: kern/kern_ktrace.c
===================================================================
--- kern/kern_ktrace.c	(Revision 218482)
+++ kern/kern_ktrace.c	(Arbeitskopie)
@@ -83,6 +83,8 @@
 
 #ifdef KTRACE
 
+FEATURE(ktrace, "Kernel support for system-call tracing");
+
 #ifndef KTRACE_REQUEST_POOL
 #define	KTRACE_REQUEST_POOL	100
 #endif
Index: kern/kern_lock.c
===================================================================
--- kern/kern_lock.c	(Revision 218482)
+++ kern/kern_lock.c	(Arbeitskopie)
@@ -1299,6 +1299,10 @@
 }
 
 #ifdef INVARIANT_SUPPORT
+
+FEATURE(invariant_support,
+    "Support for modules compiled with INVARIANTS option");
+
 #ifndef INVARIANTS
 #undef	_lockmgr_assert
 #endif
Index: kern/kern_lockstat.c
===================================================================
--- kern/kern_lockstat.c	(Revision 218482)
+++ kern/kern_lockstat.c	(Arbeitskopie)
@@ -39,7 +39,10 @@
 #include <sys/time.h>
 #include <sys/types.h>
 #include <sys/lockstat.h>
-
+#include <sys/param.h>
+#include <sys/sysctl.h>
+#include <sys/kernel.h>
+FEATURE(kdtrace_hooks, "Kernel DTRACE hooks");
 /*
  * The following must match the type definition of dtrace_probe.  It is  
  * defined this way to avoid having to rely on CDDL code.
Index: kern/kern_ntptime.c
===================================================================
--- kern/kern_ntptime.c	(Revision 218482)
+++ kern/kern_ntptime.c	(Arbeitskopie)
@@ -51,6 +51,10 @@
 #include <sys/syscallsubr.h>
 #include <sys/sysctl.h>
 
+#ifdef PPS_SYNC
+FEATURE(pps_sync, "Support usage of external PPS signal by kernel PLL");
+#endif
+
 /*
  * Single-precision macros for 64-bit machines
  */
Index: kern/kern_pmc.c
===================================================================
--- kern/kern_pmc.c	(Revision 218482)
+++ kern/kern_pmc.c	(Arbeitskopie)
@@ -37,8 +37,10 @@
 #include <sys/pmc.h>
 #include <sys/pmckern.h>
 #include <sys/smp.h>
+#include <sys/sysctl.h>
 
 #ifdef	HWPMC_HOOKS
+FEATURE(hwpmc_hooks, "Kernel support for HW PMC");
 #define	PMC_KERNEL_VERSION	PMC_VERSION
 #else
 #define	PMC_KERNEL_VERSION	0
Index: kern/kern_prot.c
===================================================================
--- kern/kern_prot.c	(Revision 218482)
+++ kern/kern_prot.c	(Arbeitskopie)
@@ -69,6 +69,11 @@
 #include <sys/syscallsubr.h>
 #include <sys/sysctl.h>
 
+#ifdef REGRESSION
+FEATURE(regression,
+    "Kernel support for interfaces nessesary for regression testing (SECURITY RISK!)");
+#endif
+
 #if defined(INET) || defined(INET6)
 #include <netinet/in.h>
 #include <netinet/in_pcb.h>
Index: kern/ksched.c
===================================================================
--- kern/ksched.c	(Revision 218482)
+++ kern/ksched.c	(Arbeitskopie)
@@ -41,12 +41,16 @@
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/lock.h>
+#include <sys/sysctl.h>
+#include <sys/kernel.h>
 #include <sys/mutex.h>
 #include <sys/proc.h>
 #include <sys/posix4.h>
 #include <sys/resource.h>
 #include <sys/sched.h>
 
+FEATURE(kposix_priority_scheduling, "POSIX P1003.1B realtime extensions");
+
 /* ksched: Real-time extension to support POSIX priority scheduling.
  */
 
Index: kern/subr_mchain.c
===================================================================
--- kern/subr_mchain.c	(Revision 218482)
+++ kern/subr_mchain.c	(Arbeitskopie)
@@ -32,6 +32,7 @@
 
 #include <sys/param.h>
 #include <sys/systm.h>
+#include <sys/sysctl.h>
 #include <sys/endian.h>
 #include <sys/errno.h>
 #include <sys/mbuf.h>
@@ -40,6 +41,8 @@
 
 #include <sys/mchain.h>
 
+FEATURE(libmchain, "mchain library");
+
 MODULE_VERSION(libmchain, 1);
 
 #define MBERROR(format, ...) printf("%s(%d): "format, __func__ , \
Index: kern/subr_stack.c
===================================================================
--- kern/subr_stack.c	(Revision 218482)
+++ kern/subr_stack.c	(Arbeitskopie)
@@ -39,7 +39,10 @@
 #include <sys/sbuf.h>
 #include <sys/stack.h>
 #include <sys/systm.h>
+#include <sys/sysctl.h>
 
+FEATURE(stack, "Support for capturing kernel stack");
+
 static MALLOC_DEFINE(M_STACK, "stack", "Stack Traces");
 
 static int stack_symbol(vm_offset_t pc, char *namebuf, u_int buflen,
Index: kern/sysv_msg.c
===================================================================
--- kern/sysv_msg.c	(Revision 218482)
+++ kern/sysv_msg.c	(Arbeitskopie)
@@ -72,6 +72,8 @@
 
 #include <security/mac/mac_framework.h>
 
+FEATURE(sysv_msg, "System V message queues support");
+
 static MALLOC_DEFINE(M_MSG, "msg", "SVID compatible message queues");
 
 static int msginit(void);
Index: kern/sysv_sem.c
===================================================================
--- kern/sysv_sem.c	(Revision 218482)
+++ kern/sysv_sem.c	(Arbeitskopie)
@@ -62,6 +62,8 @@
 
 #include <security/mac/mac_framework.h>
 
+FEATURE(sysv_sem, "System V semaphores support");
+
 static MALLOC_DEFINE(M_SEM, "sem", "SVID compatible semaphores");
 
 #ifdef SEM_DEBUG
Index: kern/sysv_shm.c
===================================================================
--- kern/sysv_shm.c	(Revision 218482)
+++ kern/sysv_shm.c	(Arbeitskopie)
@@ -95,6 +95,8 @@
 #include <vm/vm_page.h>
 #include <vm/vm_pager.h>
 
+FEATURE(sysv_shm, "System V shared memory segments support");
+
 static MALLOC_DEFINE(M_SHM, "shm", "SVID compatible shared memory segments");
 
 static int shmget_allocate_segment(struct thread *td,
Index: kern/uipc_cow.c
===================================================================
--- kern/uipc_cow.c	(Revision 218482)
+++ kern/uipc_cow.c	(Arbeitskopie)
@@ -40,6 +40,7 @@
 
 #include <sys/param.h>
 #include <sys/systm.h>
+#include <sys/sysctl.h>
 #include <sys/kernel.h>
 #include <sys/proc.h>
 #include <sys/lock.h>
@@ -57,6 +58,7 @@
 #include <vm/vm_page.h>
 #include <vm/vm_object.h>
 
+FEATURE(zero_copy_sockets, "Zero copy sockets support");
 
 struct netsend_cow_stats {
 	int attempted;
Index: kern/uipc_mqueue.c
===================================================================
--- kern/uipc_mqueue.c	(Revision 218482)
+++ kern/uipc_mqueue.c	(Arbeitskopie)
@@ -82,6 +82,8 @@
 #include <sys/vnode.h>
 #include <machine/atomic.h>
 
+FEATURE(p1003_1b_mqueue, "POSIX P1003.1B message queues support");
+
 /*
  * Limits and constants
  */
Index: kern/uipc_sem.c
===================================================================
--- kern/uipc_sem.c	(Revision 218482)
+++ kern/uipc_sem.c	(Arbeitskopie)
@@ -65,6 +65,7 @@
 
 #include <security/mac/mac_framework.h>
 
+FEATURE(p1003_1b_semaphores, "POSIX1003.1B semaphores support");
 /*
  * TODO
  *
Index: nfsclient/nfs_vfsops.c
===================================================================
--- nfsclient/nfs_vfsops.c	(Revision 218482)
+++ nfsclient/nfs_vfsops.c	(Arbeitskopie)
@@ -78,6 +78,8 @@
 #include <nfsclient/nfsm_subs.h>
 #include <nfsclient/nfsdiskless.h>
 
+FEATURE(nfsclient, "NFS client");
+
 MALLOC_DEFINE(M_NFSREQ, "nfsclient_req", "NFS request header");
 MALLOC_DEFINE(M_NFSBIGFH, "nfsclient_bigfh", "NFS version 3 file handle");
 MALLOC_DEFINE(M_NFSDIROFF, "nfsclient_diroff", "NFS directory offset data");
Index: nfsserver/nfs_serv.c
===================================================================
--- nfsserver/nfs_serv.c	(Revision 218482)
+++ nfsserver/nfs_serv.c	(Arbeitskopie)
@@ -97,6 +97,8 @@
 #include <nfs/xdr_subs.h>
 #include <nfsserver/nfsm_subs.h>
 
+FEATURE(nfsserver, "NFS server");
+
 #ifdef NFSRV_DEBUG
 #define nfsdbprintf(info)	printf info
 #else
Index: security/audit/audit.c
===================================================================
--- security/audit/audit.c	(Revision 218482)
+++ security/audit/audit.c	(Arbeitskopie)
@@ -72,6 +72,8 @@
 
 #include <vm/uma.h>
 
+FEATURE(audit, "BSM audit support");
+
 static uma_zone_t	audit_record_zone;
 static MALLOC_DEFINE(M_AUDITCRED, "audit_cred", "Audit cred storage");
 MALLOC_DEFINE(M_AUDITDATA, "audit_data", "Audit data storage");
Index: security/mac/mac_syscalls.c
===================================================================
--- security/mac/mac_syscalls.c	(Revision 218482)
+++ security/mac/mac_syscalls.c	(Arbeitskopie)
@@ -56,6 +56,7 @@
 #include <sys/mac.h>
 #include <sys/proc.h>
 #include <sys/systm.h>
+#include <sys/sysctl.h>
 #include <sys/sysproto.h>
 #include <sys/sysent.h>
 #include <sys/vnode.h>
@@ -72,6 +73,8 @@
 
 #ifdef MAC
 
+FEATURE(mac, "Mandatory Access Control support");
+
 int
 __mac_get_pid(struct thread *td, struct __mac_get_pid_args *uap)
 {

--=_3y2cjioe7e80--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20110211103028.12684f54yrw8tgqo>