aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/imgact_aout.c
diff options
context:
space:
mode:
authorRobert Watson <rwatson@FreeBSD.org>2002-08-15 20:55:08 +0000
committerRobert Watson <rwatson@FreeBSD.org>2002-08-15 20:55:08 +0000
commit9ca435893bcf251039e2d35cd2ffd29603597559 (patch)
tree09f20587d6bc57d661c96f87771a6081e65d834f /sys/kern/imgact_aout.c
parente2a5fdf9117c50fdd503f405f77381d38ed609b2 (diff)
downloadsrc-9ca435893bcf251039e2d35cd2ffd29603597559.tar.gz
src-9ca435893bcf251039e2d35cd2ffd29603597559.zip
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
Notes
Notes: svn path=/head/; revision=101941
Diffstat (limited to 'sys/kern/imgact_aout.c')
-rw-r--r--sys/kern/imgact_aout.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/imgact_aout.c b/sys/kern/imgact_aout.c
index 48eed907c799..9573928d9fea 100644
--- a/sys/kern/imgact_aout.c
+++ b/sys/kern/imgact_aout.c
@@ -268,14 +268,14 @@ aout_coredump(td, vp, limit)
error = vn_rdwr(UIO_WRITE, vp, vm->vm_daddr,
(int)ctob(vm->vm_dsize),
(off_t)ctob(UAREA_PAGES + KSTACK_PAGES), UIO_USERSPACE,
- IO_UNIT | IO_DIRECT, cred, (int *) NULL, td);
+ IO_UNIT | IO_DIRECT, cred, NOCRED, (int *) NULL, td);
if (error == 0)
error = vn_rdwr_inchunks(UIO_WRITE, vp,
(caddr_t) trunc_page(USRSTACK - ctob(vm->vm_ssize)),
round_page(ctob(vm->vm_ssize)),
(off_t)ctob(UAREA_PAGES + KSTACK_PAGES) +
ctob(vm->vm_dsize), UIO_USERSPACE,
- IO_UNIT | IO_DIRECT, cred, (int *) NULL, td);
+ IO_UNIT | IO_DIRECT, cred, NOCRED, (int *) NULL, td);
return (error);
}