]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Second-to-last commit implementing Capsicum capabilities in the FreeBSD
authorrwatson <rwatson@FreeBSD.org>
Thu, 11 Aug 2011 12:30:23 +0000 (12:30 +0000)
committerrwatson <rwatson@FreeBSD.org>
Thu, 11 Aug 2011 12:30:23 +0000 (12:30 +0000)
commit4af919b491560ff051b65cdf1ec730bdeb820b2e
tree4b691c0e209134040c3cf5ce75660b61282933d0
parentb3f993efadd59e4731fbd8ece5b71425df684b2d
Second-to-last commit implementing Capsicum capabilities in the FreeBSD
kernel for FreeBSD 9.0:

Add a new capability mask argument to fget(9) and friends, allowing system
call code to declare what capabilities are required when an integer file
descriptor is converted into an in-kernel struct file *.  With options
CAPABILITIES compiled into the kernel, this enforces capability
protection; without, this change is effectively a no-op.

Some cases require special handling, such as mmap(2), which must preserve
information about the maximum rights at the time of mapping in the memory
map so that they can later be enforced in mprotect(2) -- this is done by
narrowing the rights in the existing max_protection field used for similar
purposes with file permissions.

In namei(9), we assert that the code is not reached from within capability
mode, as we're not yet ready to enforce namespace capabilities there.
This will follow in a later commit.

Update two capability names: CAP_EVENT and CAP_KEVENT become
CAP_POST_KEVENT and CAP_POLL_KEVENT to more accurately indicate what they
represent.

Approved by: re (bz)
Submitted by: jonathan
Sponsored by: Google Inc
56 files changed:
sys/amd64/linux32/linux32_machdep.c
sys/cddl/compat/opensolaris/sys/file.h
sys/compat/freebsd32/freebsd32_ioctl.c
sys/compat/linux/linux_file.c
sys/compat/linux/linux_ioctl.c
sys/compat/linux/linux_socket.c
sys/compat/linux/linux_stats.c
sys/compat/svr4/svr4_fcntl.c
sys/compat/svr4/svr4_filio.c
sys/compat/svr4/svr4_ioctl.c
sys/compat/svr4/svr4_misc.c
sys/compat/svr4/svr4_stream.c
sys/dev/aac/aac_linux.c
sys/dev/amr/amr_linux.c
sys/dev/hwpmc/hwpmc_logging.c
sys/dev/ipmi/ipmi_linux.c
sys/dev/iscsi/initiator/iscsi.c
sys/dev/mfi/mfi_linux.c
sys/dev/snp/snp.c
sys/dev/tdfx/tdfx_linux.c
sys/fs/coda/coda_psdev.c
sys/fs/fdescfs/fdesc_vnops.c
sys/fs/nfsclient/nfs_clport.c
sys/fs/nfsserver/nfs_nfsdport.c
sys/fs/portalfs/portal_vfsops.c
sys/fs/portalfs/portal_vnops.c
sys/gnu/fs/xfs/xfs_dfrag.c
sys/i386/ibcs2/ibcs2_fcntl.c
sys/i386/ibcs2/ibcs2_ioctl.c
sys/i386/ibcs2/ibcs2_misc.c
sys/i386/linux/linux_machdep.c
sys/kern/kern_descrip.c
sys/kern/kern_event.c
sys/kern/kern_exec.c
sys/kern/sys_capability.c
sys/kern/sys_generic.c
sys/kern/tty.c
sys/kern/uipc_mqueue.c
sys/kern/uipc_sem.c
sys/kern/uipc_syscalls.c
sys/kern/vfs_acl.c
sys/kern/vfs_aio.c
sys/kern/vfs_extattr.c
sys/kern/vfs_lookup.c
sys/kern/vfs_syscalls.c
sys/netgraph/ng_socket.c
sys/nfsserver/nfs_srvkrpc.c
sys/security/audit/audit_arg.c
sys/security/mac/mac_syscalls.c
sys/sys/capability.h
sys/sys/file.h
sys/sys/filedesc.h
sys/ufs/ffs/ffs_alloc.c
sys/vm/vm_mmap.c
tools/regression/security/cap_test/cap_test.c
tools/regression/security/cap_test/cap_test_capabilities.c