summaryrefslogtreecommitdiff
path: root/sys/kern
AgeCommit message (Collapse)Author
2002-09-01Oppsie. Remove my debugging code.Artur Grabowski
noted by tdeval@
2002-08-27call ktrnamei() later, after cnp->cn_pnbuf has been made proper; art@ okMichael Shalayeff
2002-08-26Update sb_lastrecord in sbcompress() when the mbuf pointed to is removed.Daniel Hartmeier
Bug report from Alistair Kerr, tested miod@, inspected art@, ok provos@
2002-08-23Just like getvnode, make getsock FREF the file so that we can't get awayArtur Grabowski
with not refing it. Eyeballed by lurene@daemonkitty.net, fries@, nordin@ and fries@ Some additional cleanups by nordin@
2002-08-23Cleanup change. Since almost all callers (except one) of getvnode did a FREFArtur Grabowski
on the returned file, do the FREF inside getvnode so that people can't get away with avoiding FREF and FRELE. Eyeballed by various people.
2002-08-23Use LIST_ macros for the list of all struct file.Artur Grabowski
2002-08-23Add missing FRELE() in finishdup() error case; ok artPeter Valchev
2002-08-22Change the vnode locking in exec to not keep the vnode locked almost allArtur Grabowski
the time. This could lead to problems when a process wants to do an exec on the same vnode it's being run from and needs to copy in arguments from an uncached page in the data segment. When that happens uvm detects a vnode deadlock and returns an error causing execve() return EFAULT. This fixes the regress test in regress/sys/kern/exec_self Also, initialize scriptvp early in exec_script because it could be used uninitialized in a failure case.
2002-08-12Missing FRELE() call on writev(2) error condition; art@ ok.Aaron Campbell
2002-08-11Add two missing vfs_busy calls in the failure path of sysctl_vnode.Artur Grabowski
Found by aaron@ NOTE - I think we need a mount-point iterator just like we have NOTE - vfs_mount_foreach_vnode. (btw. why don't we use foreach_vnode in here?)
2002-08-11SCARG cleanup; okay millert@Niels Provos
2002-08-08redo socketbuf speedup.Niels Provos
2002-08-08backout the tree break. ok pb@, art@Todd T. Fries
2002-08-08socket buf speedup from thorpej@netbsd, okay art@ ericj@:Niels Provos
Make insertion of data into socket buffers O(C): * Keep pointers to the first and last mbufs of the last record in the socket buffer. * Use the sb_lastrecord pointer in the sbappend*() family of functions to avoid traversing the packet chain to find the last record. * Add a new sbappend_stream() function for stream protocols which guarantee that there will never be more than one record in the socket buffer. This function uses the sb_mbtail pointer to perform the data insertion. Make TCP use sbappend_stream(). On a profiling run, this makes sbappend of a TCP transmission using a 1M socket buffer go from 50% of the time to .02% of the time. Thanks to Bill Sommerfeld and YAMAMOTO Takashi for their debugging assistance!
2002-07-30Release sessions to avoid memory leak. From NetBSD. ok deraadt@Thomas Nordin
2002-07-29Try to gracefully handle out of memory conditions.Artur Grabowski
Not that it will help much, but what the hell. noticed by: tedu <grendel@zeitbombe.org>
2002-07-26request non-executable BSS from uvm (first page of BSS may land insideTheo de Raadt
last page of DATA, and still have executability unless we can find a resolution to the GOT/PLT issues in a.out)
2002-07-25Avoid time wrap at securelevel 2. ok millert@ fgsch@Thomas Nordin
2002-07-25Modify lvalue only once between sequence points. ok deraadt@Thomas Nordin
2002-07-25Compare with the same type. ok deraadt@Thomas Nordin
2002-07-24fix header printing in show_all_procsMichael Shalayeff
2002-07-23Fix yet another braino.Artur Grabowski
Just because the pool allocates from intrsafe memory doesn't mean that the pool has to be protected by splvm. We can have an intrsafe pools at splbio or splsoftnet. pool_page_alloc and pool_page_free must du their own splvm protection.
2002-07-23Please tell me what crack I've been smoking when I did that.Artur Grabowski
When trying the drain hook just in pool_allocator_alloc, don't leak memory when the drain succeeds and don't avoid draining other pools if this pool doesn't have a drain hook.
2002-07-21Map stack pages without VM_PROT_EXECUTE. Notice that right now thisArtur Grabowski
doesn't do anything since no pmap implements exec protection yet.
2002-07-20Instead of copying out the signal trampoline on top of the stack, createArtur Grabowski
an uvm aobj, copy out the signal trampoline into it and share that page among all processes for the same emulation. This also requires us to actually be able to tell signal code where the trampoline is located, so introduce a new field in struct proc - p_sigcode that is a pointer to sigcode. This allows us to remove all the ugly calculations of the signal trampoline address done in every sendsig function in the tree (that's why so many files are changed). Tested by various people. ok deraadt@
2002-07-16minor formatting.Artur Grabowski
2002-07-15repair tags building (due to obj dirs in /sys)Michael Shalayeff
2002-07-14be more permissive, and let close relatives do SIGALRMTheo de Raadt
2002-07-12Detect the case where we LK_RELEASE a lock when noone is holding it.Artur Grabowski
2002-07-12Change the locking on the mountpoint slightly. Instead of using mnt_lockArtur Grabowski
to get shared locks for lookup and get the exclusive lock only with LK_DRAIN on unmount and do the real exclusive locking with flags in mnt_flags, we now use shared locks for lookup and an exclusive lock for unmount. This is accomplished by slightly changing the semantics of vfs_busy. Old vfs_busy behavior: - with LK_NOWAIT set in flags, a shared lock was obtained if the mountpoint wasn't being unmounted, otherwise we just returned an error. - with no flags, a shared lock was obtained if the mountpoint was being unmounted, otherwise we slept until the unmount was done and returned an error. LK_NOWAIT was used for sync(2) and some statistics code where it isn't really critical that we get the correct results. 0 was used in fchdir and lookup where it's critical that we get the right directory vnode for the filesystem root. After this change vfs_busy keeps the same behavior for no flags and LK_NOWAIT. But if some other flags are passed into it, they are passed directly into lockmgr (actually LK_SLEEPFAIL is always added to those flags because if we sleep for the lock, that means someone was holding the exclusive lock and the exclusive lock is only held when the filesystem is being unmounted. More changes: dounmount must now be called with the exclusive lock held. (before this the caller was supposed to hold the vfs_busy lock, but that wasn't always true). Zap some (now) unused mount flags. And the highlight of this change: Add some vfs_busy calls to match some vfs_unbusy calls, especially in sys_mount. (lockmgr doesn't detect the case where we release a lock noone holds (it will do that soon)). If you've seen hangs on reboot with mfs this should solve it (I repeat this for the fourth time now, but this time I spent two months fixing and redesigning this and reading the code so this time I must have gotten this right).
2002-07-12- Add a flags argument to dohooks.Artur Grabowski
The flag can be either HOOK_REMOVE or HOOK_REMOVE|HOOK_FREE. o HOOK_REMOVE removes the hook from the list before executing it. o HOOK_FREE frees the hook after that. - Let dostartuphooks use HOOK_REMOVE|HOOK_FREE so we can reclaim the memory. - Let doshutdownhooks use HOOK_REMOVE so that when some shutdown hook panics (they do that all the #@$%! time these days) we don't loop for ever. Don't HOOK_FREE, it doesn't matter and I don't want to add another possible panic condition for shutdown hooks. - Actually free the pointer we're throwing away in hook_disestablish (I wonder how much memory this has leaked over the years).
2002-07-12Fix vm -> uvm in a comment.Artur Grabowski
2002-07-11Make sure to protect ttypend with spltty all the time.Artur Grabowski
Implemented with paranoia.
2002-07-06syncThomas Nordin
2002-07-06Remove kernel support for NTP. ok deraadt@ and tholo@Thomas Nordin
2002-07-03Change all variables definitions (int foo) in sys/sys/*.h to variableMiod Vallat
declarations (extern int foo), and compensate in the appropriate locations.
2002-07-02use hash.h for nfs_hash as well as namei's hashEric Jackson
ok art@ costa@
2002-07-01Don't abuse VM_PROT_ALL. Use VM_PROT_READ|VM_PROT_WRITE here.Artur Grabowski
We'll never want to exec code in malloc mappings.
2002-06-29kqfilter for the log. niels said i can commit it if it worksMichael Shalayeff
and i converted syslog to libevent and it works now (;
2002-06-28Use %b and print the bitmask of the flags in the debugging message for the ↵Jason Wright
extent.
2002-06-27do not permit ktrace on P_SUGID; millert okTheo de Raadt
2002-06-27KNFTheo de Raadt
2002-06-24Redo the logic of reading of proc arguments to be more readable.Artur Grabowski
kjell@ says that it fixes his problems, noone else responded.
2002-06-16When processing the KERN_VNODE sysctl, the kernel builds a packed structure,Miod Vallat
while pstat(8) expects a C structure abiding the regular structure packing rules. This caused pstat -v to break on powerpc. Unbreak the confusion by defining the structure in a common header file, and having the kernel use it. ok millert@ deraadt@
2002-06-14spelling; from Brian Poole <raj@cerias.purdue.edu>Todd T. Fries
2002-06-11kernel changes to make asymmetric crypto work in userlandBob Beck
- modify getfeat to return something more useful to us on devices (like lofn and everything else until jason fixes it) that can't do rsa stuff, etc and can only do mod_exp.. - error handling fixes so we correctly fail to software when we can't deal with a particular key size - add sysctl kern.userasymcrypto to turn on/off userland asymmetric crypto via /dev/crypto - 1 == on, 0 == off, default is off
2002-06-11Protect mi_switch with splstatclock.Artur Grabowski
2002-06-11ANSIfyArtur Grabowski
2002-06-11Remove unnecessary spllowersoftclock(). ok art@Thomas Nordin
2002-06-11splvm, not splimp.Artur Grabowski