Don't try to kill embryonic processes in killpg1(). This prevents
a race condition between fork() and kill(pid,sig) with pid < 0 that
can cause a kernel panic.
vn_start_write()/vn_finished_write() is not needed here, because
vn_start_write() is always called earlier in the code path and calling
the function recursively may lead to a deadlock.
Confirmed by: tegge
sys/vm/swap_pager.h 1.51
sys/vm/swap_pager.c 1.278,1.279
On shutdown try to turn off all swap devices. This way GEOM providers are
properly closed on shutdown.
Requested by: ru
Reviewed by: alc
> Clear TDF_SINTR in sleepq_resume_thread, also sleepq_catch_signal does
> not need to clear it now, this should fix panic when msleep is recursivly
> called. Patch is slightly adjusted after review.
Approved by: re (scottl)
> - Lock giant when assigning ni_vp and keep vfslocked state valid.
> - Consistently track ni_dvp and ni_vp with dvfslocked and vfslocked rather
> than trying to optimize it into a single lock. This adds more calls to
> lock giant with non smpsafe filesystems but is the only way to reliably
> hold the correct lock.
> - Remove an invalid assert in the mountedhere case in lookup and fix the
> code to properly deal with the scenario. We can actually have a lookup
> that returns dp == dvp with mountedhere set with certain unmount races.
Approved by: re (scottl)
ABI reasons) and call it from intr_event_destroy().
Only in 6: Add API and ABI compat shims for ithread_destroy() to call
intr_event_destroy().
Approved by: re (scottl)
Tested by: Artem Ignatiev <zazubrik@mail.ru>
- LK_RETRY means nothing when passed to VOP_LOCK. Call vn_lock instead.
- Move the vn_lock of the dvp until after we've unbusied the filesystem
to avoid a LOR with the mount point lock.
- In the v_mountedhere while loop we acquire a new instance of giant each
time through without releasing the first. This would cause us to leak
Giant.
Sponsored by: Isilon Systems, Inc.
Approved by: re (scottl)
Allow root to open jail PTYs from the host environment. This un-breaks using
utilities like watch(8) (or other programs which use snp(4)) to monitor
behavior within prisons from the host environment. This regression was
introduced when we changed the ioctl(SNPSTTY) to use a file descriptor
instead of a dev_t
Approved by: re (hrs)
in a cluster instead of just the first buffer.
Delay buf_start() calls until snapshots have a copy of old content.
Allow compilation when not using softupdates.
Remove unused leaked debug function prototype.
PR: kern/93942
Approved by: re (kensmith)
calls that simply return ENOSYS. This will allow basic forward
compatibility with userland audit pieces to be committed in the future,
avoiding the "login killed by SIGSYS" problem users of CVS HEAD
experienced when booting older kernels with newer user spaces (an
unsupported but not uncommon situation when debugging problems).
Approved by: re (scottl)
Obtained from: TrustedBSD Project
File Revisions
kern/imgact_aout.c 1.100
kern/imgact_elf.c 1.167-1.172, 1.175
kern/imgact_gzip.c 1.55
vm/vm_extern.h 1.77
vm/vm_glue.c 1.214
Use sf_buf_alloc() instead of vm_map_find() on exec_map to create
the ephemeral mappings that are used as the source for three copy
operations from kernel space to user space. There are two reasons
for making this change: (1) Under heavy load exec_map can fill up
causing vm_map_find() to fail. When it fails, the nascent process
is aborted (SIGABRT). Whereas, this reimplementation using
sf_buf_alloc() sleeps. (2) Although it is possible to sleep on
vm_map_find()'s failure until address space becomes available (see
kmem_alloc_wait()), using sf_buf_alloc() is faster. Furthermore,
the reimplementation uses a CPU private mapping, avoiding a TLB
shootdown on multiprocessors.
The second argument to vm_map_find() should be NULL instead of 0.
Correct a long-standing problem in elfN_map_insert(): In order to
copy a page to user space, the user space mapping must allow write
access.
Eliminate an unneeded (vm_prot_t) parameter from two functions.
Eliminate unnecessary uses of a local variable.
Maintain the vnode lock throughout elfN_load_file() rather than
releasing it and reacquiring it in vrele(). Consequently, there is
no reason to increase the reference count on the vm object caching
the file's pages.
Eliminate unused parameters to elfN_load_file().
Maintain the lock on the vnode for most of exec_elfN_imgact().
Specifically, it is required for the I/O that may be performed by
elfN_load_section().
Avoid an obscure deadlock in the a.out, elf, and gzip image
activators. Add a comment describing why the deadlock does not
occur in the common case and how it might occur in less usual
circumstances.
Eliminate an unused variable from exec_aout_imgact().
Avoid a vm object reference leak in a rarely used code path.
An executable contains at most one PT_INTERP program header.
Therefore, the loop that searches for it can terminate after it is
found rather than iterating over the entire set of program headers.
Eliminate an unneeded initialization.
Approved by: re (mux)