Remove nested includes of <sys/_lock.h> and <sys/_mutex.h> which spill into
userland. The comment indicated that something in userland needed them, but
make universe can't seem to find any traces of it.
Robert Watson [Thu, 16 Mar 2006 07:03:14 +0000 (07:03 +0000)]
Change soabort() from returning int to returning void, since all
consumers ignore the return value, soabort() is required to succeed,
and protocols produce errors here to report multiple freeing of the
pcb, which we hope to eliminate.
Ariff Abdullah [Thu, 16 Mar 2006 04:12:49 +0000 (04:12 +0000)]
Fix severe 8bit integer overflow during channel creation and destruction,
especially for vchans. It turns out that channel numbering always depend
on d->devcount counter (which keep increasing), while PCMMKMINOR() truncate
everything to 8bit length. At some point the truncation cause the newly
created character device overlapped with the existence one, causing erratic
overall system behaviour and panic. Easily reproduce with something like:
(Luckily, only root can reproduce this)
while : ; do
sysctl hw.snd.pcm0.vchans=200
sysctl hw.snd.pcm0.vchans=100
done
- Enforce channel/chardev numbering within 8bit boundary. Return E2BIG
if necessary.
- Traverse d->channels SLIST and try to reclaim "free" counter during channel
creation. Don't rely on d->devcount at all.
- Destroy vchans in reverse order.
Anyway, this is not the fault of vchans. It is just that vchans are so cute
and begging to be abused ;) . Don't blame her.
Sam Leffler [Wed, 15 Mar 2006 21:27:08 +0000 (21:27 +0000)]
when doing s/w crypto make sure work is done w/ a writable mbuf chain;
this corrects problems with drivers that rely on the host to do
crypto (iwi, ipw, ral, ural, wi (hostap), awi)
Hard work by: luigi, mlaier
Reviewed by: luigi, mlaier
MFC after: 1 week
Andre Oppermann [Wed, 15 Mar 2006 19:39:09 +0000 (19:39 +0000)]
- Fill in the correct rtm_index for RTM_ADD and RTM_CHANGE messages.
- Allow RTM_CHANGE to change a number of route flags as specified by
RTF_FMASK.
- The unused rtm_use field in struct rt_msghdr is redesignated as
rtm_fmask field to communicate route flag changes in RTM_CHANGE
messages from userland. The use count of a route was moved to
rtm_rmx a long time ago. For source code compatibility reasons
a define of rtm_use to rtm_fmask is provided.
These changes faciliate running of multiple cooperating routing
daemons at the same time without causing undesired interference.
Open[BGP|OSPF]D make use of these features to have IGP routes
override EGP ones.
Obtained from: OpenBSD (claudio@)
MFC after: 3 days
Robert Watson [Wed, 15 Mar 2006 12:45:35 +0000 (12:45 +0000)]
As with socket consumer references (so_count), make sofree() return
without GC'ing the socket if a strong protocol reference to the socket
is present (SS_PROTOREF).
Robert Watson [Wed, 15 Mar 2006 12:30:06 +0000 (12:30 +0000)]
Add SS_PROTOREF socket flag, which represents a strong reference by the
protocol to the socket. Normally protocol references are weak: that is,
the socket layer can tear down the socket (and hence protocol state)
when it finds convenient. This flag will allow the protocol to
explicitly declare to the socket layer that it is maintaining a
strong reference, rather than the current implicit model associated
with so_pcb pointer values and repeated attempts to possibly free the
socket.
Robert Watson [Tue, 14 Mar 2006 19:32:03 +0000 (19:32 +0000)]
When opening a trace file, open O_NONBLOCK so that ktrace doesn't stall
if the target is a fifo. After opening a trace file, check that it is a
regular file, and if not, return an error.
Robert Watson [Tue, 14 Mar 2006 19:29:45 +0000 (19:29 +0000)]
If fifo_open() is called with a negative file descriptor, return EINVAL
rather than panicking later. This can occur if the kernel calls
vn_open() on a fifo, as there will be no associated file descriptor,
and therefore the file descriptor operations cannot be modified to
point to the fifo operation set.
MFC after: 3 days
Reported by: Martin <nakal at nurfuerspam dot de>
PR: 94278
John Baldwin [Tue, 14 Mar 2006 16:13:55 +0000 (16:13 +0000)]
Don't allow userland to set hardware watch points on kernel memory at all.
Previously, we tried to allow this only for root. However, we were calling
suser() on the *target* process rather than the current process. This
means that if you can ptrace() a process running as root you can set a
hardware watch point in the kernel. In practice I think you probably have
to be root in order to pass the p_candebug() checks in ptrace() to attach
to a process running as root anyway. Rather than fix the suser(), I just
axed the entire idea, as I can't think of any good reason _at all_ for
userland to set hardware watch points for KVM.
MFC after: 3 days
Also thinks hardware watch points on KVM from userland are bad: bde, rwatson
David Xu [Tue, 14 Mar 2006 04:00:21 +0000 (04:00 +0000)]
1. Count last time slice, this intends to fix
"calcru: runtime went backwards" bug for threaded process.
2. Add comment about possible logical problem with scheduler.
John-Mark Gurney [Tue, 14 Mar 2006 00:22:10 +0000 (00:22 +0000)]
spell pdata correctly, we now will only dump maxlen of each mbuf in the
chain, instead of the entire mbuf... This should probably be reworked
so that it prints at max maxlen bytes for the entire chain...
Joerg Wunsch [Mon, 13 Mar 2006 22:32:33 +0000 (22:32 +0000)]
When encountering a ISO_SUSP_CFLAG_ROOT element in Rock Ridge
processing, this actually means there's a double slash recorded in the
symbolic link's path name. We used to start over from / then, which
caused link targets like ../../bsdi.1.0/include//pathnames.h to be
interpreted as /pathnahes.h. This is both contradictionary to our
conventional slash interpretation, as well as potentially dangerous.
The right thing to do is (obviously) to just ignore that element.
bde once pointed out that mistake when he noticed it on the
4.4BSD-Lite2 CD-ROM, and asked me for help.
Reviewed by: bde (about half a year ago)
MFC after: 3 days
Ruslan Ermilov [Mon, 13 Mar 2006 14:58:37 +0000 (14:58 +0000)]
The mount(8) manpage says: "In case of conflicting options being
specified, the rightmost option takes effect." Fix code to obey
this. This makes e.g. "mount -r /usr" or "mount -ar" actually
mount file systems read-only.
Hartmut Brandt [Mon, 13 Mar 2006 09:28:46 +0000 (09:28 +0000)]
There has been a shared libdisk for a couple of days until it was reverted
back to be static-only in january. For this period libdisk was used by
the HOSTRES module for bsnmp which was then rewritten to use libgeom. The
only other consumer of libdisk is sysinstall so removing the shared library
should be safe.
Paul Saab [Mon, 13 Mar 2006 08:13:37 +0000 (08:13 +0000)]
Fix the format/display descriptor of vm.kmem_size and vm.kmem_free
to be 'long' instead of 'int' so that sysctl(8) correctly displays
the 8 returned bytes as a single 'long' instead of two 'int' values.
- Reimplement I/O data allocation to prevent deadlocks.
Submitted by: green
- Speed up synchronization process by using configurable number of I/O
requests in parallel.
+ Add kern.geom.raid3.sync_requests tunable which defines how many parallel
I/O requests should be used.
+ Retire kern.geom.raid3.reqs_per_sync and kern.geom.raid3.syncs_per_sec
sysctls.
- Fix race between regular and synchronization requests.
- Reimplement raid3's data synchronization - do not use the topology lock
for this purpose, as it may case deadlocks.
- Stop synchronization from pre-sync hook.
- Fix some other minor issues.
Tested by: Mike Tancsa <mike@sentex.net>
MFC after: 3 days
Daniel Eischen [Mon, 13 Mar 2006 00:59:51 +0000 (00:59 +0000)]
Add compatibility symbol maps. libpthread (.so.1 and .so.2)
used LIBTHREAD_1_0 as its version definition, but now needs
to define its symbols in the same namespace used by libc.
The compatibility hooks allows you to use libraries and
binaries built and linked to libpthread before libc was
built with symbol versioning. The shims can be removed if
libpthread is given a version bump.
- Speed up synchronization process by using configurable number of I/O
requests in parallel.
+ Add kern.geom.mirror.sync_requests tunable which defines how many parallel
I/O requests should be used.
+ Retire kern.geom.mirror.reqs_per_sync and kern.geom.mirror.syncs_per_sec
sysctls.
- Fix race between regular and synchronization requests.
- Reimplement mirror's data synchronization - do not use the topology lock
for this purpose, as it may case deadlocks.
- Stop synchronization from pre-sync hook.
- Fix some other minor issues.
Daniel Eischen [Mon, 13 Mar 2006 00:56:02 +0000 (00:56 +0000)]
Add hooks to build libc with symbol versioning. This is
disabled by default; add SYMVER_ENABLED=true to /etc/make.conf
to enable it. libc should get a version bump before this is
enabled by default.
Damien Bergamini [Sun, 12 Mar 2006 18:54:40 +0000 (18:54 +0000)]
o don't use '-' characters in firmware names
o call firmware_put() early to release the firmware module
o on firmware panics or watchdog timeouts, schedule a task to reinitialize
the interface (we may sleep in iwi_init())
o discard oversized rx frames
Flush stdout after printing name of created device, so it can be properly
read when 'ggatec create' is used in backticks or its output is piped to
another command.
Jeff Roberson [Sun, 12 Mar 2006 05:26:12 +0000 (05:26 +0000)]
- Remove the call to softdep_waitidle after suspending the filesystem.
This does not do what I wanted as all dirty buffers must be flushed
by the call to ffs_sync and any remaining dependency work would mean
that this failed.