| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
| |
the cdevsw{}.
Submitted by: tegge
|
|
|
|
|
|
|
|
|
|
|
|
| |
of all, PIPE_EOF is not checked pervasively after everything that can drop
the pipe mutex and msleep(), so fix. Additionally, though it might not
harm anything, pipelock() and pipeunlock() are not used consistently.
Third, the kqueue support functions do not use the pipe mutex correctly.
Last, but absolutely not least, is a race: if pipe_busy is not set on
the closing side of the pipe, the other side that is trying to write to
that will crash BECAUSE PIPE_EOF IS NOT SET! Unconditionally set
PIPE_EOF, and get rid of all the lockups/crashes I have seen trying
to build ports.
|
|
|
|
| |
and pid.
|
|
|
|
|
|
|
|
|
|
|
| |
Now I believe it is done in the right way.
Removed some XXMAC cases, we now assume 'high' integrity level for all
sysctls, except those with CTLFLAG_ANYBODY flag set. No more magic.
Reviewed by: rwatson
Approved by: rwatson, scottl (mentor)
Tested with: LINT (compilation), mac_biba(4) (functionality)
|
|
|
|
|
| |
Reported by: "Ted Unangst" <tedu@coverity.com>
Approved by: rwatson (mentor)
|
|
|
|
|
|
|
|
| |
to use the "year1-year3" format, as opposed to "year1, year2, year3".
This seems to make lawyers more happy, but also prevents the
lines from getting excessively long as the years start to add up.
Suggested by: imp
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is what we came here for: Hang dev_t's from their cdevsw,
refcount cdevsw and dev_t and generally keep track of things a lot
better than we used to:
Hold a cdevsw reference around all entrances into the device driver,
this will be necessary to safely determine when we can unload driver
code.
Hold a dev_t reference while the device is open.
KASSERT that we do not enter the driver on a non-referenced dev_t.
Remove old D_NAG code, anonymous dev_t's are not a problem now.
When destroy_dev() is called on a referenced dev_t, move it to
dead_cdevsw's list. When the refcount drops, free it.
Check that cdevsw->d_version is correct. If not, set all methods
to the dead_*() methods to prevent entrance into driver. Print
warning on console to this effect. The device driver may still
explode if it is also incompatible with newbus, but in that case
we probably didn't get this far in the first place.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Remove the unused second argument from udev2dev().
Convert all remaining users of makedev() to use udev2dev(). The
semantic difference is that udev2dev() will only locate a pre-existing
dev_t, it will not line makedev() create a new one.
Apart from the tiny well controlled windown in D_PSEUDO drivers,
there should no longer be any "anonymous" dev_t's in the system
now, only dev_t's created with make_dev() and make_dev_alias()
|
|
|
|
|
|
|
|
| |
Introduce d_version field in struct cdevsw, this must always be
initialized to D_VERSION.
Flip sense of D_NOGIANT flag to D_NEEDGIANT, this involves removing
four D_NOGIANT flags and adding 145 D_NEEDGIANT flags.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add missing D_TTY flags to various drivers.
Complete asserts that dev_t's passed to ttyread(), ttywrite(),
ttypoll() and ttykqwrite() have (d_flags & D_TTY) and a struct tty
pointer.
Make ttyread(), ttywrite(), ttypoll() and ttykqwrite() the default
cdevsw methods for D_TTY drivers and remove the explicit initializations
in various drivers cdevsw structures.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit adds a couple of functions for pseudodrivers to use for
implementing cloning in a manner we will be able to lock down (shortly).
Basically what happens is that pseudo drivers get a way to ask for
"give me the dev_t with this unit number" or alternatively "give
me a dev_t with the lowest guaranteed free unit number" (there is
unfortunately a lot of non-POLA in the exact numeric value of this
number, just live with it for now)
Managing the unit number space this way removes the need to use
rman(9) to do so in the drivers this greatly simplifies the code in
the drivers because even using rman(9) they still needed to manage
their dev_t's anyway.
I have taken the if_tun, if_tap, snp and nmdm drivers through the
mill, partly because they (ab)used makedev(), but mostly because
together they represent three different problems for device-cloning:
if_tun and snp is the plain case: just give me a device.
if_tap has two kinds of devices, with a flag for device type.
nmdm has paired devices (ala pty) can you can clone either of them.
|
|
|
|
|
|
|
| |
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
|