summaryrefslogtreecommitdiffstats
path: root/sys/kern
Commit message (Collapse)AuthorAgeFilesLines
* Don't zero b_dirtyoff and b_dirtyend on error.dfr1997-04-251-3/+3
| | | | Submitted by: Hidetoshi Shimokawa <simokawa@sat.t.u-tokyo.ac.jp>
* copyin the export network mask to the correct variable.peter1997-04-252-4/+4
| | | | Submitted by: Mike Hibler <mike@marker.cs.utah.edu>, PR#3380
* Restore memory space separation (RFMEM) for vfork() afterache1997-04-231-1/+1
| | | | shell imgact memory clobbering fixed
* Don't clobber user space argv0 memory on shell exec, mainly for vfork()ache1997-04-232-17/+26
| | | | | | Fix another bug: if argv[0] is NULL, garbadge args might be added for shell script Submitted by: Tor Egge <Tor.Egge@idi.ntnu.no> (with yet one fault detect from me)
* Give up on the fast vfork() for a while.dyson1997-04-231-2/+2
|
* Re-institute the efficent version of vfork. It appears to make adyson1997-04-201-2/+2
| | | | | | | difference of approx 3mins in make world on my P6!!! This means that vfork now has full address space sharing, so beware with sloppy vfork programming. Also, you really do need to apply the previously committed popen fix in libc.
* Avoid division by 0 in check_part(). (It occurred when max_nsectors == 0.bde1997-04-191-8/+11
| | | | | | | This case is clearly an error, but we keep calling check_part() to get diagnostics.) Fixed nearby indentation and commenting bugs.
* Don't allow partial buffers to be cluster-comitted.dfr1997-04-181-1/+2
| | | | | | | Zero the b_dirty{off,end} after cluster-comitting a group of buffers. With these fixes, I was able to complete a 'make world' with remote src and obj directories.
* Brought fix from the 2.2 branch forward (see rev 1.47.2.7): serious bugsdg1997-04-181-3/+14
| | | | with reading the image header.
* #include <sys/queue.h>phk1997-04-141-1/+2
|
* Fixed printing of registers in dbflalt_handler(). The registersbde1997-04-141-9/+7
| | | | | | | were always in a tss; that tss just changed from the one in the pcb to common_tss (who knows where it was when there was no curpcb?). Not using the pcb also fixed the problem that there is no pcb in idle(), so we now always get useful register values.
* Make a problem that I cannot reproduce go away for now. This commitdyson1997-04-141-2/+2
| | | | | | is to decrease the inconvienience of other developers until I can really fix the code. Reviewed by: Donald J. Maddox <dmaddox@scsn.net>
* Improve the buffer cache memory policy by moving pages over to thedyson1997-04-131-13/+12
| | | | | | | cache queue more often. The pageout daemon had to be waken up more often than necessary since pages were not put on the cache queue, when they should have been. Submitted by: David Greenman <dg@freebsd.org>
* Correct the previous thread-fix commit. I made a clerical error.dyson1997-04-131-13/+3
|
* Fully implement vfork. Vfork is now much much faster than even ourdyson1997-04-135-11/+62
| | | | | | | | | | | | | | | | | fork. (On my machine, fork is about 240usecs, vfork is 78usecs.) Implement rfork(!RFPROC !RFMEM), which allows a thread to divorce its memory from the other threads of a group. Implement rfork(!RFPROC RFCFDG), which closes all file descriptors, eliminating possible existing shares with other threads/processes. Implement rfork(!RFPROC RFFDG), which divorces the file descriptors for a thread from the rest of the group. Fix the case where a thread does an exec. It is almost nonsense for a thread to modify the other threads address space by an exec, so we now automatically divorce the address space before modifying it.
* Effectively remove the previous commit to fix threads forking. Thedyson1997-04-121-3/+7
| | | | change was a false-start, and needs more work.
* Allow a kernel-supported process thread to do an exec without blastingdyson1997-04-111-7/+24
| | | | away the VM space of all of the other, associated threads.
* Removed support for OLD_PIPE. <sys/stat.h> is now missing the hack thatbde1997-04-093-66/+3
| | | | | supported nameless pipes being indistinguishable from fifos. We're not going back.
* Include <sys/buf.h> instead of <sys/vnode.h>. kern_sysctl.c nobde1997-04-091-2/+2
| | | | | | | longer has anything to do with vnodes and never had anything to do with buffers, but it needs the definitions of B_READ and B_WRITE for use with the bogus useracc() interface and was getting them bogusly due to excessive cleanups in rev.1.49.
* Remove explicit zero of p_vmspace on creation, it's now in the startzeropeter1997-04-071-6/+1
| | | | section of the proc struct.
* The biggie: Get rid of the UPAGES from the top of the per-process addresspeter1997-04-074-68/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | space. (!) Have each process use the kernel stack and pcb in the kvm space. Since the stacks are at a different address, we cannot copy the stack at fork() and allow the child to return up through the function call tree to return to user mode - create a new execution context and have the new process begin executing from cpu_switch() and go to user mode directly. In theory this should speed up fork a bit. Context switch the tss_esp0 pointer in the common tss. This is a lot simpler since than swithching the gdt[GPROC0_SEL].sd.sd_base pointer to each process's tss since the esp0 pointer is a 32 bit pointer, and the sd_base setting is split into three different bit sections at non-aligned boundaries and requires a lot of twiddling to reset. The 8K of memory at the top of the process space is now empty, and unmapped (and unmappable, it's higher than VM_MAXUSER_ADDRESS). Simplity the pmap code to manage process contexts, we no longer have to double map the UPAGES, this simplifies and should measuably speed up fork(). The following parts came from John Dyson: Set PG_G on the UPAGES that are now in kernel context, and invalidate them when swapping them out. Move the upages object (upobj) from the vmspace to the proc structure. Now that the UPAGES (pcb and kernel stack) are out of user space, make rfork(..RFMEM..) do what was intended by sharing the vmspace entirely via reference counting rather than simply inheriting the mappings.
* No longer use an i386tss as the basis of our pcb - it wasn't particularlypeter1997-04-071-4/+4
| | | | | | | | | | | | | | | | convenient and makes life difficult for my next commit. We still need an i386tss to point to for the tss slot in the gdt, so we use a common tss shared between all processes. Note that this is going to break debugging until this series of commits is finished. core dumps will change again too. :-( we really need a more modern core dump format that doesn't depend on the pcb/upages. This change makes VM86 mode harder, but the following commits will remove a lot of constraints for the VM86 system, including the possibility of extending the pcb for an IO port map etc. Obtained from: bde
* Make MOD_* macros almost consistent:dufault1997-04-061-5/+5
| | | | | | | | | | | | | | | | | | | | Use the name argument almost the same in all LKM types. Maintain the current behavior for the external (e.g., modstat) name for DEV, EXEC, and MISC types being #name ## "_mod" and SYCALL and VFS only #name. This is a candidate for change and I vote just the name without the "_mod". Change the DISPATCH macro to MOD_DISPATCH for consistency with the other macros. Add an LKM_ANON #define to eliminate the magic -1 and associated signed/unsigned warnings. Add MOD_PRIVATE to support wcd.c's poking around in the lkm structure. Change source in tree to use the new interface. Reviewed by: Bruce Evans
* Fix the gdb executable modify problem. Thanks to the detective workdyson1997-04-061-7/+7
| | | | | | | | | | | | by Alan Cox <alc@cs.rice.edu>, and his description of the problem. The bug was primarily in procfs_mem, but the mistake likely happened due to the lack of vm system support for the operation. I added better support for selective marking of page dirty flags so that vm_map_pageable(wiring) will not cause this problem again. The code in procfs_mem is now less bogus (but maybe still a little so.)
* [Previous comment was incorrect for these files]dfr1997-04-044-4/+4
| | | | | Added calls to VFS lock debugging macros to make fixing filesystems' locking easier.
* Add a function vop_sharedlock which a copy of vop_nolock without thedfr1997-04-046-8/+194
| | | | | | | implementation #ifdef out. This can be used for now by NFS. As soon as all the other filesystems' locking is fixed, this can go away. Print the vnode address in vprint for easier debugging.
* Killed unnecessary vp == NULL check after namei.dg1997-04-041-5/+1
|
* Oops, only free component name buffer if namei() didn't. This bug hasdg1997-04-041-3/+4
| | | | | | been in here since I wrote the code 3 years ago! Thanks, Bruce! Submitted by: bde
* Various fixes:dg1997-04-041-22/+21
| | | | | | | | | | | | | | | | | | | | | 1. imgp->image_header needs to be cleared for the bp == NULL && `goto interpret' case, else exec_fail_dealloc would free it twice after an error. 2. Moved the vp->v_writecount check in exec_check_permissions() to near the end. This fixes execve("/dev/null", ...) returning the bogus errno ETXTBSY. ETXTBSY is still returned for attempts to exec interpreted files that are open for writing. The man page is very old and wrong here. It says that ETXTBSY is for pure procedure (shared text) files that are open for writing or reading. 3. Moved the setuid disabling in exec_check_permissions() to the end. Cosmetic. It's more natural to dispose of all the error cases first. ...plus a couple of other cosmetic changes. Submitted by: bde
* Lose the vnode lock on a permissions failure.dg1997-04-041-2/+4
| | | | Submitted by: Tor Egge <Tor.Egge@idi.ntnu.no>
* Don't incorrectly set P_SUGID in setre[ug]id() for no reason, as noticedpeter1997-04-021-5/+9
| | | | | | | by bde. Don't return EPERM in setre[ug]id() just because the caller passes in the current effective id in the second arg (ie: no change), as suggested by ache.
* Use OID_AUTO instead of magic number for the Lite2 sysctl debug.busyprt.bde1997-04-012-10/+8
| | | | | | Removed declaration of vfs_unmountroot() again. Staticized vgonel().
* Use OID_AUTO instead of magic number for the old sysctl debug.rcluster.bde1997-04-011-16/+3
| | | | | | | | The magic number conflicted with the rotting disabled one in ext2fs for debug.doasyncfree. Removed messy debugging variable/constant/sysctl debug.doreallocblks. Lite2 removed it, and we don't use the code that it controls.
* Use OID_AUTO instead of magic number for old sysctl debug.elf_trace. Thebde1997-04-011-8/+4
| | | | | | | | magic number conflicted with the one for the Lite2 sysctl debug.busyprt. Staticized some variables. Removed unused #includes.
* Use OID_AUTO instead of a magic number for Lite2 sysctl debug.lockf_debug.bde1997-04-011-5/+3
| | | | Removed unused #includes.
* Fixed commented-out Lite2 sysctl debug.lockpausetime.bde1997-04-011-5/+6
| | | | Removed unused #includes.
* Removed potentially harmful garbage <vm/lock.h> and fixed bogusbde1997-04-011-2/+1
| | | | | | use of it. It was actually harmless because the use was null due to fortuitous include orders and identical (wrong) idempotency macros.
* Implement code for an OpenBSD-style issetuigid().peter1997-03-311-1/+26
| | | | | | | | | | | | | | | | This is valueable for library code which needs to be able to find out whether the current process is or *was* set[ug]id at some point in the past, and may have a "tainted" execution environment. This is especially a problem with the trend to immediately revoke privs at startup and regain them for critical sections. One problem with this is that if a cracker is able to compromise the program while it's still got a saved id, the cracker can direct the program to regain the privs. Another problem is that the user may be able to affect the program in some other way (eg: setting resolver host aliases) and the library code needs to know when it should disable these sorts of features. Reviewed by: ache Inspired by: OpenBSD (but with a different implementation)
* Regenerate (added issetugid)peter1997-03-312-4/+4
|
* issetugid is now implemented rather than reservedpeter1997-03-311-2/+2
|
* Do not set the P_SUGID flag in seteuid()/setegid() if nothing has changed.peter1997-03-311-11/+20
| | | | | | (for supporting issetugid()) Reviewed by: ache (as was the previous commit, rev 1.29)
* Do not set the P_SUGID flag in seteuid()/setegid() if nothing has changed.peter1997-03-311-9/+15
| | | | (for supporting issetugid())
* Fully implement the clause in Appendix B.4.2.2 from Posix 1003.1peter1997-03-311-31/+132
| | | | | | | | | | | | | | | that allows traditional BSD setuid/setgid behavior. The only visible difference should be that a non-root setuid program (eg: inn's "rnews" program) that is setuid to news, can completely "become" uid news. (ie: setuid(geteuid()) This was allowed in traditional 4.2/4.3BSD and is now "blessed" by Posix as a special case of "appropriate privilige". Also, be much more careful with the P_SUGID flag so that we can use it for issetugid() - only set it if something changed. Reviewed by: ache
* Make setgroups(0, xxx) behave as it does on SYSV, namely clear the groupspeter1997-03-311-6/+20
| | | | | | | | | | | | vector except for the egid in groups[0]. There is a risk that programs that come from SYSV/Linux that expect this to work and don't check for error returns may accidently pass root's groups on to child processes. We now do what is least suprising (to non BSD programs/programmers) in this scenario, and nothing is changed for programs written with BSD groups rules in mind. Reviewed by: ache
* In accept1(), falloc() is called after the process has awoken, but priordg1997-03-313-12/+28
| | | | | | | | | | | to removing the connection from the queue. The problem here is that falloc() may block and this would allow another process to accept the connection instead. If this happens to leave the queue empty, then the system will panic with an "accept: nothing queued". Also changed a wakeup() to a wakeup_one() to avoid the "thundering herd" problem on new connections in Apache (or any other application that has multiple processes blocked in accept() for the same socket).
* Code to do lchown(2), copied from chown(2) except it's NOFOLLOW in ND_INITpeter1997-03-312-2/+82
| | | | instead of FOLLOW.
* Regeneratepeter1997-03-312-2/+8
|
* Reserve 252 (poll, first in OpenBSD)peter1997-03-311-1/+4
| | | | | Reserve 253 (issetugid, as in OpenBSD) Allocate 254 for lchown(2)
* Treat symlinks as first class citizens with their own uid/gid rather thanpeter1997-03-312-140/+38
| | | | | | | | | | | | | as shadows of their containing directory. This should solve the problem of users not being able to delete their symlinks from /tmp once and for all. Symlinks do not have modes though, they are accessable to everything that can read the directory (as before). They are made to show this fact at lstat time (they appear as mode 0777 always, since that's how the the lookup routines in the kernel treat them). More commits will follow, eg: add a real lchown() syscall and man pages.
* Changed the way that the exec image header is read to be filesystem-dg1997-03-311-29/+38
| | | | | | | centric rather than VM-centric to fix a problem with errors not being detectable when the header is read. Killed exech_map as a result of these changes. There appears to be no performance difference with this change.
OpenPOWER on IntegriCloud