aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/init_main.c
Commit message (Collapse)AuthorAgeFilesLines
* Allow fdinit() to be called with a NULL fdp argument so we can usePoul-Henning Kamp2004-11-071-14/+3
| | | | | | | | | it when setting up init. Make fdinit() lock the fdp argument as needed. Notes: svn path=/head/; revision=137331
* Rework how we store process times in the kernel such that we always storeJohn Baldwin2004-10-051-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the raw values including for child process statistics and only compute the system and user timevals on demand. - Fix the various kern_wait() syscall wrappers to only pass in a rusage pointer if they are going to use the result. - Add a kern_getrusage() function for the ABI syscalls to use so that they don't have to play stackgap games to call getrusage(). - Fix the svr4_sys_times() syscall to just call calcru() to calculate the times it needs rather than calling getrusage() twice with associated stackgap, etc. - Add a new rusage_ext structure to store raw time stats such as tick counts for user, system, and interrupt time as well as a bintime of the total runtime. A new p_rux field in struct proc replaces the same inline fields from struct proc (i.e. p_[isu]ticks, p_[isu]u, and p_runtime). A new p_crux field in struct proc contains the "raw" child time usage statistics. ruadd() has been changed to handle adding the associated rusage_ext structures as well as the values in rusage. Effectively, the values in rusage_ext replace the ru_utime and ru_stime values in struct rusage. These two fields in struct rusage are no longer used in the kernel. - calcru() has been split into a static worker function calcru1() that calculates appropriate timevals for user and system time as well as updating the rux_[isu]u fields of a passed in rusage_ext structure. calcru() uses a copy of the process' p_rux structure to compute the timevals after updating the runtime appropriately if any of the threads in that process are currently executing. It also now only locks sched_lock internally while doing the rux_runtime fixup. calcru() now only requires the caller to hold the proc lock and calcru1() only requires the proc lock internally. calcru() also no longer allows callers to ask for an interrupt timeval since none of them actually did. - calcru() now correctly handles threads executing on other CPUs. - A new calccru() function computes the child system and user timevals by calling calcru1() on p_crux. Note that this means that any code that wants child times must now call this function rather than reading from p_cru directly. This function also requires the proc lock. - This finishes the locking for rusage and friends so some of the Giant locks in exit1() and kern_wait() are now gone. - The locking in ttyinfo() has been tweaked so that a shared lock of the proctree lock is used to protect the process group rather than the process group lock. By holding this lock until the end of the function we now ensure that the process/thread that we pick to dump info about will no longer vanish while we are trying to output its info to the console. Submitted by: bde (mostly) MFC after: 1 month Notes: svn path=/head/; revision=136152
* Refactor a bunch of scheduler code to give basically the same behaviourJulian Elischer2004-09-051-21/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | but with slightly cleaned up interfaces. The KSE structure has become the same as the "per thread scheduler private data" structure. In order to not make the diffs too great one is #defined as the other at this time. The KSE (or td_sched) structure is now allocated per thread and has no allocation code of its own. Concurrency for a KSEGRP is now kept track of via a simple pair of counters rather than using KSE structures as tokens. Since the KSE structure is different in each scheduler, kern_switch.c is now included at the end of each scheduler. Nothing outside the scheduler knows the contents of the KSE (aka td_sched) structure. The fields in the ksegrp structure that are to do with the scheduler's queueing mechanisms are now moved to the kg_sched structure. (per ksegrp scheduler private data structure). In other words how the scheduler queues and keeps track of threads is no-one's business except the scheduler's. This should allow people to write experimental schedulers with completely different internal structuring. A scheduler call sched_set_concurrency(kg, N) has been added that notifies teh scheduler that no more than N threads from that ksegrp should be allowed to be on concurrently scheduled. This is also used to enforce 'fainess' at this time so that a ksegrp with 10000 threads can not swamp a the run queue and force out a process with 1 thread, since the current code will not set the concurrency above NCPU, and both schedulers will not allow more than that many onto the system run queue at a time. Each scheduler should eventualy develop their own methods to do this now that they are effectively separated. Rejig libthr's kernel interface to follow the same code paths as linkse for scope system threads. This has slightly hurt libthr's performance but I will work to recover as much of it as I can. Thread exit code has been cleaned up greatly. exit and exec code now transitions a process back to 'standard non-threaded mode' before taking the next step. Reviewed by: scottl, peter MFC after: 1 week Notes: svn path=/head/; revision=134791
* Give setrunqueue() and sched_add() more of a clue as toJulian Elischer2004-09-011-1/+1
| | | | | | | | | where they are coming from and what is expected from them. MFC after: 2 days Notes: svn path=/head/; revision=134586
* Add locking to the kqueue subsystem. This also makes the kqueue subsystemJohn-Mark Gurney2004-08-151-0/+1
| | | | | | | | | | | | | | | | a more complete subsystem, and removes the knowlege of how things are implemented from the drivers. Include locking around filter ops, so a module like aio will know when not to be unloaded if there are outstanding knotes using it's filter ops. Currently, it uses the MTX_DUPOK even though it is not always safe to aquire duplicate locks. Witness currently doesn't support the ability to discover if a dup lock is ok (in some cases). Reviewed by: green, rwatson (both earlier versions) Notes: svn path=/head/; revision=133741
* Remove global variable rootdevs and rootvp, they are unused as such.Poul-Henning Kamp2004-07-281-1/+0
| | | | | | | | | | | Add local rootvp variables as needed. Remove checks for miniroot's in the swappartition. We never did that and most of the filesystems could never be used for that, but it had still been copy&pasted all over the place. Notes: svn path=/head/; revision=132805
* Make VFS_ROOT() and vflush() take a thread argument.Alfred Perlstein2004-07-121-1/+1
| | | | | | | | | This is to allow filesystems to decide based on the passed thread which vnode to return. Several filesystems used curthread, they now use the passed thread. Notes: svn path=/head/; revision=132023
* Nice, is a property of a process as a whole..Julian Elischer2004-06-161-1/+1
| | | | | | | | I mistakenly moved it to the ksegroup when breaking up the process structure. Put it back in the proc structure. Notes: svn path=/head/; revision=130551
* Loudly announce WITNESS and DIAGNOSTIC options and warn about reducedPoul-Henning Kamp2004-02-291-0/+14
| | | | | | | performance. Notes: svn path=/head/; revision=126410
* Locking for the per-process resource limits structure.John Baldwin2004-02-041-13/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - struct plimit includes a mutex to protect a reference count. The plimit structure is treated similarly to struct ucred in that is is always copy on write, so having a reference to a structure is sufficient to read from it without needing a further lock. - The proc lock protects the p_limit pointer and must be held while reading limits from a process to keep the limit structure from changing out from under you while reading from it. - Various global limits that are ints are not protected by a lock since int writes are atomic on all the archs we support and thus a lock wouldn't buy us anything. - All accesses to individual resource limits from a process are abstracted behind a simple lim_rlimit(), lim_max(), and lim_cur() API that return either an rlimit, or the current or max individual limit of the specified resource from a process. - dosetrlimit() was renamed to kern_setrlimit() to match existing style of other similar syscall helper functions. - The alpha OSF/1 compat layer no longer calls getrlimit() and setrlimit() (it didn't used the stackgap when it should have) but uses lim_rlimit() and kern_setrlimit() instead. - The svr4 compat no longer uses the stackgap for resource limits calls, but uses lim_rlimit() and kern_setrlimit() instead. - The ibcs2 compat no longer uses the stackgap for resource limits. It also no longer uses the stackgap for accessing sysctl's for the ibcs2_sysconf() syscall but uses kernel_sysctl() instead. As a result, ibcs2_sysconf() no longer needs Giant. - The p_rlimit macro no longer exists. Submitted by: mtm (mostly, I only did a few cleanups and catchups) Tested on: i386 Compiled on: alpha, amd64 Notes: svn path=/head/; revision=125454
* KASSERT() that initproc->p_pid is 1. Very bad things happen if init'sRobert Watson2004-01-161-0/+1
| | | | | | | | | | pid isn't 1, and it can actually occur if kthread_create() is called before SUB_SI_CREATE_INIT without RFHIGHPID. Discussed with: jhb Notes: svn path=/head/; revision=124597
* New file descriptor allocation code, derived from similar code introducedDag-Erling Smørgrav2004-01-151-0/+2
| | | | | | | | | | | | | | in OpenBSD by Niels Provos. The patch introduces a bitmap of allocated file descriptors which is used to locate available descriptors when a new one is needed. It also moves the task of growing the file descriptor table out of fdalloc(), reducing complexity in both fdalloc() and do_dup(). Debts of gratitude are owed to tjr@ (who provided the original patch on which this work is based), grog@ (for the gdb(4) man page) and rwatson@ (for assistance with pxeboot(8)). Notes: svn path=/head/; revision=124548
* Remove the global variable 'cmask', which was used to initialize theRobert Watson2003-10-021-3/+1
| | | | | | | | | | | | fd_cmask field in the file descriptor structure for the first process indirectly from CMASK, and when an fd structure is initialized before being filled in, and instead just use CMASK. This appears to be an artifact left over from the initial integration of quotas into BSD. Suggested by: peter Notes: svn path=/head/; revision=120659
* Add sysentvec->sv_fixlimits() hook so that we can catch cases on 64 bitPeter Wemm2003-09-251-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | systems where the data/stack/etc limits are too big for a 32 bit process. Move the 5 or so identical instances of ELF_RTLD_ADDR() into imgact_elf.c. Supply an ia32_fixlimits function. Export the clip/default values to sysctl under the compat.ia32 heirarchy. Have mmap(0, ...) respect the current p->p_limits[RLIMIT_DATA].rlim_max value rather than the sysctl tweakable variable. This allows mmap to place mappings at sensible locations when limits have been reduced. Have the imgact_elf.c ld-elf.so.1 placement algorithm use the same method as mmap(0, ...) now does. Note that we cannot remove all references to the sysctl tweakable maxdsiz etc variables because /etc/login.conf specifies a datasize of 'unlimited'. And that causes exec etc to fail since it can no longer find space to mmap things. Notes: svn path=/head/; revision=120422
* Change instances of callout_init that specify MPSAFE behaviour toSam Leffler2003-08-191-2/+2
| | | | | | | | use CALLOUT_MPSAFE instead of "1" for the second parameter. This does not change the behaviour; it just makes the intent more clear. Notes: svn path=/head/; revision=119137
* Revert stuff which accidentally ended up in the previous commit.Poul-Henning Kamp2003-07-221-5/+0
| | | | Notes: svn path=/head/; revision=117879
* Don't attempt to inline large functions mb_alloc() and mb_free(),Poul-Henning Kamp2003-07-221-0/+5
| | | | | | | | | it more than doubles the text size of this file. GCC has wisely ignored us on this previously Notes: svn path=/head/; revision=117878
* Use __FBSDID().David E. O'Brien2003-06-111-1/+3
| | | | Notes: svn path=/head/; revision=116182
* Add tracking of process leaders sharing a file descriptor table andTor Egge2003-06-021-0/+1
| | | | | | | | | | allow a file descriptor table to be shared between multiple process leaders. PR: 50923 Notes: svn path=/head/; revision=115702
* - Merge struct procsig with struct sigacts.John Baldwin2003-05-131-7/+4
| | | | | | | | | | | | | | | | | | | | - Move struct sigacts out of the u-area and malloc() it using the M_SUBPROC malloc bucket. - Add a small sigacts_*() API for managing sigacts structures: sigacts_alloc(), sigacts_free(), sigacts_copy(), sigacts_share(), and sigacts_shared(). - Remove the p_sigignore, p_sigacts, and p_sigcatch macros. - Add a mutex to struct sigacts that protects all the members of the struct. - Add sigacts locking. - Remove Giant from nosys(), kill(), killpg(), and kern_sigaction() now that sigacts is locked. - Several in-kernel functions such as psignal(), tdsignal(), trapsignal(), and thread_stopped() are now MP safe. Reviewed by: arch@ Approved by: re (rwatson) Notes: svn path=/head/; revision=114983
* Instead of recording the Unix time in a process when it starts, record theDag-Erling Smørgrav2003-05-011-1/+1
| | | | | | | | | | uptime. Where necessary, convert it back to Unix time by adding boottime to it. This fixes a potential problem in the accounting code, which would compute the elapsed time incorrectly if the Unix time was stepped during the lifetime of the process. Notes: svn path=/head/; revision=114434
* Made vmspace0 non-static. Its useful to be able to identify a vmspace asJake Burkholder2003-04-131-1/+1
| | | | | | | the kernel vmspace. Notes: svn path=/head/; revision=113450
* Move the _oncpu entry from the KSE to the thread.Julian Elischer2003-04-101-1/+1
| | | | | | | | The entry in the KSE still exists but it's purpose will change a bit when we add the ability to lock a KSE to a cpu. Notes: svn path=/head/; revision=113339
* Use the proc lock to protect p_realtimer instead of Giant, and obtainTim J. Robbins2003-02-171-1/+1
| | | | | | | | | sched_lock around accesses to p_stats->p_timer[] to avoid a potential race with hardclock. getitimer(), setitimer() and the realitexpire() callout are now Giant-free. Notes: svn path=/head/; revision=111034
* - Split the struct kse into struct upcall and struct kse. struct kse willJeff Roberson2003-02-171-1/+0
| | | | | | | | | | soon be visible only to schedulers. This greatly simplifies much the KSE code. Submitted by: davidxu Notes: svn path=/head/; revision=111028
* It seems the extra precautions are no longer needed.Dag-Erling Smørgrav2003-02-131-2/+0
| | | | Notes: svn path=/head/; revision=110789
* Correct grammatical error in previous commit.Dag-Erling Smørgrav2003-02-041-1/+1
| | | | Notes: svn path=/head/; revision=110344
* Extra precautions before trying to start init(8).Dag-Erling Smørgrav2003-02-041-0/+2
| | | | Notes: svn path=/head/; revision=110342
* Reversion of commit by Davidxu plus fixes since applied.Julian Elischer2003-02-011-0/+1
| | | | | | | | | | | I'm not convinced there is anything major wrong with the patch but them's the rules.. I am using my "David's mentor" hat to revert this as he's offline for a while. Notes: svn path=/head/; revision=110190
* NODEVFS cleanup: remove #ifdefs.Poul-Henning Kamp2003-01-301-2/+0
| | | | Notes: svn path=/head/; revision=110087
* Move UPCALL related data structure out of kse, introduce a newDavid Xu2003-01-261-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | data structure called kse_upcall to manage UPCALL. All KSE binding and loaning code are gone. A thread owns an upcall can collect all completed syscall contexts in its ksegrp, turn itself into UPCALL mode, and takes those contexts back to userland. Any thread without upcall structure has to export their contexts and exit at user boundary. Any thread running in user mode owns an upcall structure, when it enters kernel, if the kse mailbox's current thread pointer is not NULL, then when the thread is blocked in kernel, a new UPCALL thread is created and the upcall structure is transfered to the new UPCALL thread. if the kse mailbox's current thread pointer is NULL, then when a thread is blocked in kernel, no UPCALL thread will be created. Each upcall always has an owner thread. Userland can remove an upcall by calling kse_exit, when all upcalls in ksegrp are removed, the group is atomatically shutdown. An upcall owner thread also exits when process is in exiting state. when an owner thread exits, the upcall it owns is also removed. KSE is a pure scheduler entity. it represents a virtual cpu. when a thread is running, it always has a KSE associated with it. scheduler is free to assign a KSE to thread according thread priority, if thread priority is changed, KSE can be moved from one thread to another. When a ksegrp is created, there is always N KSEs created in the group. the N is the number of physical cpu in the current system. This makes it is possible that even an userland UTS is single CPU safe, threads in kernel still can execute on different cpu in parallel. Userland calls kse_create to add more upcall structures into ksegrp to increase concurrent in userland itself, kernel is not restricted by number of upcalls userland provides. The code hasn't been tested under SMP by author due to lack of hardware. Reviewed by: julian Notes: svn path=/head/; revision=109877
* Originally when DEVFS was added, a global variable "devfs_present"Poul-Henning Kamp2003-01-191-15/+15
| | | | | | | | | | | | | | | was used to control code which were conditional on DEVFS' precense since this avoided the need for large-scale source pollution with #include "opt_geom.h" Now that we approach making DEVFS standard, replace these tests with an #ifdef to facilitate mechanical removal once DEVFS becomes non-optional. No functional change by this commit. Notes: svn path=/head/; revision=109526
* Improve the way that an elf image activator for an alternate word size isJake Burkholder2003-01-041-5/+0
| | | | | | | | | | | | | | included in the kernel. Include imgact_elf.c in conf/files, instead of both imgact_elf32.c and imgact_elf64.c, which will use the default word size for an architecture as defined in machine/elf.h. Architectures that wish to build an additional image activator for an alternate word size can include either imgact_elf32.c or imgact_elf64.c in files.${ARCH}, which allows it to be dependent on MD options instead of solely on architecture. Glanced at by: peter Notes: svn path=/head/; revision=108685
* Add code to ddb to allow backtracing an arbitrary thread.Julian Elischer2002-12-281-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | (show thread {address}) Remove the IDLE kse state and replace it with a change in the way threads sahre KSEs. Every KSE now has a thread, which is considered its "owner" however a KSE may also be lent to other threads in the same group to allow completion of in-kernel work. n this case the owner remains the same and the KSE will revert to the owner when the other work has been completed. All creations of upcalls etc. is now done from kse_reassign() which in turn is called from mi_switch or thread_exit(). This means that special code can be removed from msleep() and cv_wait(). kse_release() does not leave a KSE with no thread any more but converts the existing thread into teh KSE's owner, and sets it up for doing an upcall. It is just inhibitted from being scheduled until there is some reason to do an upcall. Remove all trace of the kse_idle queue since it is no-longer needed. "Idle" KSEs are now on the loanable queue. Notes: svn path=/head/; revision=108338
* Fix typo in comment. It's SYSINIT, not SYSINT.Giorgos Keramidas2002-11-301-1/+1
| | | | | | | Approved by: re (murray) Notes: svn path=/head/; revision=107426
* - Implement a mechanism for allowing schedulers to place scheduler dependantJeff Roberson2002-11-211-0/+6
| | | | | | | | | | | | data in the scheduler independant structures (proc, ksegrp, kse, thread). - Implement unused stubs for this mechanism in sched_4bsd. Approved by: re Reviewed by: luigi, trb Tested on: x86, alpha Notes: svn path=/head/; revision=107126
* Use strlcpy() instead of strncpy() to copy NUL terminated stringsRobert Drehmel2002-10-171-2/+1
| | | | | | | for safety and consistency. Notes: svn path=/head/; revision=105354
* - Move p_cpulimit to struct proc from struct plimit and protect it withJohn Baldwin2002-10-091-1/+1
| | | | | | | | | | | | | | | | | | sched_lock. This means that we no longer access p_limit in mi_switch() and the p_limit pointer can be protected by the proc lock. - Remove PRS_ZOMBIE check from CPU limit test in mi_switch(). PRS_ZOMBIE processes don't call mi_switch(), and even if they did there is no longer the danger of p_limit being NULL (which is what the original zombie check was added for). - When we bump the current processes soft CPU limit in ast(), just bump the private p_cpulimit instead of the shared rlimit. This fixes an XXX for some value of fix. There is still a (probably benign) bug in that this code doesn't check that the new soft limit exceeds the hard limit. Inspired by: bde (2) Notes: svn path=/head/; revision=104719
* Round out the facilty for a 'bound' thread to loan out its KSEJulian Elischer2002-10-091-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | in specific situations. The owner thread must be blocked, and the borrower can not proceed back to user space with the borrowed KSE. The borrower will return the KSE on the next context switch where teh owner wants it back. This removes a lot of possible race conditions and deadlocks. It is consceivable that the borrower should inherit the priority of the owner too. that's another discussion and would be simple to do. Also, as part of this, the "preallocatd spare thread" is attached to the thread doing a syscall rather than the KSE. This removes the need to lock the scheduler when we want to access it, as it's now "at hand". DDB now shows a lot mor info for threaded proceses though it may need some optimisation to squeeze it all back into 80 chars again. (possible JKH project) Upcalls are now "bound" threads, but "KSE Lending" now means that other completing syscalls can be completed using that KSE before the upcall finally makes it back to the UTS. (getting threads OUT OF THE KERNEL is one of the highest priorities in the KSE system.) The upcall when it happens will present all the completed syscalls to the KSE for selection. Notes: svn path=/head/; revision=104695
* Some kernel threads try to do significant work, and the default KSTACK_PAGESScott Long2002-10-021-1/+1
| | | | | | | | | | | | | | | | doesn't give them enough stack to do much before blowing away the pcb. This adds MI and MD code to allow the allocation of an alternate kstack who's size can be speficied when calling kthread_create. Passing the value 0 prevents the alternate kstack from being created. Note that the ia64 MD code is missing for now, and PowerPC was only partially written due to the pmap.c being incomplete there. Though this patch does not modify anything to make use of the alternate kstack, acpi and usb are good candidates. Reviewed by: jake, peter, jhb Notes: svn path=/head/; revision=104354
* Back our kernel support for reliable signal queues.Juli Mallett2002-10-011-2/+0
| | | | | | | Requested by: rwatson, phk, and many others Notes: svn path=/head/; revision=104306
* First half of implementation of ksiginfo, signal queues, and such. ThisJuli Mallett2002-09-301-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | gets signals operating based on a TailQ, and is good enough to run X11, GNOME, and do job control. There are some intricate parts which could be more refined to match the sigset_t versions, but those require further evaluation of directions in which our signal system can expand and contract to fit our needs. After this has been in the tree for a while, I will make in kernel API changes, most notably to trapsignal(9) and sendsig(9), to use ksiginfo more robustly, such that we can actually pass information with our (queued) signals to the userland. That will also result in using a struct ksiginfo pointer, rather than a signal number, in a lot of kern_sig.c, to refer to an individual pending signal queue member, but right now there is no defined behaviour for such. CODAFS is unfinished in this regard because the logic is unclear in some places. Sponsored by: New Gold Technology Reviewed by: bde, tjr, jake [an older version, logic similar] Notes: svn path=/head/; revision=104233
* Use the fields in the sysentvec and in the vm map header in place of theJake Burkholder2002-09-211-4/+4
| | | | | | | | | | | constants VM_MIN_ADDRESS, VM_MAXUSER_ADDRESS, USRSTACK and PS_STRINGS. This is mainly so that they can be variable even for the native abi, based on different machine types. Get stack protections from the sysentvec too. This makes it trivial to map the stack non-executable for certain abis, on machines that support it. Notes: svn path=/head/; revision=103767
* Allocate KSEs and KSEGRPs separatly and remove them from the proc structure.Julian Elischer2002-09-151-2/+4
| | | | | | | | | | | | next step is to allow > 1 to be allocated per process. This would give multi-processor threads. (when the rest of the infrastructure is in place) While doing this I noticed libkvm and sys/kern/kern_proc.c:fill_kinfo_proc are diverging more than they should.. corrective action needed soon. Notes: svn path=/head/; revision=103367
* Completely redo thread states.Julian Elischer2002-09-111-0/+1
| | | | | | | Reviewed by: davidxu@freebsd.org Notes: svn path=/head/; revision=103216
* Added fields for VM_MIN_ADDRESS, PS_STRINGS and stack protections toJake Burkholder2002-09-011-2/+28
| | | | | | | | | sysentvec. Initialized all fields of all sysentvecs, which will allow them to be used instead of constants in more places. Provided stack fixup routines for emulations that previously used the default. Notes: svn path=/head/; revision=102808
* Split out a number of mostly VFS and signal related syscalls intoIan Dowse2002-09-011-1/+2
| | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=102779
* Refresh the credential on the first initproc thread following divorcingRobert Watson2002-08-071-0/+1
| | | | | | | | | | | | | | | the initproc credential from the proc0 credential. Otherwise, the proc0 credential is used instead of initproc's credentil when authorizing start_init() activities prior to initproc hitting userland for the first time. This could result in the incorrect credential being used to authorize mounting of the root file system, which could in turn cause problems for NFS when used in combination with uid/gid ipfw rules, or with MAC. Discussed with: julian Notes: svn path=/head/; revision=101477
* Introduce support for Mandatory Access Control and extensibleRobert Watson2002-07-311-0/+3
| | | | | | | | | | | | | | | | | | kernel access control. Invoke the necessary MAC entry points to maintain labels on mount structures. In particular, invoke entry points for intialization and destruction in various scenarios (root, non-root). Also introduce an entry point in the boot procedure following the mount of the root file system, but prior to the start of the userland init process to permit policies to perform further initialization. Obtained from: TrustedBSD Project Sponsored by: DARPA, NAI Labs Notes: svn path=/head/; revision=101004
* Introduce support for Mandatory Access Control and extensibleRobert Watson2002-07-311-0/+8
| | | | | | | | | | | | | | | | | kernel access control. Invoke the necessary MAC entry points to maintain labels on process credentials. In particular, invoke entry points for the initialization and destruction of struct ucred, the copying of struct ucred, and permit the initial labels to be set for both process 0 (parent of all kernel processes) and process 1 (parent of all user processes). Obtained from: TrustedBSD Project Sponsored by: DARPA, NAI Labs Notes: svn path=/head/; revision=101001