diff options
author | netchild <netchild@FreeBSD.org> | 2011-02-25 10:11:01 +0000 |
---|---|---|
committer | netchild <netchild@FreeBSD.org> | 2011-02-25 10:11:01 +0000 |
commit | cc4128c6b1ffcb09a70e70959874cc2bb6e81d0e (patch) | |
tree | 777029c0673c0c489ae84b9e4b20c9e41ad56aac /sys | |
parent | 86423932a67f9fb0a4432c59110644406f829c52 (diff) | |
download | FreeBSD-src-cc4128c6b1ffcb09a70e70959874cc2bb6e81d0e.zip FreeBSD-src-cc4128c6b1ffcb09a70e70959874cc2bb6e81d0e.tar.gz |
Add some FEATURE macros for various features (AUDIT/CAM/IPC/KTR/MAC/NFS/NTP/
PMC/SYSV/...).
No FreeBSD version bump, the userland application to query the features will
be committed last and can serve as an indication of the availablility if
needed.
Sponsored by: Google Summer of Code 2010
Submitted by: kibab
Reviewed by: arch@ (parts by rwatson, trasz, jhb)
X-MFC after: to be determined in last commit with code from this project
Diffstat (limited to 'sys')
-rw-r--r-- | sys/cam/cam.c | 3 | ||||
-rw-r--r-- | sys/fs/nfsclient/nfs_clvfsops.c | 2 | ||||
-rw-r--r-- | sys/fs/nfsserver/nfs_nfsdport.c | 2 | ||||
-rw-r--r-- | sys/kern/kern_dtrace.c | 4 | ||||
-rw-r--r-- | sys/kern/kern_ktr.c | 2 | ||||
-rw-r--r-- | sys/kern/kern_ktrace.c | 2 | ||||
-rw-r--r-- | sys/kern/kern_lock.c | 4 | ||||
-rw-r--r-- | sys/kern/kern_ntptime.c | 4 | ||||
-rw-r--r-- | sys/kern/kern_pmc.c | 2 | ||||
-rw-r--r-- | sys/kern/kern_prot.c | 5 | ||||
-rw-r--r-- | sys/kern/ksched.c | 4 | ||||
-rw-r--r-- | sys/kern/subr_mchain.c | 3 | ||||
-rw-r--r-- | sys/kern/subr_stack.c | 3 | ||||
-rw-r--r-- | sys/kern/sysv_msg.c | 2 | ||||
-rw-r--r-- | sys/kern/sysv_sem.c | 2 | ||||
-rw-r--r-- | sys/kern/sysv_shm.c | 2 | ||||
-rw-r--r-- | sys/kern/uipc_cow.c | 2 | ||||
-rw-r--r-- | sys/kern/uipc_mqueue.c | 2 | ||||
-rw-r--r-- | sys/kern/uipc_sem.c | 1 | ||||
-rw-r--r-- | sys/nfsclient/nfs_vfsops.c | 2 | ||||
-rw-r--r-- | sys/nfsserver/nfs_serv.c | 2 | ||||
-rw-r--r-- | sys/security/audit/audit.c | 2 | ||||
-rw-r--r-- | sys/security/mac/mac_syscalls.c | 3 |
23 files changed, 60 insertions, 0 deletions
diff --git a/sys/cam/cam.c b/sys/cam/cam.c index b3c9023..4445d03 100644 --- a/sys/cam/cam.c +++ b/sys/cam/cam.c @@ -51,6 +51,9 @@ __FBSDID("$FreeBSD$"); #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); diff --git a/sys/fs/nfsclient/nfs_clvfsops.c b/sys/fs/nfsclient/nfs_clvfsops.c index b2d4864..d819527 100644 --- a/sys/fs/nfsclient/nfs_clvfsops.c +++ b/sys/fs/nfsclient/nfs_clvfsops.c @@ -73,6 +73,8 @@ __FBSDID("$FreeBSD$"); #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; diff --git a/sys/fs/nfsserver/nfs_nfsdport.c b/sys/fs/nfsserver/nfs_nfsdport.c index ab04ff0..9b9cd06 100644 --- a/sys/fs/nfsserver/nfs_nfsdport.c +++ b/sys/fs/nfsserver/nfs_nfsdport.c @@ -46,6 +46,8 @@ __FBSDID("$FreeBSD$"); #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; diff --git a/sys/kern/kern_dtrace.c b/sys/kern/kern_dtrace.c index 603b4cf..2082fed 100644 --- a/sys/kern/kern_dtrace.c +++ b/sys/kern/kern_dtrace.c @@ -37,10 +37,14 @@ __FBSDID("$FreeBSD$"); #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. */ diff --git a/sys/kern/kern_ktr.c b/sys/kern/kern_ktr.c index 2fc2acc..2e5e06f 100644 --- a/sys/kern/kern_ktr.c +++ b/sys/kern/kern_ktr.c @@ -80,6 +80,8 @@ __FBSDID("$FreeBSD$"); #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; diff --git a/sys/kern/kern_ktrace.c b/sys/kern/kern_ktrace.c index 6e2285b..5ff96c3 100644 --- a/sys/kern/kern_ktrace.c +++ b/sys/kern/kern_ktrace.c @@ -83,6 +83,8 @@ static MALLOC_DEFINE(M_KTRACE, "KTRACE", "KTRACE"); #ifdef KTRACE +FEATURE(ktrace, "Kernel support for system-call tracing"); + #ifndef KTRACE_REQUEST_POOL #define KTRACE_REQUEST_POOL 100 #endif diff --git a/sys/kern/kern_lock.c b/sys/kern/kern_lock.c index 290da05..8e5546e 100644 --- a/sys/kern/kern_lock.c +++ b/sys/kern/kern_lock.c @@ -1299,6 +1299,10 @@ lockstatus(struct lock *lk) } #ifdef INVARIANT_SUPPORT + +FEATURE(invariant_support, + "Support for modules compiled with INVARIANTS option"); + #ifndef INVARIANTS #undef _lockmgr_assert #endif diff --git a/sys/kern/kern_ntptime.c b/sys/kern/kern_ntptime.c index 4050baf..9ca3690 100644 --- a/sys/kern/kern_ntptime.c +++ b/sys/kern/kern_ntptime.c @@ -51,6 +51,10 @@ __FBSDID("$FreeBSD$"); #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 */ diff --git a/sys/kern/kern_pmc.c b/sys/kern/kern_pmc.c index 4e3fe75..7532378 100644 --- a/sys/kern/kern_pmc.c +++ b/sys/kern/kern_pmc.c @@ -37,8 +37,10 @@ __FBSDID("$FreeBSD$"); #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 diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c index 16b0f37..4506034 100644 --- a/sys/kern/kern_prot.c +++ b/sys/kern/kern_prot.c @@ -69,6 +69,11 @@ __FBSDID("$FreeBSD$"); #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> diff --git a/sys/kern/ksched.c b/sys/kern/ksched.c index 2d11363..7ee56d5 100644 --- a/sys/kern/ksched.c +++ b/sys/kern/ksched.c @@ -41,12 +41,16 @@ __FBSDID("$FreeBSD$"); #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. */ diff --git a/sys/kern/subr_mchain.c b/sys/kern/subr_mchain.c index 5989cbf..e40e5ff 100644 --- a/sys/kern/subr_mchain.c +++ b/sys/kern/subr_mchain.c @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #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 @@ __FBSDID("$FreeBSD$"); #include <sys/mchain.h> +FEATURE(libmchain, "mchain library"); + MODULE_VERSION(libmchain, 1); #define MBERROR(format, ...) printf("%s(%d): "format, __func__ , \ diff --git a/sys/kern/subr_stack.c b/sys/kern/subr_stack.c index b719b71..c26dad8 100644 --- a/sys/kern/subr_stack.c +++ b/sys/kern/subr_stack.c @@ -39,6 +39,9 @@ __FBSDID("$FreeBSD$"); #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"); diff --git a/sys/kern/sysv_msg.c b/sys/kern/sysv_msg.c index a5291db..ace2eab 100644 --- a/sys/kern/sysv_msg.c +++ b/sys/kern/sysv_msg.c @@ -72,6 +72,8 @@ __FBSDID("$FreeBSD$"); #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); diff --git a/sys/kern/sysv_sem.c b/sys/kern/sysv_sem.c index 9678f93..d51fbee 100644 --- a/sys/kern/sysv_sem.c +++ b/sys/kern/sysv_sem.c @@ -62,6 +62,8 @@ __FBSDID("$FreeBSD$"); #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 diff --git a/sys/kern/sysv_shm.c b/sys/kern/sysv_shm.c index 11d050e..5ea9e5d 100644 --- a/sys/kern/sysv_shm.c +++ b/sys/kern/sysv_shm.c @@ -95,6 +95,8 @@ __FBSDID("$FreeBSD$"); #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, diff --git a/sys/kern/uipc_cow.c b/sys/kern/uipc_cow.c index 12404b5..654b6d7 100644 --- a/sys/kern/uipc_cow.c +++ b/sys/kern/uipc_cow.c @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #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 @@ __FBSDID("$FreeBSD$"); #include <vm/vm_page.h> #include <vm/vm_object.h> +FEATURE(zero_copy_sockets, "Zero copy sockets support"); struct netsend_cow_stats { int attempted; diff --git a/sys/kern/uipc_mqueue.c b/sys/kern/uipc_mqueue.c index 30c1aa9..f757cc5 100644 --- a/sys/kern/uipc_mqueue.c +++ b/sys/kern/uipc_mqueue.c @@ -82,6 +82,8 @@ __FBSDID("$FreeBSD$"); #include <sys/vnode.h> #include <machine/atomic.h> +FEATURE(p1003_1b_mqueue, "POSIX P1003.1B message queues support"); + /* * Limits and constants */ diff --git a/sys/kern/uipc_sem.c b/sys/kern/uipc_sem.c index 5270078..cef2fac 100644 --- a/sys/kern/uipc_sem.c +++ b/sys/kern/uipc_sem.c @@ -65,6 +65,7 @@ __FBSDID("$FreeBSD$"); #include <security/mac/mac_framework.h> +FEATURE(p1003_1b_semaphores, "POSIX1003.1B semaphores support"); /* * TODO * diff --git a/sys/nfsclient/nfs_vfsops.c b/sys/nfsclient/nfs_vfsops.c index 3700708..1f6ba8c 100644 --- a/sys/nfsclient/nfs_vfsops.c +++ b/sys/nfsclient/nfs_vfsops.c @@ -78,6 +78,8 @@ __FBSDID("$FreeBSD$"); #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"); diff --git a/sys/nfsserver/nfs_serv.c b/sys/nfsserver/nfs_serv.c index 5614ea4..1b9dd98 100644 --- a/sys/nfsserver/nfs_serv.c +++ b/sys/nfsserver/nfs_serv.c @@ -97,6 +97,8 @@ __FBSDID("$FreeBSD$"); #include <nfs/xdr_subs.h> #include <nfsserver/nfsm_subs.h> +FEATURE(nfsserver, "NFS server"); + #ifdef NFSRV_DEBUG #define nfsdbprintf(info) printf info #else diff --git a/sys/security/audit/audit.c b/sys/security/audit/audit.c index 40daaa9..1799f16 100644 --- a/sys/security/audit/audit.c +++ b/sys/security/audit/audit.c @@ -72,6 +72,8 @@ __FBSDID("$FreeBSD$"); #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"); diff --git a/sys/security/mac/mac_syscalls.c b/sys/security/mac/mac_syscalls.c index 905c43b..6376c1b 100644 --- a/sys/security/mac/mac_syscalls.c +++ b/sys/security/mac/mac_syscalls.c @@ -56,6 +56,7 @@ __FBSDID("$FreeBSD$"); #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 @@ __FBSDID("$FreeBSD$"); #ifdef MAC +FEATURE(mac, "Mandatory Access Control Framework support"); + int __mac_get_pid(struct thread *td, struct __mac_get_pid_args *uap) { |