freebsd-skq/sys
Robert Watson 9ca435893b In order to better support flexible and extensible access control,
make a series of modifications to the credential arguments relating
to file read and write operations to cliarfy which credential is
used for what:

- Change fo_read() and fo_write() to accept "active_cred" instead of
  "cred", and change the semantics of consumers of fo_read() and
  fo_write() to pass the active credential of the thread requesting
  an operation rather than the cached file cred.  The cached file
  cred is still available in fo_read() and fo_write() consumers
  via fp->f_cred.  These changes largely in sys_generic.c.

For each implementation of fo_read() and fo_write(), update cred
usage to reflect this change and maintain current semantics:

- badfo_readwrite() unchanged
- kqueue_read/write() unchanged
  pipe_read/write() now authorize MAC using active_cred rather
  than td->td_ucred
- soo_read/write() unchanged
- vn_read/write() now authorize MAC using active_cred but
  VOP_READ/WRITE() with fp->f_cred

Modify vn_rdwr() to accept two credential arguments instead of a
single credential: active_cred and file_cred.  Use active_cred
for MAC authorization, and select a credential for use in
VOP_READ/WRITE() based on whether file_cred is NULL or not.  If
file_cred is provided, authorize the VOP using that cred,
otherwise the active credential, matching current semantics.

Modify current vn_rdwr() consumers to pass a file_cred if used
in the context of a struct file, and to always pass active_cred.
When vn_rdwr() is used without a file_cred, pass NOCRED.

These changes should maintain current semantics for read/write,
but avoid a redundant passing of fp->f_cred, as well as making
it more clear what the origin of each credential is in file
descriptor read/write operations.

Follow-up commits will make similar changes to other file descriptor
operations, and modify the MAC framework to pass both credentials
to MAC policy modules so they can implement either semantic for
revocation.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, NAI Labs
2002-08-15 20:55:08 +00:00
..
alpha In order to better support flexible and extensible access control, 2002-08-15 20:55:08 +00:00
amd64 In order to better support flexible and extensible access control, 2002-08-15 20:55:08 +00:00
arm Create a new header <machine/_stdint.h> for storing MD parts of 2002-07-29 17:41:23 +00:00
boot mdoc(7) police: Get rid of hard sentence breaks. 2002-08-13 15:09:33 +00:00
cam Remove usage of cam_extend.c, replace with dev->si_drv1 2002-08-15 20:54:03 +00:00
coda Fix typo in the last revision. 2002-08-04 19:34:38 +00:00
compat In order to better support flexible and extensible access control, 2002-08-15 20:55:08 +00:00
conf Remove usage of cam_extend.c, replace with dev->si_drv1 2002-08-15 20:54:03 +00:00
contrib Resolve conflicts arising from the ACPI CA 20020725 import. 2002-07-30 19:35:32 +00:00
crypto Fix some really pedantic GCC warnings. 2002-07-15 13:45:15 +00:00
ddb When talking about c_db_sym_t, mention that it is not just like db_sym_t: 2002-08-14 17:56:47 +00:00
dev pccbb -> cbb 2002-08-15 08:02:23 +00:00
fs Fixed 64bit big endian bugs relating to abuse of ioctl argument passing. 2002-08-15 06:16:10 +00:00
geom Don't use the static thread.. it is going away. 2002-06-29 07:47:20 +00:00
gnu In order to better support flexible and extensible access control, 2002-08-15 20:55:08 +00:00
i4b add support properly displaying and logging incoming telephone numbers (MSNs) 2002-08-12 07:53:55 +00:00
i386 In order to better support flexible and extensible access control, 2002-08-15 20:55:08 +00:00
ia64 In order to better support flexible and extensible access control, 2002-08-15 20:55:08 +00:00
isa Clock frequencies reported by sysctl should be unsigned values. Discovered 2002-06-22 16:30:18 +00:00
isofs/cd9660 Introduce typedefs for the member functions of struct vfsops and employ 2002-08-13 10:05:50 +00:00
kern In order to better support flexible and extensible access control, 2002-08-15 20:55:08 +00:00
libkern Convert GNU variadic macros to the ISO 9X variety. 2002-07-15 13:34:50 +00:00
modules Depend on opt_mac.h. 2002-08-12 15:27:17 +00:00
net Move mac.h include to match the MAC tree location. Both locations 2002-08-15 19:02:17 +00:00
netatalk Introduce experimental support for MAC in the AppleTalk/EtherTalk stack. 2002-08-15 18:58:44 +00:00
netatm - Remove UM_* user land memory macros since they are no longer used. 2002-06-24 22:31:17 +00:00
netgraph Make the consumers of the linker_load_file() function use 2002-08-02 20:56:07 +00:00
netinet Rename mac_check_socket_receive() to mac_check_socket_deliver() so that 2002-08-15 18:51:27 +00:00
netinet6 Introduce support for Mandatory Access Control and extensible 2002-08-02 20:49:14 +00:00
netipx Make spxnames a const char * to quieten some warnings in netstat. 2002-07-27 23:15:08 +00:00
netkey - fixed the order of searching SA table for packets. 2002-07-10 16:39:38 +00:00
netnatm Back out my lats commit of locking down a socket, it conflicts with hsu's work. 2002-05-31 11:52:35 +00:00
netncp Wire the sysctl output buffer before grabbing any locks to prevent 2002-07-28 19:59:31 +00:00
netns Fix bug which has been there since rev 1.1 where && was used instead of &. 2002-06-09 03:57:34 +00:00
netsmb Wire the sysctl output buffer before grabbing any locks to prevent 2002-07-28 19:59:31 +00:00
nfs
nfsclient In order to better support flexible and extensible access control, 2002-08-15 20:55:08 +00:00
nfsserver - Replace v_flag with v_iflag and v_vflag 2002-08-04 10:29:36 +00:00
pc98 MFi386: revisions 1.354 and 1.356. 2002-08-13 12:25:01 +00:00
pccard Add 16-bit before bus to keep the words card and bus apart. 2002-07-31 20:01:11 +00:00
pci Improve handling of TX errors. Early reports indicate that this 2002-08-15 04:04:53 +00:00
posix4 Part 1 of KSE-III 2002-06-29 17:26:22 +00:00
powerpc In order to better support flexible and extensible access control, 2002-08-15 20:55:08 +00:00
rpc
security Rename mac_check_socket_receive() to mac_check_socket_deliver() so that 2002-08-15 18:51:27 +00:00
sparc64 Fix some confusion regarding traps that use mmu globals but don't really 2002-08-15 05:46:42 +00:00
sys In order to better support flexible and extensible access control, 2002-08-15 20:55:08 +00:00
tools - Add automatic post vop debug checks. These work in both the success and 2002-07-30 08:52:00 +00:00
ufs In order to better support flexible and extensible access control, 2002-08-15 20:55:08 +00:00
vm o Assert that the page queues lock is held in vm_page_activate(). 2002-08-11 00:21:40 +00:00
Makefile Milestone #1 in cross-arch make releases. 2002-04-26 17:55:27 +00:00