Revision tags: release/4.7.0_cvs |
|
#
37c84183 |
| 28-Sep-2002 |
Poul-Henning Kamp <phk@FreeBSD.org> |
Be consistent about "static" functions: if the function is marked static in its prototype, mark it static at the definition too.
Inspired by: FlexeLint warning #512
|
#
2e45c1b1 |
| 20-Sep-2002 |
Poul-Henning Kamp <phk@FreeBSD.org> |
We don't need the <sys/disklabel.h> include for alpha anymore.
Sponsored by: DARPA & NAI Labs.
|
#
71fad9fd |
| 11-Sep-2002 |
Julian Elischer <julian@FreeBSD.org> |
Completely redo thread states.
Reviewed by: davidxu@freebsd.org
|
#
8f19eb88 |
| 01-Sep-2002 |
Ian Dowse <iedowse@FreeBSD.org> |
Split out a number of mostly VFS and signal related syscalls into a kernel-internal kern_*() version and a wrapper that is called via the syscall vector table. For paths and structure pointers, the i
Split out a number of mostly VFS and signal related syscalls into a kernel-internal kern_*() version and a wrapper that is called via the syscall vector table. For paths and structure pointers, the internal version either takes a uio_seg parameter or requires the caller to copyin() the data to kernel memory as appropiate. This will permit emulation layers to use these syscalls without having to copy out translated arguments to the stack gap.
Discussed on: -arch Review/suggestions: bde, jhb, peter, marcel
show more ...
|
#
2149c527 |
| 24-Aug-2002 |
Peter Wemm <peter@FreeBSD.org> |
Move the TAILQ_INIT(&td->td_selq) before the retry: label. Otherwise in some circumstances when we get a select collision, we can end up with cases where we do not clear some sip->si_thread on the w
Move the TAILQ_INIT(&td->td_selq) before the retry: label. Otherwise in some circumstances when we get a select collision, we can end up with cases where we do not clear some sip->si_thread on the way out, leading to page faults in selwakeup(). This should solve the problem where postfix can crash the kernel during select collisions.
Reviewed by: alfred
show more ...
|
#
d49fa1ca |
| 17-Aug-2002 |
Robert Watson <rwatson@FreeBSD.org> |
In continuation of early fileop credential changes, modify fo_ioctl() to accept an 'active_cred' argument reflecting the credential of the thread initiating the ioctl operation.
- Change fo_ioctl()
In continuation of early fileop credential changes, modify fo_ioctl() to accept an 'active_cred' argument reflecting the credential of the thread initiating the ioctl operation.
- Change fo_ioctl() to accept active_cred; change consumers of the fo_ioctl() interface to generally pass active_cred from td->td_ucred. - In fifofs, initialize filetmp.f_cred to ap->a_cred so that the invocations of soo_ioctl() are provided access to the calling f_cred. Pass ap->a_td->td_ucred as the active_cred, but note that this is required because we don't yet distinguish file_cred and active_cred in invoking VOP's. - Update kqueue_ioctl() for its new argument. - Update pipe_ioctl() for its new argument, pass active_cred rather than td_ucred to MAC for authorization. - Update soo_ioctl() for its new argument. - Update vn_ioctl() for its new argument, use active_cred rather than td->td_ucred to authorize VOP_IOCTL() and the associated VOP_GETATTR().
Obtained from: TrustedBSD Project Sponsored by: DARPA, NAI Labs
show more ...
|
#
ea6027a8 |
| 16-Aug-2002 |
Robert Watson <rwatson@FreeBSD.org> |
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 r
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
show more ...
|
#
9ca43589 |
| 15-Aug-2002 |
Robert Watson <rwatson@FreeBSD.org> |
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
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
show more ...
|
Revision tags: release/4.6.2_cvs, release/4.6.2 |
|
#
b605b54c |
| 24-Jul-2002 |
Alfred Perlstein <alfred@FreeBSD.org> |
Attempt to clarify comment in selrecord.
|
#
d452ec95 |
| 22-Jul-2002 |
Alfred Perlstein <alfred@FreeBSD.org> |
remove caddr_t from fo_ioctl calls
|
#
0a3e28cf |
| 22-Jul-2002 |
Alfred Perlstein <alfred@FreeBSD.org> |
remove caddr_t
|
Revision tags: release/4.6.1, release/4.6.0_cvs |
|
#
e602ba25 |
| 29-Jun-2002 |
Julian Elischer <julian@FreeBSD.org> |
Part 1 of KSE-III
The ability to schedule multiple threads per process (one one cpu) by making ALL system calls optionally asynchronous. to come: ia64 and power-pc patches, patches for gdb, test pro
Part 1 of KSE-III
The ability to schedule multiple threads per process (one one cpu) by making ALL system calls optionally asynchronous. to come: ia64 and power-pc patches, patches for gdb, test program (in tools)
Reviewed by: Almost everyone who counts (at various times, peter, jhb, matt, alfred, mini, bernd, and a cast of thousands)
NOTE: this is still Beta code, and contains lots of debugging stuff. expect slight instability in signals..
show more ...
|
#
c33c8251 |
| 20-Jun-2002 |
Alfred Perlstein <alfred@FreeBSD.org> |
Implement SO_NOSIGPIPE option for sockets. This allows one to request that an EPIPE error return not generate SIGPIPE on sockets.
Submitted by: lioux Inspired by: Darwin
|
#
c4bacc18 |
| 19-Jun-2002 |
Poul-Henning Kamp <phk@FreeBSD.org> |
Remove the compat bits for the mis-aligned struct disklabel on alpha, people got three times longer than I promised.
Sponsored by: DARPA & NAI Labs.
|
#
9ae6d334 |
| 12-Jun-2002 |
Kelly Yancey <kbyanc@FreeBSD.org> |
Make nselcol, the number of select collisions since boot, unsigned as negative collisions simply doesn't make sense.
PR: (one small part of) 19720 Approved by: alfred
|
#
60a9bb19 |
| 07-Jun-2002 |
John Baldwin <jhb@FreeBSD.org> |
Catch up to changes in ktrace API.
|
#
82641acd |
| 09-May-2002 |
Alan Cox <alc@FreeBSD.org> |
o Correct an error made in revision 1.65: In readv(), if uap->iovcnt is out-of-range, drop the file reference before returning. (This error also exists in the RELENG_4 branch.) o Eliminate th
o Correct an error made in revision 1.65: In readv(), if uap->iovcnt is out-of-range, drop the file reference before returning. (This error also exists in the RELENG_4 branch.) o Eliminate the acquisition and release of Giant in readv() now that malloc() and free() are callable without Giant.
show more ...
|
#
0b5d880d |
| 02-May-2002 |
Poul-Henning Kamp <phk@FreeBSD.org> |
As promised make the hack for sizeof(struct disklabel) on alpha annoying.
Run make world (or recompile whatever program whines) to get rid of warning.
Compat bits will be removed entirely in about
As promised make the hack for sizeof(struct disklabel) on alpha annoying.
Run make world (or recompile whatever program whines) to get rid of warning.
Compat bits will be removed entirely in about two weeks.
show more ...
|
#
6008862b |
| 04-Apr-2002 |
John Baldwin <jhb@FreeBSD.org> |
Change callers of mtx_init() to pass in an appropriate lock type name. In most cases NULL is passed, but in some cases such as network driver locks (which use the MTX_NETWORK_LOCK macro) and UMA zon
Change callers of mtx_init() to pass in an appropriate lock type name. In most cases NULL is passed, but in some cases such as network driver locks (which use the MTX_NETWORK_LOCK macro) and UMA zone locks, a name is used.
Tested on: i386, alpha, sparc64
show more ...
|
#
f67ad03a |
| 04-Apr-2002 |
Poul-Henning Kamp <phk@FreeBSD.org> |
Delete the bogus d_boot[01] fields from struct disklabel.
This shrinks the size 4 bytes on alpha, down to the same 276 bytes as all other platforms.
Construct a hack to make old ioctls work on new
Delete the bogus d_boot[01] fields from struct disklabel.
This shrinks the size 4 bytes on alpha, down to the same 276 bytes as all other platforms.
Construct a hack to make old ioctls work on new kernels.
Once world is recompiled only the new and correct sysctls will be used.
This hack will become annoying around 1st of may to make people rebuild their worlds and it will be gone before 5.0.
show more ...
|
#
4d77a549 |
| 19-Mar-2002 |
Alfred Perlstein <alfred@FreeBSD.org> |
Remove __P.
|
#
628abf6c |
| 15-Mar-2002 |
Alfred Perlstein <alfred@FreeBSD.org> |
Giant pushdown for read/write/pread/pwrite syscalls.
kern/kern_descrip.c: Aquire Giant in fdrop_locked when file refcount hits zero, this removes the requirement for the caller to own Giant for the
Giant pushdown for read/write/pread/pwrite syscalls.
kern/kern_descrip.c: Aquire Giant in fdrop_locked when file refcount hits zero, this removes the requirement for the caller to own Giant for the most part.
kern/kern_ktrace.c: Aquire Giant in ktrgenio, simplifies locking in upper read/write syscalls.
kern/vfs_bio.c: Aquire Giant in bwillwrite if needed.
kern/sys_generic.c Giant pushdown, remove Giant for: read, pread, write and pwrite. readv and writev aren't done yet because of the possible malloc calls for iov to uio processing.
kern/sys_socket.c Grab giant in the socket fo_read/write functions.
kern/vfs_vnops.c Grab giant in the vnode fo_read/write functions.
show more ...
|
#
85f190e4 |
| 14-Mar-2002 |
Alfred Perlstein <alfred@FreeBSD.org> |
Fixes to make select/poll mpsafe.
Problem: selwakeup required calling pfind which would cause lock order reversals with the allproc_lock and the per-process filedesc lock. Solution: Instead of
Fixes to make select/poll mpsafe.
Problem: selwakeup required calling pfind which would cause lock order reversals with the allproc_lock and the per-process filedesc lock. Solution: Instead of recording the pid of the select()'ing process into the selinfo structure, actually record a pointer to the thread. To avoid dereferencing a bad address all the selinfo structures that are in use by a thread are kept in a list hung off the thread (protected by sellock). When a selwakeup occurs the selinfo is removed from that threads list, it is also removed on the way out of select or poll where the thread will traverse its list removing all the selinfos from its own list.
Problem: Previously the PROC_LOCK was used to provide the mutual exclusion needed to ensure proper locking, this couldn't work because there was a single condvar used for select and poll and condvars can only be used with a single mutex. Solution: Introduce a global mutex 'sellock' which is used to provide mutual exclusion when recording events to wait on as well as performing notification when an event occurs.
Interesting note: schedlock is required to manipulate the per-thread TDF_SELECT flag, however if given its own field it would not need schedlock, also because TDF_SELECT is only manipulated under sellock one doesn't actually use schedlock for syncronization, only to protect against corruption.
Proc locks are no longer used in select/poll.
Portions contributed by: davidc
show more ...
|
#
bbbb04ce |
| 09-Mar-2002 |
Alfred Perlstein <alfred@FreeBSD.org> |
Remove __P
|
Revision tags: release/4.5.0_cvs, release/4.4.0_cvs |
|
#
4658f926 |
| 30-Jan-2002 |
Alfred Perlstein <alfred@FreeBSD.org> |
Remove unused variables in select(2) from previous delta.
Pointed out by: bde
|