freebsd-dev/sys/alpha
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
compile Don't need the .keep_me files. Obrien and I committed past each other. 2001-07-01 23:35:44 +00:00
conf Add support for the LSI-Logic Fusion/MP architecture. 2002-08-11 23:34:20 +00:00
include o Introduce pmap_page_is_mapped(). Its purpose is to obsolete 2002-08-07 18:03:00 +00:00
isa Tidy up some loose ends. 2002-04-29 07:43:16 +00:00
linux Infrastructure tweaks to allow having both an Elf32 and an Elf64 executable 2002-07-20 02:56:12 +00:00
mcbus Initialise the AS4100 console at the same time as most of the other 2002-03-26 19:46:40 +00:00
osf1 - Hold the vnode lock throughout execve. 2002-08-13 06:55:28 +00:00
pci Remove ## concatination in the CFGREAD and CFGWRITE macros, as gcc3 complains 2002-05-10 16:56:14 +00:00
tlsb Change the suser() API to take advantage of td_ucred as well as do a 2002-04-01 21:31:13 +00:00
Makefile Add a dopey makefile to do the tags dance, which is probably not perfect 2000-12-31 23:26:34 +00:00