freebsd-nq/sys/nfsclient
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
..
bootp_subr.c Back out my lats commit of locking down a socket, it conflicts with hsu's work. 2002-05-31 11:52:35 +00:00
krpc_subr.c Simple p_ucred -> td_ucred changes to start using the per-thread ucred 2002-02-27 18:32:23 +00:00
krpc.h Cleanup and split of nfs client and server code. 2001-09-18 23:32:09 +00:00
nfs_bio.c - Replace v_flag with v_iflag and v_vflag 2002-08-04 10:29:36 +00:00
nfs_lock.c In order to better support flexible and extensible access control, 2002-08-15 20:55:08 +00:00
nfs_lock.h Add IPv6 support. 2002-07-15 19:40:23 +00:00
nfs_nfsiod.c Convert old style (type foo *)0 casts to NULLs 2002-07-11 17:54:58 +00:00
nfs_node.c Convert old style (type foo *)0 casts to NULLs 2002-07-11 17:54:58 +00:00
nfs_socket.c If we get a receive error in nfs_receive() and then get an error trying to 2002-07-16 15:12:07 +00:00
nfs_subs.c Convert old style (type foo *)0 casts to NULLs 2002-07-11 17:54:58 +00:00
nfs_vfsops.c Introduce typedefs for the member functions of struct vfsops and employ 2002-08-13 10:05:50 +00:00
nfs_vnops.c - Add a missing VI_UNLOCK to an error case in nfs_flush. 2002-08-05 08:54:29 +00:00
nfs.h Introduce typedefs for the member functions of struct vfsops and employ 2002-08-13 10:05:50 +00:00
nfsargs.h Allow users to use the 'nolockd' or -L options with mount_nfs in order 2001-11-12 02:33:52 +00:00
nfsdiskless.h Fix warnings.. bootpc_init() and related. 2002-02-28 03:07:35 +00:00
nfsm_subs.h Avoid passing the variable `tl' to functions that just use it for 2001-12-18 01:22:09 +00:00
nfsmount.h o Make the credential used by socreate() an explicit argument to 2001-12-31 17:45:16 +00:00
nfsnode.h Remove the nfs_{lock,unlock,islocked} functions and the associated 2002-04-27 22:10:16 +00:00
nfsstats.h Cleanup and split of nfs client and server code. 2001-09-18 23:32:09 +00:00
nlminfo.h Cleanup and split of nfs client and server code. 2001-09-18 23:32:09 +00:00