summaryrefslogtreecommitdiffstats
path: root/sys
Commit message (Collapse)AuthorAgeFilesLines
* Move the label initialized flag into _label.h: it's no longerrwatson2002-10-221-0/+2
| | | | | | | | exported to userspace. Approved by: re Obtained from: TrustedBSD Project Sponsored by: DARPA, Network Associates Laboratories
* Adapt MAC policies for the new user API changes; teach policies howrwatson2002-10-227-94/+691
| | | | | | | | | | to parse their own label elements (some cleanup to occur here in the future to use the newly added kernel strsep()). Policies now entirely encapsulate their notion of label in the policy module. Approved by: re Obtained from: TrustedBSD Project Sponsored by: DARPA, Network Associates Laboratories
* - Check that a process isn't a new process (p_state == PRS_NEW) beforejhb2002-10-221-20/+23
| | | | | | | | | trying to acquire it's proc lock since the proc lock may not have been constructed yet. - Split up the one big comment at the top of the loop and put the pieces in the right order above the various checks. Reported by: kris (1)
* Support the new MAC user API in kernel: modify existing system callsrwatson2002-10-229-1521/+8253
| | | | | | | | | | | | to use a modified notion of 'struct mac', and flesh out the new variation system calls (almost identical to existing ones except that they permit a pid to be specified for process label retrieval, and don't follow symlinks). This generalizes the label API so that the framework is now almost entirely policy-agnostic. Approved by: re Obtained from: TrustedBSD Project Sponsored by: DARPA, Network Associates Laboratories
* Revised APIs for user process label management; the existing APIs reliedrwatson2002-10-224-194/+216
| | | | | | | | | | | | | | | | | | | on all label parsing occuring in userland, and knowledge of the loaded policies in the user libraries. This revision of the API pushes that parsing into the kernel, avoiding the need for shared library support of policies in userland, permitting statically linked binaries (such as ls, ps, and ifconfig) to use MAC labels. In these API revisions, high level parsing of the MAC label is done in the MAC Framework, and interpretation of label elements is delegated to the MAC policy modules. This permits modules to export zero or more label elements to user space if desired, and support them in the manner they want and with the semantics they want. This is believed to be the final revision of this interface: from the perspective of user applications, the API has actually not changed, although the ABI has. Approved by: re Obtained from: TrustedBSD Project Sponsored by: DARPA, Network Associates Laboratories
* Regen.rwatson2002-10-225-12/+45
|
* Flesh out prototypes for __mac_get_pid, __mac_get_link, andrwatson2002-10-221-3/+5
| | | | | | | | | | __mac_set_link, based on __mac_get_proc() except with a pid, and __mac_get_file(), __mac_set_file() except that they do not follow symlinks. First in a series of commits to flesh out the user API. Obtained from: TrustedBSD Project Sponsored by: DARPA, Network Associates Laboratories
* Note that id_t can also hold a gid_t. Realign comments.mike2002-10-221-8/+8
|
* Fix typo in comments (misspelled "necessary").sheldonh2002-10-221-2/+2
|
* Add back the typedefs for in_addr_t and in_port_t; some broken autoconftjr2002-10-221-0/+10
| | | | scripts expect <sys/types.h> to define them.
* Start tick at the correct time (cpu_init_clocks), instead of cpu_startup.jake2002-10-222-5/+11
|
* Add some magic bits necessary to turn the transmitter on for somesilby2002-10-222-0/+10
| | | | | | | | | (newer) 556B chips. Requested & tested by: Dinesh Nambisan <dinesh@nambisan.net> Magic bits found by: Dave Dribin & Donald Becker MFC After: 3 days
* detect idle kse correctly.davidxu2002-10-221-1/+1
|
* This update further fine tunes the locking of snapshot vnodes inmckusick2002-10-221-12/+21
| | | | | | | | | the ffs_copyonwrite routine to avoid a deadlock between the syncer daemon trying to sync out a snapshot vnode and the bufdaemon trying to write out a buffer containing the snapshot inode. With any luck this will be the last snapshot race condition. Sponsored by: DARPA & NAI Labs.
* This update is a performance improvement when allocating blocks onmckusick2002-10-221-0/+12
| | | | | | | | | | | | | a full filesystem. Previously, if the allocation failed, we had to fsync the file before rolling back any partial allocation of indirect blocks. Most block allocation requests only need to allocate a single data block and if that allocation fails, there is nothing to unroll. So, before doing the fsync, we check to see if any rollback will really be necessary. If none is necessary, then we simply return. This update eliminates the flurry of disk activity that got triggered whenever a filesystem would run out of space. Sponsored by: DARPA & NAI Labs.
* This update removes a race between unmount and lookup. The lookupmckusick2002-10-221-4/+1
| | | | | | | | | | | locks the mount point directory while waiting for vfs_busy to clear. Meanwhile the unmount which holds the vfs_busy lock tried to lock the mount point vnode. The fix is to observe that it is safe for the unmount to remove the vnode from the mount point without locking it. The lookup will wait for the unmount to complete, then recheck the mount point when the vfs_busy lock clears. Sponsored by: DARPA & NAI Labs.
* This checkin reimplements the io-request priority hack in a waymckusick2002-10-223-32/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | that works in the new threaded kernel. It was commented out of the disksort routine earlier this year for the reasons given in kern/subr_disklabel.c (which is where this code used to reside before it moved to kern/subr_disk.c): ---------------------------- revision 1.65 date: 2002/04/22 06:53:20; author: phk; state: Exp; lines: +5 -0 Comment out Kirks io-request priority hack until we can do this in a civilized way which doesn't cause grief. The problem is that it is not generally safe to cast a "struct bio *" to a "struct buf *". Things like ccd, vinum, ata-raid and GEOM constructs bio's which are not entrails of a struct buf. Also, curthread may or may not have anything to do with the I/O request at hand. The correct solution can either be to tag struct bio's with a priority derived from the requesting threads nice and have disksort act on this field, this wouldn't address the "silly-seek syndrome" where two equal processes bang the diskheads from one edge to the other of the disk repeatedly. Alternatively, and probably better: a sleep should be introduced either at the time the I/O is requested or at the time it is completed where we can be sure to sleep in the right thread. The sleep also needs to be in constant timeunits, 1/hz can be practicaly any sub-second size, at high HZ the current code practically doesn't do anything. ---------------------------- As suggested in this comment, it is no longer located in the disk sort routine, but rather now resides in spec_strategy where the disk operations are being queued by the thread that is associated with the process that is really requesting the I/O. At that point, the disk queues are not visible, so the I/O for positively niced processes is always slowed down whether or not there is other activity on the disk. On the issue of scaling HZ, I believe that the current scheme is better than using a fixed quantum of time. As machines and I/O subsystems get faster, the resolution on the clock also rises. So, ten years from now we will be slowing things down for shorter periods of time, but the proportional effect on the system will be about the same as it is today. So, I view this as a feature rather than a drawback. Hence this patch sticks with using HZ. Sponsored by: DARPA & NAI Labs. Reviewed by: Poul-Henning Kamp <phk@critter.freebsd.dk>
* Remove the OpenBSD comatibility stuff. Many changes to be more style(9)semenu2002-10-223-621/+355
| | | | | compilant. Split two pieces if code into separate functions to do not exceed line length due to indentation.
* mac_none is a stub policy without any functional implementation.rwatson2002-10-212-14/+14
| | | | | | | | | | | | Various cleanups, no functional changes: - Fix a type in an entry point stub, socket checks accept sockets, not vnodes. - Trailing whitespace - Entry point sort order Obtained from: TrustedBSD Project Sponsored by: DARPA, Network Associates Laboratories
* Remove the process state PRS_WAIT.julian2002-10-213-7/+0
| | | | | | It is never used. I left it there from pre-KSE days as I didn't know if I'd need it or not but now I know I don't.. It's functionality is in TDI_IWAIT in the thread.
* psl.h isn't referenced anywhere that I could find on the alpha, so removepeter2002-10-211-32/+0
| | | | this stub.
* Introduce mac_biba_copy() and mac_mls_copy(), which conditionallyrwatson2002-10-212-17/+49
| | | | | | | | | | | copy elements of one Biba or MLS label to another based on the flags on the source label element. Use this instead of mac_{biba,mls}_{single,range}() to simplify the existing code, as well as support partial label updates (we don't update if none is requested). Obtained from: TrustedBSD Project Sponsored by: DARPA, Network Associates Laboratories
* Grrr, s/PBP/BPB/ here as well.jhb2002-10-211-1/+1
| | | | Noticed by: peter
* Add the ability to specify a strict C99 environment with themike2002-10-211-1/+6
| | | | | _C99_SOURCE constant, which should be defined before including any standard headers.
* Implement a new IP_SENDSRCADDR ancillary message type that permitsiedowse2002-10-212-4/+63
| | | | | | | | | | | | a server process bound to a wildcard UDP socket to select the IP address from which outgoing packets are sent on a per-datagram basis. When combined with IP_RECVDSTADDR, such a server process can guarantee to reply to an incoming request using the same source IP address as the destination IP address of the request, without having to open one socket per server IP address. Discussed on: -net Approved by: re
* Add id_t, a new type capable of representing a pid_t or a uid_t. Movemike2002-10-212-1/+13
| | | | the definition of rlim_t to <sys/_types.h> so that it can be shared.
* Remove the "temporary connection" hack in udp_output(). In orderiedowse2002-10-211-23/+26
| | | | | | | | | | | | | | | | | to send datagrams from an unconnected socket, we used to first block input, then connect the socket to the sendmsg/sendto destination, send the datagram, and finally disconnect the socket and unblock input. We now use in_pcbconnect_setup() to check if a connect() would have succeeded, but we never record the connection in the PCB (local anonymous port allocation is still recorded, though). The result from in_pcbconnect_setup() authorises the sending of the datagram and selects the local address and port to use, so we just construct the header and call ip_output(). Discussed on: -net Approved by: re
* GEOM does not (and shall not) propagate flags like D_MEMDISK, so we willphk2002-10-211-11/+11
| | | | | | | revert to checking the name to determine if our root device is a ramdisk, md(4) specifically to determine if we should attempt the root-mount RW Sponsored by: DARPA & NAI Labs.
* We want /dev/md0 for ramdisk roots, not /dev/md0c.phk2002-10-211-1/+1
| | | | Sponsored by: DARPA & NAI Labs
* Spell the BPB member of the 7.10 bootsector as bsBPB rather than bsPBP tojhb2002-10-211-1/+1
| | | | be like all the other bootsectors. Apple has done the same it seems.
* Reduce the overhead of the mutex statistics gathering code, try to producedes2002-10-212-38/+56
| | | | shorter lines in the report, and clean up some minor style issues.
* Add compartment support to Biba and MLS policies. The logic of therwatson2002-10-216-32/+144
| | | | | | | | | | | | | policies remains the same: subjects and objects are labeled for integrity or sensitivity, and a dominance operator determines whether or not subject/object accesses are permitted to limit inappropriate information flow. Compartments are a non-hierarchal component to the label, so add a bitfield to the label element for each, and a set check as part of the dominance operator. This permits the implementation of "need to know" elements of MLS. Obtained from: TrustedBSD Project Sponsored by: DARPA, Network Associates Laboratories
* One #include <sys/sysctl.h> should be enough.cognet2002-10-211-1/+0
| | | | Approved by: mux (mentor)
* Add a flag needed for recovery of excess allocated KSEs.julian2002-10-211-1/+2
| | | | | | (not used in non KSE processes). Submitted by: davidxu
* More in the way of minor consistency improvements: trim 'mac_mls_'rwatson2002-10-211-8/+7
| | | | | | | from another variable to line this up with mac_biba.c Obtained from: TrustedBSD Project Sponsored by: DARPA, Network Associates Laboratories
* Demote sockets to single-label objects rather than maintaining arwatson2002-10-212-32/+0
| | | | | | | | | | range on them, leaving process credentials as the only kernel objects with label ranges in the Biba and MLS policies. We weren't using the range in any access control decisions, so this lets us garbage collect effectively unused code. Obtained from: TrustedBSD Project Sponsored by: DARPA, Network Associates Laboratories
* Synchonize variable spelling with the MAC tree: we shortened some ofrwatson2002-10-211-9/+8
| | | | | | | the names. Obtained from: TrustedBSD Project Sponsored by: DARPA, Network Associates Laboratories
* White space nit the crept in during merge.rwatson2002-10-211-1/+1
|
* Since the Biba and MLS access checks are identical to the open checks,rwatson2002-10-212-24/+2
| | | | | | | | | collapse the two cases more cleanly: rather than wrapping an access check around open, simply provide the open implementation for the access vector entry. No functional change. Obtained from: TrustedBSD Project Sponsored by: DARPA, Network Associates Laboratories
* Cleanup of relabel authorization checks -- almost identical logic,rwatson2002-10-212-116/+409
| | | | | | | | we just break out some of the tests better. Minor change in that we now better support incremental update of labels. Obtained from: TrustedBSD Project Sponsored by: DARPA, Network Associates Laboratories
* - Abort all OCBs for timeout.simokawa2002-10-211-5/+14
| | | | - Improve warning message.
* Use if_printf() instead of printf() to print diagnositic messages in thebrooks2002-10-211-9/+6
| | | | form "rdp#: blah".
* Use if_printf(ifp, "blah") instead ofbrooks2002-10-211-22/+15
| | | | printf("%s%d: blah", ifp->if_name, ifp->if_unit).
* Replace in_pcbladdr() with a more generic inner subroutine foriedowse2002-10-213-100/+136
| | | | | | | | | | | | | | | in_pcbconnect() called in_pcbconnect_setup(). This version performs all of the functions of in_pcbconnect() except for the final committing of changes to the PCB. In the case of an EADDRINUSE error it can also provide to the caller the PCB of the duplicate connection, avoiding an extra in_pcblookup_hash() lookup in tcp_connect(). This change will allow the "temporary connect" hack in udp_output() to be removed and is part of the preparation for adding the IP_SENDSRCADDR control message. Discussed on: -net Approved by: re
* Add a bus_space_unmap() for the puc (and possibly other) drivers.gallatin2002-10-211-0/+14
|
* fix prototype of asyreqq().simokawa2002-10-211-2/+3
|
* These (userland) files shouldn't be here.simokawa2002-10-212-675/+0
|
* Add the USER_SR segment register to pcb state. Initialize correctly,grehan2002-10-217-0/+22
| | | | | | | | | and save/restore during a context switch. The USER_SR could be overwritten when the current thread was switched out with a faulting copyin/copyout. Approved by: Benno
* All bpf.h/NBPF consumers are gone so stop generating bpf.hbrooks2002-10-211-3/+0
|
* Don't include the depricated "bpf.h" and always compile in bpf supportbrooks2002-10-212-21/+1
| | | | as per current practice.
OpenPOWER on IntegriCloud