Alfred Perlstein [Mon, 26 Feb 2001 09:07:55 +0000 (09:07 +0000)]
Santize a size variable passed to kernel malloc.
Since we know there's always an upper bound we force that bound,
otherwise users can cause a panic via malloc getting hit with a
odd (huge or negative) amount of memory to allocate.
Tested by: kris
Pointed out by: Andrey Valyaev <dron@infosec.ru>
Seigo Tanimura [Mon, 26 Feb 2001 07:36:24 +0000 (07:36 +0000)]
- Mutexify midi(4). The driver runs under the giant lock by default.
If you ever want to run midi(4) out of the giant lock, uncomment
MIDI_OUTOFGIANT in midi.h. Confirmed to work for csamidi with WITNESS
and INVARIANTS.
- midi_info, midi_open and seq_info are now tailqs, allowing arbitrary
numbers of devices to be configured.
- Do not send an active sensing message to reset midi modules.
- Clone /dev/sequencer*. /dev/sequencer0 and /dev/sequencer are generated
upon initialization.
Jonathan Lemon [Mon, 26 Feb 2001 04:16:19 +0000 (04:16 +0000)]
Document various changes to kq:
- new EV_SET macro,
- NOTE_LOWAT option for low water marks on read/write filters,
- NOTE_REVOKE for filesystem unmounting (and revoke() calls)
- improved API for EVFILT_AIO
Kris Kennaway [Mon, 26 Feb 2001 03:41:13 +0000 (03:41 +0000)]
More IP option length validation.
Includes the following revisions from KAME (two of these were actually
committed previously but the CVS revisions weren't documented):
Mike Smith [Sun, 25 Feb 2001 22:48:34 +0000 (22:48 +0000)]
Major update and bugfix for the 'mly' driver.
- Convert to a more efficient queueing implementation.
- Don't allocate command buffers on the fly; simply work from a
static pool.
- Add a control device interface, for later use.
- Handle controller overload better as a consequence of the
improved queue implementation.
- Add support for the XPT_GET_TRAN_SETTINGS ccb, and correctly
set the virtual SCSI channels up for multiple outstanding I/Os.
- Update copyrights for 2001.
- Some whitespace fixes to improve readability.
Due to a misunderstanding on my part, previous versions of the
driver were limited to a single outstanding I/O per virtual drive.
Needless to say, this update improves performance substantially.
Kris Kennaway [Sun, 25 Feb 2001 21:42:12 +0000 (21:42 +0000)]
Update the list of OpenSSL manpages (now contains many more describing
libssl, for example), and hide it behind a make.conf option,
WANT_OPENSSL_MANPAGES, instead of having it commented out. We still can't
install these by default because of clobbering of a number of system
manpages with the same name, but they're there for people who want them.
Gary Jennejohn [Sun, 25 Feb 2001 19:52:42 +0000 (19:52 +0000)]
Use vsnprintf in logmsg() to avoid overflowing the array on the stack.
The problem was noted with an older model 3Com 3C589 which seems
to return more than 256 bytes of data.
These patches are the original work of Randell Jesup, and
I believe Matt Dillon, with additional work by Warner Losh.
Please let me know if I've left someone out.
Incorporated into this is the fix for PR bin/22727.
This patchset still has style issues and a possible problem on
large disks. However, it was a agreed to get these committed before
performing major surgery on them.
Jonathan Lemon [Sun, 25 Feb 2001 15:17:24 +0000 (15:17 +0000)]
Do not delay a new ack if there already is a delayed ack pending on the
connection, but send it immediately. Prior to this change, it was possible
to delay a delayed-ack for multiple times, resulting in degraded TCP
behavior in certain corner cases.
o Support AUTO SENSE correctly.
o Offset and period in synch messages and width negotiation should be
done for per target not per lun. Move these from *lun_info to
*targ_info.
o Change in handling XPT_RESET_DEV and XPT_GET_TRAN_SETTINGS .
o Change CAM_* xpt_done return values.
o Busy loop did not timeout. Change this to timeout as original NetBSD/pc98.
Peter Wemm [Sun, 25 Feb 2001 07:51:19 +0000 (07:51 +0000)]
genassym.sh does not work with a.out because the sizes are rounded up
by the compiler. ie: char foo[0] comes out as 4 bytes on a.out, and
we depended on it coming out as 0 for the script version. :-(
Make double sure that genassym.o is built and nm'ed in elf mode.
(ia64 skipped since it is stuck on the linux toolchain and doesn't
understand the -elf switches)
Peter Wemm [Sun, 25 Feb 2001 07:44:39 +0000 (07:44 +0000)]
Make the kernel actually compile and link under a.out, using
gcc -aout -mno-underscores. The bioscall.s tweak is not an a.out
requirement really, but to work around the bugs in the antique version of
gas that used for a.out. Makefile hacks are all that is needed to
get an a.out kernel. There is no telling if it will work though.
This is little more than an academic curiosity anyway since all it is
good for is situations where the boot code is hard wired, eg: rom
bootstraps (such as the gnat box).
GENERIC:
...
size -aout kernel ; chmod 755 kernel
text data bss dec hex 3051520 368640 198688 3618848 373820
Jake Burkholder [Sun, 25 Feb 2001 06:29:04 +0000 (06:29 +0000)]
Remove the leading underscore from all symbols defined in x86 asm
and used in C or vice versa. The elf compiler uses the same names
for both. Remove asnames.h with great prejudice; it has served its
purpose.
Note that this does not affect the ability to generate an aout kernel
due to gcc's -mno-underscores option.
Julian Elischer [Sun, 25 Feb 2001 05:34:33 +0000 (05:34 +0000)]
Add a Makefile for the sample node so It can be compiled.
This helps to stop it from geting out of sync.
It is not part of the normal build but I can use it with all the others
when I make changes to netgraph to ensure it is buildable.
Jake Burkholder [Sun, 25 Feb 2001 02:53:06 +0000 (02:53 +0000)]
- Rename the lcall system call handler from Xsyscall to Xlcall_syscall
to be more like Xint0x80_syscall and less like c function syscall().
- Reduce code duplication between the int0x80 and lcall handlers by
shuffling the elfags into the right place, saving the sizeof the
instruction in tf_err and jumping into the common int0x80 code.
David E. O'Brien [Sat, 24 Feb 2001 22:20:11 +0000 (22:20 +0000)]
MFS: bring the consistent `compat_3_brand' support into -CURRENT
(the work was first done in the RELENG_4 branch near a release
during a MFC to make the code cleaner and more consistent)
John Baldwin [Sat, 24 Feb 2001 19:36:13 +0000 (19:36 +0000)]
- Axe RETIP() as it was very i386 specific and unwieldy. Instead, use the
passed in filename and line number in the KTR tracepoint message.
- Even though it is #if 0'd code, change the code to detect that a process
is an interrupt thread to check p->p_ithd against NULL rather than
checking non-existant process flags from BSD/OS.
- Use '%p' to print pointers in KTR log messages instead of assuming
sizeof(int) == sizeof(void *).
- Don't set p_mtxname to NULL when releasing a mutex. It doesn't hurt
to leave it set (we don't clear w_mesg for example) and at least at
one time in the past, there used to be race conditions in the kernel
that would result in setting this to NULL causing the kernel to
dereference NULL.
- Make the _mtx_assert() function be compiled in if INVARIANTS_SUPPORT is
defined rather than if INVARIANTS is defined so that a KLD compiled
with INVARIANTS that uses mtx_assert() can be used with a kernel that
just has INVARIANT_SUPPORT compiled in.
Jake Burkholder [Sat, 24 Feb 2001 14:06:36 +0000 (14:06 +0000)]
- Assert that the proc to return is not NULL in runq_choose the
same as runq_remove.
- bzero the whole struct runq in runq_init just in case its not
statically allocated.
Jonathan Lemon [Sat, 24 Feb 2001 01:41:31 +0000 (01:41 +0000)]
Introduce a NOTE_LOWAT flag for use with the read/write filters, which
allow the watermark to be passed in via the data field during the EV_ADD
operation.
Hook this up to the socket read/write filters; if specified, it overrides
the so_{rcv|snd}.sb_lowat values in the filter.
Inspired by: "Ronald F. Guilmette" <rfg@monkeys.com>
Jonathan Lemon [Sat, 24 Feb 2001 01:33:12 +0000 (01:33 +0000)]
When returning EV_EOF for the socket read/write filters, also return
the current socket error in fflags. This may be useful for determining
why a connect() request fails.
Warner Losh [Sat, 24 Feb 2001 00:02:55 +0000 (00:02 +0000)]
Force TERM to be dumb when building termcap. ex in batch mode seems
to care about the terminal setting. In emacs, make buildworld was
broken because it sets TERM to emacs, which caused ex to fail.
Jonathan Lemon [Fri, 23 Feb 2001 21:07:06 +0000 (21:07 +0000)]
When converting soft error into a hard error, drop the connection. The
error will be passed up to the user, who will close the connection, so
it does not appear to make a sense to leave the connection open.
This also fixes a bug with kqueue, where the filter does not set EOF
on the connection, because the connection is still open.
Also remove calls to so{rw}wakeup, as we aren't doing anything with
them at the moment anyway.
Jonathan Lemon [Fri, 23 Feb 2001 20:51:46 +0000 (20:51 +0000)]
Allow ICMP unreachables which map into PRC_UNREACH_ADMIN_PROHIB to
reset TCP connections which are in the SYN_SENT state, if the sequence
number in the echoed ICMP reply is correct. This behavior can be
controlled by the sysctl net.inet.tcp.icmp_may_rst.
Currently, only subtypes 2,3,10,11,12 are treated as such
(port, protocol and administrative unreachables).
Assocaiate an error code with these resets which is reported to the
user application: ENETRESET.
Disallow resetting TCP sessions which are not in a SYN_SENT state.
Jonathan Lemon [Fri, 23 Feb 2001 20:06:01 +0000 (20:06 +0000)]
Add a NOTE_REVOKE flag for vnodes, which is triggered from within vclean().
Use this to tell a filter attached to a vnode that the underlying vnode is
no longer valid, by returning EV_EOF.
Robert Watson [Fri, 23 Feb 2001 18:52:37 +0000 (18:52 +0000)]
Adapt the top utility to not use kmem_read to retrieve variables now
available via sysctl(). As a result, top should now be able to run without
setgid kmem.
Submitted by: Thomas Moestl <tmoestl@gmx.net>
Reviewed by: freebsd-audit
Robert Watson [Fri, 23 Feb 2001 18:49:16 +0000 (18:49 +0000)]
Adapt libkvm_getswapinfo() to make use of recently committed vm and swap
sysctls exporting swap information. When running on a live kernel,
the sysctl's will now be used instead of kvm_read, allowing consumers of
this interface to run without privilege (setgid kmem). Retain the
ability to run on coredumps, or on a kernel using kmem if explicitly
pointed at one.
A side effect of this change is that kvm_getswapinfo() is faster now in
the general case. If the SWIF_DUMP_TREE flag is given (pstat -ss does
this), the radix tree walker, which still uses kvm_read in any case, is
invoked, and therefore does require privilege.
Submitted by: Thomas Moestl <tmoestl@gmx.net>
Reviewed by: freebsd-audit
Robert Watson [Fri, 23 Feb 2001 18:46:21 +0000 (18:46 +0000)]
Introduce per-swap area accounting in the VM system, and export
this information via the vm.nswapdev sysctl (number of swap areas)
and vm.swapdevX nodes (where X is the device), which contain the MIBs
dev, blocks, used, and flags. These changes are required to allow
top and other userland swap-monitoring utilities to run without
setgid kmem.
Submitted by: Thomas Moestl <tmoestl@gmx.net>
Reviewed by: freebsd-audit
John Baldwin [Fri, 23 Feb 2001 18:31:26 +0000 (18:31 +0000)]
Fix release. Just as in other kerberos5 libraries, we need to include
${.OBJDIR} in the includes list and generate a couple of headers from their
.et sources for beforedepend and all.