freebsd-dev/sys/powerpc/powerpc
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
..
atomic.s This commit (along with one pending in sys/dev/ofw and one in sys/conf) give 2001-06-16 07:14:07 +00:00
atomic.S This commit (along with one pending in sys/dev/ofw and one in sys/conf) give 2001-06-16 07:14:07 +00:00
autoconf.c Add BOOTP_NFSROOT support code. 2002-06-29 09:33:18 +00:00
bcopy.c mempcy/bcopy handles overlapping copies so make ovbcopy call it. 2002-06-29 09:34:54 +00:00
busdma_machdep.c 1) Add busdma machdep code. 2002-07-09 12:47:14 +00:00
clock.c Many fixes to low-level trap and interrupt handling: 2002-06-29 09:28:21 +00:00
copyinout.c Deorbit suibyte(). It was only used for split address space systems 2002-06-20 07:13:35 +00:00
copystr.c Bring in NetBSD code used in the PowerPC port. 2001-06-10 02:39:37 +00:00
critical.c Stage-2 commit of the critical*() code. This re-inlines cpu_critical_enter() 2002-04-01 23:51:23 +00:00
db_disasm.c Add DDB support. 2002-07-10 12:21:54 +00:00
db_hwwatch.c Add DDB support. 2002-07-10 12:21:54 +00:00
db_interface.c Add DDB support. 2002-07-10 12:21:54 +00:00
db_memrw.c Add DDB support. 2002-07-10 12:21:54 +00:00
db_trace.c Add DDB support. 2002-07-10 12:21:54 +00:00
elf_machdep.c Infrastructure tweaks to allow having both an Elf32 and an Elf64 executable 2002-07-20 02:56:12 +00:00
extintr.c Remove __P. 2002-03-20 23:17:50 +00:00
fpu.c Fix commenting around NetBSD version string. 2002-05-17 01:41:01 +00:00
fuswintr.c Complete rework of the PowerPC pmap and a number of other bits in the early 2002-02-14 01:39:11 +00:00
genassym.c Set the thread state of the newly chosen to run thread to TDS_RUNNING in 2002-07-12 18:34:22 +00:00
in_cksum.c in_cksum et al. 2002-06-29 09:49:26 +00:00
interrupt.c Many fixes to low-level trap and interrupt handling: 2002-06-29 09:28:21 +00:00
intr_machdep.c Add interrupt handling support code. 2002-07-09 11:12:20 +00:00
locore.s - Make sure we don't trample our metadata pointer in our initial bootstrap. 2002-07-10 12:16:48 +00:00
locore.S - Make sure we don't trample our metadata pointer in our initial bootstrap. 2002-07-10 12:16:48 +00:00
machdep.c Add DDB support. 2002-07-10 12:21:54 +00:00
mmu_oea.c o Don't set PG_MAPPED or PG_WRITEABLE when a page is mapped 2002-08-05 00:04:18 +00:00
mp_machdep.c - Do not handle the per-CPU containers in mbuf code as though the cpuids 2001-07-26 18:47:46 +00:00
nexus.c Remove some diagnostic code that snuck in. 2002-07-10 09:48:43 +00:00
ofw_machdep.c Add the OF_getetheraddr function required by if_gem. 2002-07-09 13:43:06 +00:00
ofwmagic.s Bring in NetBSD code used in the PowerPC port. 2001-06-10 02:39:37 +00:00
ofwmagic.S Bring in NetBSD code used in the PowerPC port. 2001-06-10 02:39:37 +00:00
openpic.c Remove some unused includes. 2002-07-10 09:46:24 +00:00
pic_if.m Add interrupt handling support code. 2002-07-09 11:12:20 +00:00
pmap.c o Don't set PG_MAPPED or PG_WRITEABLE when a page is mapped 2002-08-05 00:04:18 +00:00
setjmp.S Add setjmp (needed for DDB). 2002-07-10 12:26:17 +00:00
sigcode.S - Rename the _C_LABEL macro to CNAME. 2002-05-17 01:44:55 +00:00
suswintr.c Bring in NetBSD code used in the PowerPC port. 2001-06-10 02:39:37 +00:00
swtch.s Set the thread state of the newly chosen to run thread to TDS_RUNNING in 2002-07-12 18:34:22 +00:00
swtch.S Set the thread state of the newly chosen to run thread to TDS_RUNNING in 2002-07-12 18:34:22 +00:00
syncicache.c Remove __P. 2002-03-20 23:17:50 +00:00
sys_machdep.c Update PowerPC MD code to compile and do initial bootstrap based on 2001-09-20 00:47:17 +00:00
trap_subr.S Many fixes to low-level trap and interrupt handling: 2002-06-29 09:28:21 +00:00
trap.c Add additional cred_free_thread() calls that I had missed the first time. 2002-07-13 04:36:50 +00:00
vm_machdep.c In order to better support flexible and extensible access control, 2002-08-15 20:55:08 +00:00