| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
crash). I am fairly sure that only people with SMP and multi-threaded
apps using kqueue will be affected by this, so I have a stress-testing
program on my web site:
<URL:http://green.homeunix.org/~green/getaddrinfo-pthreads-stresstest.c>
|
|
|
|
|
|
|
| |
Instead of creating a mutex that we msleep on but don't actually lock when
doing the corresponding wakeup(), in the kthread, lock the mutex associated
with our taskqueue and msleep while the queue is empty. Assert that the
queue is locked when the callback function is called to wake the kthread.
|
|
|
|
|
|
| |
to another jail.
Submitted by: rwatson
|
|
|
|
|
|
|
|
|
|
|
|
| |
It returns 1 is process is inside of jail and 0 if it is not.
Information if we are in jail or not is not a secret, there is plenty of
ways to discover it. Many people are using own hack to check this and
this will be a legal way from now on.
It will be great if our starting scripts will take advantage of this sysctl
to allow clean "boot" inside jail.
Approved by: rwatson, scottl (mentor)
|
|
|
|
|
|
| |
2nd condition is true, first one is true for sure.
Approved by: jhb, scottl (mentor)
|
|
|
|
|
|
| |
to SIGCHLD if the new parent process is initproc.
MFC after: 2 weeks
|
|
|
|
|
|
|
| |
parent if no signal is specified in the clone() flags argument.
PR: 42457
MFC after: 2 weeks
|
|
|
|
|
| |
Submitted by: Bruno Ducrot <ducrot AT poupinou.org>
Reviewed by: bde
|
|
|
|
|
|
| |
PR: kern/18503
Submitted by: Anatoly Vorobey <mellon@pobox.com>
Approved by: rwatson (mentor)
|
|
|
|
|
|
| |
kernel. I'm not happy with it yet - refinements are to come.
This hack allows the kern.ps_strings and kern.usrstack sysctls to respond
to a 32 bit request, such as those coming from emulated i386 binaries.
|
|
|
|
| |
Reviewed by: alfred, tanimura
|
| |
|
| |
|
|
|
|
|
| |
KASSERT this rather than trying to deal with what happens when file
descriptors change out from under us.
|
|
|
|
|
|
| |
missing parentheses). Use default handling (trap to debugger) for
udev2dev(x, 1) since it is an error and doesn't happen anywhere in
the sys tree except in bogusly commented out code in coda.
|
|
|
|
|
|
|
|
| |
and given a value, but never used. This has no effect on the
resulting binaries, since gcc optimizes the variable away anyway.
PR: kern/62684
Approved by: rwatson (mentor)
|
| |
|
| |
|
| |
|
|
|
|
|
| |
jails in the system. Previous behavior (allowed) may be restored
by setting security.jail.list_allowed=1.
|
|
|
|
| |
before dereferencing the prison pointer.
|
|
|
|
|
|
|
|
| |
data for the file system on which the jail's root vnode is located.
Previous behavior (show data for all mountpoints) can be restored
by setting security.jail.getfsstatroot_only to 0. Note: this also
has the effect of hiding other mounts inside a jail, such as /dev,
/tmp, and /proc, but errs on the side of leaking less information.
|
|
|
|
|
|
| |
called until DEVFS had a chance to initialize. Since DEVFS is mandatory
and things over in that department coincidentally works from without
any initialization now, this is safe.
|
|
|
|
| |
Also, use sched_pctcpu() instead of assuming td->td_kse is non-NULL.
|
|
|
|
|
|
|
| |
calls selwakeup() if necessary (which it is, if you don't want freed
memory hanging around on your td->td_selq).
Props to: alfred
|
|
|
|
|
|
|
|
|
| |
set to SIGCHLD. This avoids the creation of orphaned Linux-threaded
zombies that init is unable to reap. This can occur when the parent
process sets its SIGCHLD to SIG_IGN. Fix a similar situation in the
PT_DETACH code.
Tested by: "Steven Hartland" <killing AT multiplay.co.uk>
|
|
|
|
|
|
| |
than the soft (cur) limit.
Submitted by: bde
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
mindful of blocking on disk I/O and instead return EBUSY when such
blocking would occur.
Results from the DeBox project indicate that blocking on disk I/O
can slow the performance of a kqueue/poll based webserver. Using
a flag such as SF_NODISKIO and throwing connections that would block
to helper processes/threads helped increase performance.
Currently, only the Flash webserver uses this flag, although it could
probably be applied to thttpd with relative ease.
Idea by: Yaoping Ruan & Vivek Pai
|
|
|
|
|
|
| |
and swapgeom_done() to perform swp_pager_async_iodone() without Giant.
Reviewed by: tegge
|
|
|
|
|
|
| |
- Hide struct plimit from userland.
Submitted by: bde (2)
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
RLIM_INFINITY case for ogetrlimit().
- Use %jd and intmax_t to output negative time in usec in calcru().
- Rework getrusage() to make a copy of the rusage struct into a local
variable while holding Giant and then do the copyout from the local
variable to avoid having to have the original process rusage struct
locked while doing the copyout (which would not be safe). This also
includes a few style fixes from Bruce to getrusage().
Submitted by: bde (1, parts of 3)
Suggested by: bde (2)
|
|
|
|
| |
Submitted by: bde
|
|
|
|
|
| |
fork1() rather than only doing it for the RFSTOPPED case and then having
to fix it up in other places later on.
|
|
|
|
|
|
| |
- Update a few comments regarding locking notes.
Submitted by: bde (1, mostly)
|
|
|
|
|
|
|
|
| |
failed, the reference count for the virtual memory object referenced
by the specified shared memory segment would have been erroneously
incremented.
Reported by: Joost Pol <joost@pine.nl>
|
|
|
|
|
|
| |
Garbage collect unused cndebug() function.
Suggested by: bde
|
|
|
|
| |
Submitted by: bde
|
|
|
|
|
| |
bit maintained on a per-device basis. Single variable is inadequate
on machines running with multiple consoles enabled.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- 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
|
|
|
|
|
|
| |
uio* functions.
Suggested by: bde
|
|
|
|
|
|
| |
Reviewed by: jhb
In cooperation with: juli, jhb
Approved by: jhb, scottl (mentor)
|
|
|
|
| |
Submitted by: bde
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Rename temporary variable names ("tmp", "tmp2") to more informative
names ("load", "pctcpu", "rss", ...)
- Unclutter indentation and return paths: rather than lots of nested
ifs, simply return earlier if it's not going to work out. Simplify
general structure and avoid "deep" code.
- Comment on the thread/process selection and locking.
- Correct handling of "running"/"runnable" states, avoid "unknown"
that people were seeing for running processes. This was due to
a misunderstanding of the more complex state machine / inhibitors
behavior of KSE.
- Do perform ttyinfo() printing on KSE (P_SA) processes, it seems
generally to work.
While I initially attempted to formulate this as two commits (one
layout, the other content), I concluded that the layout changes were
really structural changes.
Many elements submitted by: bde
|
|
|
|
|
| |
Noticed by: bde
Pointy hat to: jhb
|
| |
|
|
|
|
| |
Glanced at by: alfred
|
|
|
|
|
|
|
|
|
|
| |
instead, just dec/inc in the ctor/dtor. For now, increment/decrement
in two's, since we're now performing the operation once per pair,
not once per pipe. Not really any measurable performance change
in my micro-benchmarks, but doing less work is good, especially when
it comes to atomic operations.
Suggested by: alc
|
|
|
|
|
|
|
|
| |
changes to jointly allocated pipe pairs. Replace these checks
with pipe_present checks. This avoids a NULL pointer dereference
when a pipe is half-closed.
Submitted by: Peter Edwards <peter.edwards@openet-telecom.com>
|
|
|
|
|
|
| |
- Only check witness_watch once in enroll().
Reported by: ru (2)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
1. Root from inside a jail was able to unmount any file system
(except /).
2. Unprivileged root was able to unmount file systems mounted by
privileged root (execpt /).
3. User from inside a jail was able to mount file system when
sysctl vfs.usermount was set to 1.
4. User was able to mount file system when vfs.usermount was set to 1
(that's ok) and unmount it even if vfs.usermount was equal to 0
(that's not correct).
Possibility from point 1 was reported by: Dariusz Kowalski <darek@76.pl>
Only a part of this fix will be MFC'ed (if approved).
PR: kern/60149
Reviewed by: rwatson
Approved by: scottl (mentor)
MFC after: 3 days
|