jasone [Mon, 16 Jan 2006 05:13:49 +0000 (05:13 +0000)]
Add a separate simple internal base allocator and remove base_arena, so that
there is never any need to recursively call the main allocation functions.
Remove recursive spinlock support, since it is no longer needed.
rwatson [Mon, 16 Jan 2006 00:52:20 +0000 (00:52 +0000)]
Replace strncpy() with strlcpy() when parsing login time limit strings
from /etc/login.conf, or an unterminated string buffer could result.
Probably, login_times.c should reject excessively long time strings as
unparseable, rather than truncating, which might render an invalid
string valid.
Found with: Coverity Prevent (tm)
Reviewed by: csjp
MFC after: 3 days
rwatson [Mon, 16 Jan 2006 00:37:20 +0000 (00:37 +0000)]
Remove unnecessary and undesirable 'static' from function-local keg
list, which could cause problems for multi-threaded applications
using libmemstat to monitor UMA in more than one thread
simultaneously.
marcel [Mon, 16 Jan 2006 00:32:46 +0000 (00:32 +0000)]
Define NO_TLS on ia64. The dynamic TLS implementation on ia64 is
broken for non-threaded shared processes in that __tls_get_addr()
assumes the thread pointer is always initialized. This is not the
case. When arenas_map is referenced in choose_arena() and it is
defined as a thread-local variable, it will result in a SIGSEGV.
ceri [Sun, 15 Jan 2006 23:12:26 +0000 (23:12 +0000)]
Marius Nuennerich pointed out that nextboot(8) configured boot options
were now sticky. This script was deleting /boot/nextkernel on boot, but
there is no code in the tree that creates that file since revision 1.15
of src/sbin/reboot/reboot.c.
nextboot(8) creates /boot/nextboot.conf, so remove that instead.
ceri [Sun, 15 Jan 2006 22:57:17 +0000 (22:57 +0000)]
If sysinstall was used to configure an anonymous FTP area, it was
possible for information to be copied from the group file to the group
file in the FTP area. This patch based on a patch from Zak Johnson
<zakj at nox dot cx>.
PR: bin/25851
Submitted by: Ted Mittelstaedt <tedm at toybox punkt placo period com>
Approved by: jhb (proxy mentor)
MFC after: 3 days
MFC to: RELENG_5, RELENG_6
Security: Prevents possible group information leakage
ceri [Sun, 15 Jan 2006 22:42:38 +0000 (22:42 +0000)]
Correct obsolete chown syntax.
PR: bin/90057
Submitted by: Charlie M. McDonald <BoredOutkast at yahoo punkt com>
Approved by: jhb (mentor by proxy)
MFC to: RELENG_5, RELENG_6
MFC After: 3 days
iedowse [Sun, 15 Jan 2006 21:03:19 +0000 (21:03 +0000)]
Work around a problem seen on VIA EHCI controllers where occasionally
an interrupt appears to occur before the transfer has been marked
as completed. This caused umass transfers to get stuck, especially
when writing large files. The workaround sets up a timer that
rechecks for missed completed transfers if some operations are still
pending. Other suggested workarounds, such as performing a PCI read
immediately after acknowledging the interrupts, do not appear to
help.
iedowse [Sun, 15 Jan 2006 20:41:04 +0000 (20:41 +0000)]
Set sc_dying to 1 when detaching. In NetBSD and OpenBSD this was
done by the DVACT_DEACTIVATE case in *hci_activate(), but we don't
use that code in FreeBSD so it was never set.
csjp [Sun, 15 Jan 2006 20:14:11 +0000 (20:14 +0000)]
vfs_busy can only return something useful if MNTK_UNMOUNT has been set.
Since we are using vfs_busy() on a freshly allocated mount structure, use
(void) to show that we do not care about the return value.
Found with: Coverity Prevent (tm)
MFC after: 2 weeks
rwatson [Sun, 15 Jan 2006 20:01:05 +0000 (20:01 +0000)]
Cast VFS_STATFS() in vfs_domount() to (void) to indicate that ignoring the
return value is intentional: this is simply an attempt to pre-cache the
statfs state.
Found with: Coverity Prevent (tm)
MFC after: 3 days
rwatson [Sun, 15 Jan 2006 18:58:21 +0000 (18:58 +0000)]
Modify the IP fragment reassembly code so that it uses a new UMA zone,
ipq_zone, to allocate fragment headers from, rather than using cast mbuf
storage. This was one of the few remaining uses of mbuf storage for
local data structures that relied on dtom(). Implement the resource
limit on ipq's using UMA zone limits, but preserve current sysctl
semantics using a sysctl proc.
brooks [Sat, 14 Jan 2006 17:57:17 +0000 (17:57 +0000)]
When SC_DISABLE_KDBKEY or SC_DISABLE_REBOOT are not defined allow the
same behavior to be controlled by the sysctls, hw.syscons.kbd_kbdkey
and hw.syscons.kbd_reboot respectively.
Apologies to the submitter for taking so long to commit this simple
change.
PR: kern/72728
Submitted by: Luca Morettoni <morettoni at libero dot it>
MFC After: 3 days
bz [Sat, 14 Jan 2006 15:35:21 +0000 (15:35 +0000)]
The LinkSys EG1032 is supported by re(4) not nge(4) [1].
I couldn't find the ID for the EG1064 anywhere in our sources
so I removed the reference for now.
Pointed out by: Robert Huff <roberthuffi at rcn dot com> [1]
Reviewed by: simon
mjacob [Sat, 14 Jan 2006 14:32:41 +0000 (14:32 +0000)]
Incorporate the O_NONBLOCK open semantics of Linux and Solaris. This allows
an application to upon a tape (yea, even the non-control device) even if
it cannot establish a mount session. If the open cannot establish a mount
session and O_NONBLOCK was specified, the tape becomes 'open pending mount'.
All I/O operations that would require access to a tape thereafter until
a close attempt to initiate the mount session. If the mount session succeeds,
the tape driver transitions to full open state, else returns an appropriate
I/O error (ENXIO).
At the same time, add a change that remembers whether tape is being opened
read-only. If so, disallow 'write' operations like writing filemarks that
bypass the normal read-only filtering operations that happen in the write(2)
syscall.
Reviewed by: ken, justin, grog
MFC after: 2 weeks
Suggested by: The Bacula Team
glebius [Sat, 14 Jan 2006 13:04:08 +0000 (13:04 +0000)]
UMA can return NULL not only in case when our zone is full, but
also in case of generic memory shortage. In the latter case we may
not find an old entry.
rwatson [Sat, 14 Jan 2006 11:40:32 +0000 (11:40 +0000)]
In ncp_sysctl_connstat(), the SLIST_FOREACH() logic to check 'error'
resulted in deadcode, as 'error' could never be 0. What this logic
was originally meant to handle is not clear -- it's been this way
(broken) since at least RELENG_4.
Found with: Coverity Prevent(tm)
MFC after: 3 days
thompsa [Sat, 14 Jan 2006 03:51:31 +0000 (03:51 +0000)]
Add code that clears certain capabilities from the member interface, these are
restored when its removed from the bridge.
At the moment we only clear IFCAP_TXCSUM. Since a locally generated packet on
the bridge may be sent out any one or more interfaces it cant be assumed that
every card does hardware csums. Most bridges don't generate a lot of traffic
themselves so turning off offloading won't hurt, bridged packets are
unaffected.
Tested by: Bruce Walker (bmw borderware.com)
MFC after: 5 days
scottl [Sat, 14 Jan 2006 01:55:24 +0000 (01:55 +0000)]
Add the following to the taskqueue api:
taskqueue_start_threads(struct taskqueue **, int count, int pri,
const char *name, ...);
This allows the creation of 1 or more threads that will service a single
taskqueue. Also rework the taskqueue_create() API to remove the API change
that was introduced a while back. Creating a taskqueue doesn't rely on
the presence of a process structure, and the proc mechanics are much better
encapsulated in taskqueue_start_threads(). Also clean up the
taskqueue_terminate() and taskqueue_free() functions to safely drain
pending tasks and remove all associated threads.
The TASKQUEUE_DEFINE and TASKQUEUE_DEFINE_THREAD macros have been changed
to use the new API, but drivers compiled against the old definitions will
still work. Thus, recompiling drivers is not a strict requirement.
rwatson [Sat, 14 Jan 2006 00:05:44 +0000 (00:05 +0000)]
In spx_attach() and spx_detach(), there is no need to check whether the
ipxpcb is NULL or not: in attach it will be, and on detach it won't be.
If for any reason these invariants don't hold true, panicking is a good
idea.
Noticed by: Coverity Prevent analysis tool
MFC after: 3 days
rwatson [Fri, 13 Jan 2006 23:53:23 +0000 (23:53 +0000)]
In ipcomp6_input(), check 'md' not 'm' after a call to m_pulldown(): 'm'
may be a stale pointer at this point, and we're interested in whether or
not m_pulldown() failed.
Noticed by: Coverity Prevent analysis tool
MFC after: 3 days
rwatson [Fri, 13 Jan 2006 23:47:55 +0000 (23:47 +0000)]
Remove dead code associated with 'mcopy' in ipx_forward(): at no point
are the contents of the forwarded mbuf ever copied into mcopy, so there's
no need to have mcopy, conditionally look at mcopy, or conditionally free
it.
Noticed by: Coverity Prevent analysis tool
MFC after: 3 days
rwatson [Fri, 13 Jan 2006 23:20:46 +0000 (23:20 +0000)]
When freeing the chain of if_ef devices on an aborted load, use
SLIST_FOREACH_SAFE() rather than SLIST_FOREACH(), as elements are
freed on each iteration of the loop. This prevents use-after-free.
Noticed by: Coverity Prevent analysis tool
MFC after: 3 days
rwatson [Fri, 13 Jan 2006 10:22:01 +0000 (10:22 +0000)]
Add sosend_dgram(), a greatly reduced and simplified version of sosend()
intended for use solely with atomic datagram socket types, and relies
on the previous break-out of sosend_copyin(). Changes to allow UDP to
optionally use this instead of sosend() will be committed as a
follow-up.
oleg [Fri, 13 Jan 2006 08:59:40 +0000 (08:59 +0000)]
1) move all link state detection code from bge_tick_locked() to bge_link_upd()
2) use more robust way of link state handling for BCM5700 rev.B2 chip
3) workaround bug of some BCM570x chips which cause spurious "link up" messages
4) fix bug: some BCM570x chips was unable to detect link state changes after
ifconfig down/up sequence until any 'non-link related' interrupt generated.
(this happened due to pending internal link state attention which blocked
interrupt generation)
scottl [Fri, 13 Jan 2006 08:18:04 +0000 (08:18 +0000)]
Fix the interrupt race for real. Don't register the interrupt until after
the the interface has been configured. I'm not sure how this could ever
have worked before, but it should be fixed now. Also break out the interrupt
degresitration function into it's own step.
scottl [Fri, 13 Jan 2006 05:04:27 +0000 (05:04 +0000)]
Disable interrupts while we are setting up the handler. The interrupt really
shouldn't be set up or enabled until much later, but that will be investigated
at a later time.