summaryrefslogtreecommitdiff
path: root/sys/kern
AgeCommit message (Collapse)Author
2002-10-22Remove a part that did sneak in that wasn't meant to be commited yet.Artur Grabowski
2002-10-21ANSIArtur Grabowski
2002-10-21Two problems.Artur Grabowski
First we check for running out of processes (nprocs variable) before we continue with the fork, then we do various calls that might sleep (and allow other forks to start and pass that check), then we increase that variable. This could allow processes to be created past the limit. Second is that we don't decrease the the process count for this uid if the stack allocation fails. So a user could run out of processes he's allowed to run without actually having them. miod@ ok
2002-10-15Protect p_priority with splstatclock.Artur Grabowski
2002-10-15Match reality by changing (u_int) -> (int) in comments.Thomas Nordin
2002-10-14Stuff needed for gcc 3.X.Artur Grabowski
gcc has the nice feature of optimizing various common constructs into more optimal ones, inlining various calls, etc. The problem with that is that it assumes that we have a proper libc backing us. We really don't want to loose all those features by defining -ffreestanding and right now there is no way to just disable some of them, so we have to make the kernel more libc-like in some aspects to make it work with newer gcc. rename putchar to kputchar because it was nothing like libc putchar (and only internal to this function). Implement dummy putchar and puts (not prototyped outside this file).
2002-10-14- Do not try to drain other pools if PR_NOWAIT and the allocator can'tArtur Grabowski
give us pages. PR_NOWAIT most likely means "hey, we're coming from an interrupt, don't mess with stuff that doesn't have proper protection". - pool_allocator_free is called in too many places so I don't feel comfortable without that added protection from splvm (and besides, pool_allocator_free is rarely called anyway, so the extra spl will be unnoticeable). It shouldn't matter when fiddling with those flags, but you never know. - Remove a wakeup without a matching tsleep. It's a left-over from some other code path that I've been investigating when reworking the pool a while ago and it should have been removed before that commit. deraadt@ ok
2002-10-13Remove more '\n's from panic() statements. From Chris Kuethe.Kenneth R Westerback
2002-10-12Remove more '\n's from panic() statements. Both trailing and leading.Kenneth R Westerback
Diff generated by Chris Kuethe.
2002-10-10constify a few strings. various@ okArtur Grabowski
2002-10-10preserve the m_tag order in m_tag_copy_chain() as originally intended.Kenjiro Cho
the order doesn't matter at this moment but could be problematic if 2 tags of the same type are ever added. ok jason@, dhartmei@, angelos@
2002-10-07Remove a diagnostic check that I added when reorganizing the code.Artur Grabowski
It triggers on ppc and while the check itself is correct, it's better to fix the bug before breaking peoples systems.
2002-10-06Remove some '#if 0' cruft.Artur Grabowski
2002-10-06Move out the execution of vmcmds into a separate function.Artur Grabowski
2002-10-02make it compile w/ DEBUG by syncing w/ exec.h; deraadt@ okMichael Shalayeff
2002-10-02Check for negative values. Inspiration from tedu <grendel@zeitbombe.org>.Thomas Nordin
ok deraadt@ and art@
2002-10-02which is int not u_int so check for negative values. ok deraadt@, art@Thomas Nordin
2002-10-01Oppsie. Missing part from this commit:Artur Grabowski
Prevent two localhost crashes with proc filters. - don't send NOTE_SIGNAL to exiting processes. - null dereference on error condition. from Peter Werner <peterw at ifost.org.au> deraadt@ ok
2002-10-01Prevent two localhost crashes with proc filters.Artur Grabowski
- don't send NOTE_SIGNAL to exiting processes. - null dereference on error condition. from Peter Werner <peterw at ifost.org.au> deraadt@ ok
2002-09-24Restore pentium_microtime, testing by henning@, millert@. ok deraadt@Thomas Nordin
2002-09-23Add support for vmcmds that load sections relative to a base section.Artur Grabowski
You mark one section with VMCMD_BASE and the rest are marked RELATIVE. Use that to load ELF interpreter correctly in all cases. Inspired by NetBSD. Great debugging help from drahn@ deraadt@ ok
2002-09-18Mark ELF ld.so as VTEXT to prevent the file from being overwritten.Dale Rahn
ok deraadt@ art@
2002-09-18We can jump to the fail: label before shellargp is initialized.Artur Grabowski
Make sure that we don't free random memory when that happens. From <j at pureftpd.org> deraadt@ ok
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