freebsd-skq/sys
rwatson 2b82cd24f1 Make similar changes to fo_stat() and fo_poll() as made earlier to
fo_read() and fo_write(): explicitly use the cred argument to fo_poll()
as "active_cred" using the passed file descriptor's f_cred reference
to provide access to the file credential.  Add an active_cred
argument to fo_stat() so that implementers have access to the active
credential as well as the file credential.  Generally modify callers
of fo_stat() to pass in td->td_ucred rather than fp->f_cred, which
was redundantly provided via the fp argument.  This set of modifications
also permits threads to perform these operations on behalf of another
thread without modifying their credential.

Trickle this change down into fo_stat/poll() implementations:

- badfo_poll(), badfo_stat(): modify/add arguments.
- kqueue_poll(), kqueue_stat(): modify arguments.
- pipe_poll(), pipe_stat(): modify/add arguments, pass active_cred to
  MAC checks rather than td->td_ucred.
- soo_poll(), soo_stat(): modify/add arguments, pass fp->f_cred rather
  than cred to pru_sopoll() to maintain current semantics.
- sopoll(): moidfy arguments.
- vn_poll(), vn_statfile(): modify/add arguments, pass new arguments
  to vn_stat().  Pass active_cred to MAC and fp->f_cred to VOP_POLL()
  to maintian current semantics.
- vn_close(): rename cred to file_cred to reflect reality while I'm here.
- vn_stat(): Add active_cred and file_cred arguments to vn_stat()
  and consumers so that this distinction is maintained at the VFS
  as well as 'struct file' layer.  Pass active_cred instead of
  td->td_ucred to MAC and to VOP_GETATTR() to maintain current semantics.

- fifofs: modify the creation of a "filetemp" so that the file
  credential is properly initialized and can be used in the socket
  code if desired.  Pass ap->a_td->td_ucred as the active
  credential to soo_poll().  If we teach the vnop interface about
  the distinction between file and active credentials, we would use
  the active credential here.

Note that current inconsistent passing of active_cred vs. file_cred to
VOP's is maintained.  It's not clear why GETATTR would be authorized
using active_cred while POLL would be authorized using file_cred at
the file system level.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, NAI Labs
2002-08-16 12:52:03 +00:00
..
alpha Make similar changes to fo_stat() and fo_poll() as made earlier to 2002-08-16 12:52:03 +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 cam_extend.[ch] after all references to them were removed. 2002-08-15 20:55:38 +00:00
coda Fix typo in the last revision. 2002-08-04 19:34:38 +00:00
compat Make similar changes to fo_stat() and fo_poll() as made earlier to 2002-08-16 12:52:03 +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 MFNetBSD: 1.51 2002-08-16 12:16:07 +00:00
fs Make similar changes to fo_stat() and fo_poll() as made earlier to 2002-08-16 12:52:03 +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 Correct a minor whitespace nit that sneaked in with my previous commit. 2002-08-15 21:41:20 +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 Make similar changes to fo_stat() and fo_poll() as made earlier to 2002-08-16 12:52:03 +00:00
libkern Convert GNU variadic macros to the ISO 9X variety. 2002-07-15 13:34:50 +00:00
modules Remove cam_extend.c from sources to unbreak modules. 2002-08-15 21:41:59 +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 sys/netinet/ip_fw2.c: 2002-08-16 10:31:47 +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 Remove a case of exposing 'struct ucred' to userspace. Use a struct xucred 2002-08-15 21:52:22 +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 UHCI_DEBUG -> USB_DEBUG. 2002-08-15 22:41:20 +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 Use symbolic constants instead of magic address constants. 2002-08-16 01:37:49 +00:00
sys Make similar changes to fo_stat() and fo_poll() as made earlier to 2002-08-16 12:52:03 +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