tar archives, including a potentially exploitable buffer overflow.
Approved by: so (cperciva)
Reviewed by: kientzle
Security: FreeBSD-SA-07:05.libarchive
Limit the size of public keys used in order to protect applications
from a denial of service via insane key sizes.
Security: FreeBSD-SA-06:23.openssl
Approved by: so (cperciva)
Correct multiple denial-of-service vulnerabilities in BIND related to
SIG Query Processing and Excessive Recursive Queries. [2]
Security: FreeBSD-SA-06:19.openssl [1]
Security: FreeBSD-SA-06:20.bind [2]
Approved by: so (simon)
Correct a bug in the handling of backslash characters in smbfs which can
allow an attacker to escape from a chroot(2). [2]
Approved by: so (cperciva)
Security: FreeBSD-SA-06:15.ypserv [1]
Security: FreeBSD-SA-06:16.smbfs [2]
Fix binary upgrades by accounting for the schg flag on /var/empty.
PR: 96711, 96780
Submitted by: Nobuyuki Koganemaru, Martin Jackson
Approved by: re (scottl)
- If no pidfile has been created at startup, only stop processes
with current jid.
src/etc/rc.subr: rev 1.53 -> 1.55
PR: conf/93287
Submitted by: anders
Approved by: re (scottl)
- Add following global jail options, used if no jail-specific options are
set:
* jail_mount_enable
* jail_devfs_ruleset
* jail_devfs_enable
* jail_fdescfs_enable
* jail_procfs_enable
* jail_fstab
* jail_flags
- Add a jail_interface / jail_<jid>_interface option. An ip alias will be
created (jail_<jid>_ip) on jail_interface or jail_<jid>_interface if set.
This is not a mandatory option.
- Document all missing jail_* options in rc.conf(5).
src/share/man/man5/rc.conf.5: rev 1.289 -> 1.290
src/etc/rc.d/jail: rev 1.26 -> 1.27
Approved by: re (scottl)
We shouldn't lock the topology here - we will panic on assertion inside
g_raid3_bump_syncid().
Reported by: Bradley W. Dutton <[email protected]>
Approved by: re (kensmith)
The removal of CIRCLEQ left four queue macro families, but one sentence
in the man page wasn't updated.
PR: docs/94938
Submitted by: Ed Schouten <[email protected]>
Approved by: re
pad (cisco calls it sampling_interval) fields in netflow v5 header.
MFC rev. 1.4 netflow.h: replace disappeared URLs to Cisco docs by
new ones, style.
Approved by: re (kensmith)
> Clear TDF_SINTR in sleepq_resume_thread, also sleepq_catch_signal does
> not need to clear it now, this should fix panic when msleep is recursivly
> called. Patch is slightly adjusted after review.
Approved by: re (scottl)
> jhb 2006-04-06 17:17:45 UTC
>
> FreeBSD src repository
>
> Modified files:
> sys/i386/i386 machdep.c
> sys/i386/isa npx.c
> Log:
> - Don't set CR0_NE and CR0_MP in npx_probe() as they are already set
> earlier in cpu_setregs().
> - If we know this CPU has a FPU via cpuid, then just assume the INT16
> interface and make the npx device quiet to not clutter the dmesg. This
> is true for all Pentium and later CPUs and even some of the later 486dx
> CPUs.
>
> Reviewed by: bde
> Tested by: ps
> MFC after: 1 week
>
> Path Revision
> src/sys/i386/i386/machdep.c 1.625
> src/sys/i386/isa/npx.c 1.164
Requested by: jhb
Approved by: re (scottl)
> jhb 2006-04-06 17:17:45 UTC
>
> FreeBSD src repository
>
> Modified files:
> sys/i386/i386 machdep.c
> sys/i386/isa npx.c
> Log:
> - Don't set CR0_NE and CR0_MP in npx_probe() as they are already set
> earlier in cpu_setregs().
> - If we know this CPU has a FPU via cpuid, then just assume the INT16
> interface and make the npx device quiet to not clutter the dmesg. This
> is true for all Pentium and later CPUs and even some of the later 486dx
> CPUs.
>
> Reviewed by: bde
> Tested by: ps
> MFC after: 1 week
>
> Path Revision
> src/sys/i386/i386/machdep.c 1.625
> src/sys/i386/isa/npx.c 1.164
Requested by: jhb
Approved by: re (scottl)
> date: 2006/04/28 05:39:58; author: silby; state: Exp; lines: +20 -17
> MFC revs 1.33, 1.34, 1.35, and 1.36.
>
> These changes allow bfe to work on machines with > 1GB of ram.
Requested by: silby (who didn't have a RELENG_6_1 tree to work with)
Approved by: re (kensmith)
> - Lock giant when assigning ni_vp and keep vfslocked state valid.
> - Consistently track ni_dvp and ni_vp with dvfslocked and vfslocked rather
> than trying to optimize it into a single lock. This adds more calls to
> lock giant with non smpsafe filesystems but is the only way to reliably
> hold the correct lock.
> - Remove an invalid assert in the mountedhere case in lookup and fix the
> code to properly deal with the scenario. We can actually have a lookup
> that returns dp == dvp with mountedhere set with certain unmount races.
Approved by: re (scottl)
> - Lock giant when assigning ni_vp and keep vfslocked state valid.
> - Consistently track ni_dvp and ni_vp with dvfslocked and vfslocked rather
> than trying to optimize it into a single lock. This adds more calls to
> lock giant with non smpsafe filesystems but is the only way to reliably
> hold the correct lock.
> - Remove an invalid assert in the mountedhere case in lookup and fix the
> code to properly deal with the scenario. We can actually have a lookup
> that returns dp == dvp with mountedhere set with certain unmount races.
Approved by: re (scottl)
> Bump up the NFS server dupreq cache limit to 2K (from 64). With a small
> duplicate request cache, under heavy load a lot of non-idempotent requests
> were getting served again, resulting in errors.
Approved by: re (scottl)
> Bump up the NFS server dupreq cache limit to 2K (from 64). With a small
> duplicate request cache, under heavy load a lot of non-idempotent requests
> were getting served again, resulting in errors.
Approved by: re (scottl)
- Don't hold the device sx lock when going to sleep.
- Prevent possible live-lock in case of memory problems by freeing
already completed requests first.
Reported and tested by: markus, Bradley W. Dutton <[email protected]>
Approved by: re (hrs)
- Don't hold the device sx lock when going to sleep.
- Prevent possible live-lock in case of memory problems by freeing
already completed requests first.
Reported and tested by: markus, Bradley W. Dutton <[email protected]>
Approved by: re (hrs)
# [1.3]
# Add more details about enabling a custom ruleset for /dev in `rc.conf',
# and add ruleset labels/numbering to the custom ruleset example.
#
# PR: docs/90362
# Submitted by: Roland Smith <[email protected]>
# MFC after: 3 days
# [1.4]
# Expand contractions.
Approved by: re (hrs)
# [1.3]
# Add more details about enabling a custom ruleset for /dev in `rc.conf',
# and add ruleset labels/numbering to the custom ruleset example.
#
# PR: docs/90362
# Submitted by: Roland Smith <[email protected]>
# MFC after: 3 days
# [1.4]
# Expand contractions.
Approved by: re (hrs)
* top.X
revision 1.15
Document the -C option of top(1), which has been added to the source
and the usage message of top, but not to the manpage.
Pointy hat to: keramida
Reminded by: ru
MFC after: 1 week
* top.c
revision 1.18
Bring SYNOPSIS in line with usage().
----------
revision 1.19
Re-add option -C to usage().
Approved by: re (hrs)
Fix a one byte off error which causes "less" to crash if you view a
large file, jump to the end, scroll backwards with "b" and try to search
backwards afterwards.
Submitted by: Matthias Scheler
Approved by: re (hrs)
Fix a one byte off error which causes "less" to crash if you view a
large file, jump to the end, scroll backwards with "b" and try to search
backwards afterwards.
Submitted by: Matthias Scheler
Approved by: re (hrs)
Fix storing offset of already synchronized data. Offset in entire array was
stored in metadata instead of an offset in single disk.
After reboot/crash synchronization process started from a wrong offset
skipping (not synchronizing) part of the component which can lead to data
corrutpion (when synchronization process was interrupted on initial
synchronization) or other strange situations like 'graid3 status' showing
value more than 100%.
Reported, reviewed and tested by: ru
Reported by: Dmitry Morozovsky <[email protected]>
Approved by: re (hrs)
Fix storing offset of already synchronized data. Offset in entire array was
stored in metadata instead of an offset in single disk.
After reboot/crash synchronization process started from a wrong offset
skipping (not synchronizing) part of the component which can lead to data
corrutpion (when synchronization process was interrupted on initial
synchronization) or other strange situations like 'graid3 status' showing
value more than 100%.
Reported, reviewed and tested by: ru
Reported by: Dmitry Morozovsky <[email protected]>
Approved by: re (hrs)
sys/sparc64/sparc64/interrupt.S 1.9
- In intr_fast() fix a race which is fallout from critical sections no longer
raising the PIL and can cause corruption of the interrupt request lists.
- In intr_fast() assert that the ir_func to be called is non-zero.
- Increment interrupt stats after calling the handlers rather than before in
order to reduce the delay until direct and fast handlers are serviced.
Approved by: re (hrs)
sys/sparc64/sparc64/interrupt.S 1.9
- In intr_fast() fix a race which is fallout from critical sections no longer
raising the PIL and can cause corruption of the interrupt request lists.
- In intr_fast() assert that the ir_func to be called is non-zero.
- Increment interrupt stats after calling the handlers rather than before in
order to reduce the delay until direct and fast handlers are serviced.
Approved by: re (hrs)
script note to the correct section.
Not quite an MFC but this change is roughly equivalent to rev. 1.916,
plus a couple of fixes that are only applicable to RELENG_6_1.
Approved by: re (hrs)
Add support for (latest) VIA VT8251 audio controller.
A slight difference of this chip from its previous siblings is that
it need a gentle "wake up" on every (full) DMA buffer completion to
avoid stalled interrupt handler.
Thanks to George Hartzell for permission on doing remote debugging.
PR: i386/95949
Tested by: [1] George Hartzel
myself (remotely)
Approved by: re (hrs)
[1] http://lists.freebsd.org/pipermail/freebsd-multimedia/2006-April/004003.html
Add support for (latest) VIA VT8251 audio controller.
A slight difference of this chip from its previous siblings is that
it need a gentle "wake up" on every (full) DMA buffer completion to
avoid stalled interrupt handler.
Thanks to George Hartzell for permission on doing remote debugging.
PR: i386/95949
Tested by: [1] George Hartzel
myself (remotely)
Approved by: re (hrs)
[1] http://lists.freebsd.org/pipermail/freebsd-multimedia/2006-April/004003.html
- Print number of physical/logical cores and more CPUID info.
- Add newer CPUID definitions for future use.
- Correct few MSR addresses while I am here.
- Fix spelling mistake.
Approved by: re (hrs)
- Print number of physical/logical cores and more CPUID info.
- Add newer CPUID definitions for future use.
- Correct few MSR addresses while I am here.
- Fix spelling mistake.
Approved by: re (hrs)
date: 2006/04/19 05:10:34; author: delphij; state: Exp; lines: +1 -1
Make ldconfig as SERVER dependency. This makes it possible
for some early starting services from the ports collection
to have their shared objects available before start.
Reviewed by: freebsd-rc (dougb, brooks)
Approved by: re (hrs)
date: 2006/04/19 05:10:34; author: delphij; state: Exp; lines: +1 -1
Make ldconfig as SERVER dependency. This makes it possible
for some early starting services from the ports collection
to have their shared objects available before start.
Reviewed by: freebsd-rc (dougb, brooks)
Approved by: re (hrs)
Fix ypwhich -m. This should be MFC'ed back at least as far as RELENG_5.
Submitted by: Gil Kloepfer <[email protected]>
PR: 64445
Approved by: re (scottl)
Fix ypwhich -m. This should be MFC'ed back at least as far as RELENG_5.
Submitted by: Gil Kloepfer <[email protected]>
PR: 64445
Approved by: re (scottl)
introduced in 1.73 is included for 6.1-release. The original
bug wrt specifying a new column header for an aliased `-o' option
also remains fixed.
Approved by: re (scottl)
and src/sys/nfsclient/nfs_vnops.c,v 1.262 (by ps@):
- Always return success from NFS strategy. nfs_doio(), in the
event of an error, does the right thing, in terms of setting
the error flags in the buf header. That fixes a crash from
bstrategy().
- Treat ETIMEDOUT as a "recoverable" error, causing the buffer
to be re-dirtied. ETIMEDOUT can occur on soft mounts, when
the number of retries are exceeded, and we don't want data loss
in that case.
Submitted by: Mohan Srinivasan
Approved by: re (scottl)
and src/sys/nfsclient/nfs_vnops.c,v 1.262 (by ps@):
- Always return success from NFS strategy. nfs_doio(), in the
event of an error, does the right thing, in terms of setting
the error flags in the buf header. That fixes a crash from
bstrategy().
- Treat ETIMEDOUT as a "recoverable" error, causing the buffer
to be re-dirtied. ETIMEDOUT can occur on soft mounts, when
the number of retries are exceeded, and we don't want data loss
in that case.
Submitted by: Mohan Srinivasan
Approved by: re (scottl)
use pwrite to always write at the begining of the file.. If multiple calls
to pidfile_write happen, the pidfile will have nul characters prepended
due to the cached file descriptor offset...
Approved by: re (scottl)
use pwrite to always write at the begining of the file.. If multiple calls
to pidfile_write happen, the pidfile will have nul characters prepended
due to the cached file descriptor offset...
Approved by: re (scottl)
keyboard controller to get ready (65K x ISA access time, visually around
1 second). If we have wait more than that amount it's likely that the
hardware is a legacy-free one and simply doesn't have keyboard controller
and doesn't require enabling A20 at all.
This makes cdboot/pxeldr working for MacBook Pro with Boot Camp and
other legacy-free i386 hardware like IBM Netvista S40.
Approved by: re (scottl)
This time we avoid the seg-fault while still keeping the column
headers in uppercase. And the original bug wrt specifying a new
column header for an aliased `-o' option remains fixed.
Approved by: re (scottl)
ABI reasons) and call it from intr_event_destroy().
Only in 6: Add API and ABI compat shims for ithread_destroy() to call
intr_event_destroy().
Approved by: re (scottl)
Tested by: Artem Ignatiev <[email protected]>
Stopgap fix to avoid "mutex ipw0 recursed" panics in msleep for recursive
ioctl paths. Instead of using a recursive mutex we use conditional
locking and keep track of the recursion on the stack.
Reported and tested by: Ulrich Spoerlein
Approved by: re (scottl)
ioctl paths. Instead of using a recursive mutex we use conditional locking
and keep track of the recursion on the stack.
Reported and tested by: Ulrich Spoerlein
Approved by: re (scottl)
> Drop the languages we'll build docs for as part of the release down to
> just English due to a ISO size crisis for disc2. This is being done
> after consultation with the doceng folks, who basically agreed that
> of the two evils this is less evil than going with the -lite versions
> of gnome/kde. We are only doing this on RELENG_5/RELENG_6. On HEAD
> we plan to adjust sysinstall so there will be no packages at all on
> disc1/disc2 and we can have an arbitrary number of dedicated package
> discs but that seems like too much of a change for RELENG_5/RELENG_6
> particularly at this stage in the release.
Discussed with: re@, doceng@
Approved by: re (scottl)
just English due to a ISO size crisis for disc2. This is being done
after consultation with the doceng folks, who basically agreed that
of the two evils this is less evil than going with the -lite versions
of gnome/kde. We are only doing this on RELENG_5/RELENG_6. On HEAD
we plan to adjust sysinstall so there will be no packages at all on
disc1/disc2 and we can have an arbitrary number of dedicated package
discs but that seems like too much of a change for RELENG_5/RELENG_6
particularly at this stage in the release.
Discussed with: re@, doceng@
Approved by: re (scottl)
a seg-fault if the user specifies a keyword which is implemented as
an alias to some other keyword.
Submitted by: Kostik Belousov
Approved by: re (scottl)
Retire NETSMBCRYPTO as a kernel option and make its functionality
enabled by default in NETSMB and smbfs.ko.
With the most of modern SMB providers requiring encryption by
default, there is little sense left in keeping the crypto part
of NETSMB optional at the build time.
This will also return smbfs.ko to its former properties users
are rather accustomed to.
Submitted by: yar
Approved by: re (implicitly)
Add "-q" argument to getfacl(1), which suppresses the per-file header
comment listing the file name, owner, and group.
Submitted by: Jan Srzednicki <w at expro dot pl>
Approved by: re (scottl)
Reminded by: delphij
Convert the SYNOPSIS section to look like the ones used in other driver
manpages, mention module support.
Also add the crypto and cryptodev devices as the drivers are kind of useless
without them.
Approved by: re (hrs)
Convert the SYNOPSIS section to look like the ones used in other driver
manpages. Don't mention the include file, it's not important for the
operation of this driver.
Approved by: re (hrs)
- 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.
Approved by: re
dsp.c revision 1.95
mixer.c revision 1.49
sound.c revision 1.103
sound.h revision 1.68
vchan.c revision 1.24
MEGA Fixes / Cleanup
--------------------
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 existed 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.
- Determine open direction using 'flags', not 'mode'. This bug exist
since past 4 years.
- Don't allow opening the same device twice, be it in a same or
different direction.
- O_RDWR is allowed, provided that it is done by a single open (for
example by mixer(8)) and the underlying hardware support true
full-duplex operation.
- Seal the fate of long standing memory leak (4 years, 7 months)
during pcm_unregister(). While destroying cdevs, scan / detect
possible children and free its SLIST placeholder properly.
- Optimize channel allocation / numbering even further. Do brute
cyclic checking only if the channel numbering screwed.
- Mega vchan create/destroy cleanup:
o Implement pcm_setvchans() so everybody can use it freely instead
of implementing their own, be it through sysctl or channel auto
allocation.
o Increase vchan creation/destruction resiliency:
+ it's possible to increase/decrease total vchans even during
busy playback/recording. Busy channel will be left alone,
untouched. Abusive test sample:
# play whatever...
#
while : ; do
sysctl hw.snd.pcm0.vchans=1
sysctl hw.snd.pcm0.vchans=10
sysctl hw.snd.pcm0.vchans=100
sysctl hw.snd.pcm0.vchans=200
done
# Play something else, leave above loop running frantically.
+ Seal another 4 years old bug where it is possible to destroy
(virtual) channel even when its cdevs being referenced by other
process. The "First Come First Served" nature of dsp_clone() is
the main culprit of this issue, and usually manifest itself as
dangling channel <-> process association. Ensure that all of its
cdevs are free from being referenced before destroying it
(through ORPHAN_CDEVT() macross).
Approved by: re (scottl)
Convert NULL checks into KASSERT (and move them before the first
dereferencing) since a NULL value would be a bug here.
Note: Both affected functions look very similar. A refactoring may
be beneficial.
CID: 483, 485
Found with: Coverity Prevent(tm)
Approved by: re (scottl)
A pointer was checked for NULL after dereferencing it. The check is
not needed here, except there's a bug which results in detaching the
device twice.
Move the NULL pointer check to the beginning of the function and
convert it into a KASSERT.
CID: 483
Found with: Coverity Prevent(tm)
Approved by: re (scottl)
Don't set primary resume interrupt flag during channel initialization
since it can cause high interrupt rate (storm) and slowdown the entire
system.
Note: Please report back to me if this commit cause any abnormal
behaviour, especially during suspend / resume.
Reported/Submitted by: [1] Daan Vreeken [PA4DAN] <Danovitsch_at_vitsch dot net>
Reported/Confirmed by: [2] Angka H. K. <harikurniawan at gmail dot com>
MFC (revision 1.64)
Add device ID for nForce 410 MCP audio controller.
PR: kern/95257
Submitted by: cenix <cenixxx at gmail dot com>
Approved by: re (scottl)
Misc. fixups:
- [1] Make the driver friendly towards kernel without PREEMPTION.
Use msleep(9) instead of simple unlock-check_variable-lock
mechanisme since the later not really effective in non-preemptible
kernel (especially during codec detection routine).
- Free most driver resources in a sane manner to avoid possible
double free and panics especially during device detach and codec
detection failure.
Approved by: re (scottl)
[1] http://lists.freebsd.org/pipermail/freebsd-questions/2006-March/116515.html
Recover (?) support for AD1815 based ISA soundcards.
PR: kern/94388
Submitted by: Krzysztof Kotlenga <piernik at gmail dot com>
Approved by: re (scottl)
Add kbdmux(4) to GENERIC on i386 and amd64.
Remove the USB keyboard hack now that KBDMUX is enabled by default.
Allow it to be disabled if Safe Mode is selected.
Requested by: scottl
Approved by: re (scottl)
The following bug was just identified in OpenBSD and it looks like the same
bug exists in the other BSDen NFS servers.
A Linux client (don't know which version, but you can look at
http://bugzilla.kernel.org/show_bug.cgi?id=6256)
does a Setattr of mtime to the server's time, where the file is mode 0664 and
the client user has group access (ie. caller is not the file owner).
The BSD servers fail the Setattr with EPERM, since the VA_UTIMES_NULL flag
isn't set before doing the VOP_SETATTR.
It seems to me that this should be allowed, since it is allowed for a local
utimes(2). If so, the fix is to set VA_UTIMES_NULL for the
"set-time-to-server-time" cases of setting atime and/or mtime.
MFC of revision 1.140 to RELENG_6.
Submitted by: [email protected]
Reviewed by: cel
Approved by: re (scottl), silby
request, the FreeBSD NFS client will quickly back off to a excessively
long wait (days, then weeks) before retrying the request.
Change the behavior of the FreeBSD NFS client to match the behavior of
the reference NFS client implementation (Solaris). This provides a fixed
delay of 10 seconds between each retry by default. A sysctl, called
nfs3_jukebox_delay, is now available to tune the delay. Unlike Solaris,
the sysctl value on FreeBSD is in seconds, rather than in HZ.
MFC revision 1.136 to RELENG_6
Sponsored by: Network Appliance, Incorporated
Reviewed by: rick
Approved by: re (kensmith), silby
rev. 1.3 src/sys/netipsec/xform.h, rev. 1.12 src/sys/netipsec/xform_ipip.c
Fix more stack corruptions on amd64.
Vararg functions have a different calling convention than regular
functions on amd64. Casting a varag function to a regular one to
match the function pointer declaration will hide the varargs from
the caller and we will end up with an incorrectly setup stack.
Entirely remove the varargs from these functions and change the
functions to match the declaration of the function pointers.
Remove the now unnecessary casts.
Also change static struct ipprotosw[] to two independent
protosw/ip6protosw definitions to remove an unnecessary cast.
PR: amd64/95008
Submitted and tested by: Mats Palmgren
Reviewed by: rwatson
Approved by: re (mux)
Remove manual assignment of m_pkthdr from one mbuf to another in
ipsec_copypkt(), as this is already handled by the call to
M_MOVE_PKTHDR(), which also knows how to correctly handle MAC m_tags.
This corrects a panic when running with MAC and KAME IPSEC.
PR: kern/94599
Submitted by: zhouyi zhou <zhouyi04 at ios dot cn>
Reviewed by: bz, gnn
Approved by: re (mux)
- We only lock the local per-CPU page in the local dTLB, so accessing the
foreign per-CPU pages in cpu_ipi_send() in order to get the module IDs
of the other CPUs can cause a page fault. If this happens when doing a
TLB shootdown while dealing with another page fault this causes a panic
due to the recursive page fault. As I don't spot other code that assumes
or requires that accessing foreign per-CPU pages must not page fault
solve this by adding a statically allocated (and therefore locked as
part of the kernel pages) array which establishes a FreeBSD CPU ID ->
module ID relation and use that in cpu_ipi_selected().
- Fix a potential race in cpu_ipi_send(); as we don't serialize the access
to cpu_ipi_selected() between MI and MD use (only MI-MI and MD-MD) we
might catch the NACK bit caused by sending another IPI. Solve this by
checking the NACK bit in the contents of the interrupt dispatch status
reg read while interrupts were still turned off instead of reading that
reg anew after interrupts were turned on again. This is also what the
CPU docs suggest to do.
- Add a workaround for the SpitFire erratum #54 bug (affecting interrupt
dispatch). While public info regarding what this CPU bug actually causes
is not available testing shows that with the workaround in place it's
less likely to get a "couldn't send ipi" panic, it doesn't solve these
panics entirely though.
Approved by: re (mux)
Add convenience macros for the bits in ASI_ESTATE_ERROR_EN_REG (used
for ECC handling) and the additional uses of the ASIs 0x77 and 0x7f
as well as their bits (used for a CPU bug workaround).
Approved by: re (mux)
- Move the check for too high HZ values from tick_init() to tick_start()
as we have to call tick_init() before cninit() in order to provide the
low-level console drivers with a working DELAY() which in turn means we
cannot use panic() in tick_init().
- s,to high, too high, in the panic string
Approved by: re (mux)
- LK_RETRY means nothing when passed to VOP_LOCK. Call vn_lock instead.
- Move the vn_lock of the dvp until after we've unbusied the filesystem
to avoid a LOR with the mount point lock.
- In the v_mountedhere while loop we acquire a new instance of giant each
time through without releasing the first. This would cause us to leak
Giant.
Sponsored by: Isilon Systems, Inc.
Approved by: re (scottl)
Fix a bug in the NFS/TCP retransmission path.
The bug was that earlier, if a request was retransmitted,
we would do subsequent retransmits every 10 msecs.
This can cause data corruption under moderate loads by reordering
operations as seen by the client NFS attribute cache, and on the
server side when the retransmission occurs after the original request
has left the duplicate cache, since the operation will be committed
for a second time.
Further work on retransmission handling is needed (e.g. they are still
being done sent too often since they are scaled by HZ, and the size of
the dup cache is too small and easily overwhelmed on busy servers).
Submitted by: mohans
Approved by: re (mux)
Allow root to open jail PTYs from the host environment. This un-breaks using
utilities like watch(8) (or other programs which use snp(4)) to monitor
behavior within prisons from the host environment. This regression was
introduced when we changed the ioctl(SNPSTTY) to use a file descriptor
instead of a dev_t
Approved by: re (hrs)
The client's READDIRPLUS logic skips the attributes and
filehandle of the ".." entry. If the server doesn't send
attributes but does send a filehandle for "..", the
client's logic doesn't account for the extra "value
Fix a bug in NFSv3 READDIRPLUS reply processing
The client's READDIRPLUS logic skips the attributes and
filehandle of the ".." entry. If the server doesn't send
attributes but does send a filehandle for "..", the
client's logic doesn't account for the extra "value
follows" field that indicates whether the filehandle is
present, causing the remaining entries in the reply
to be ignored.
This is an MFC of 1.264 in the CURRENT branch.
Sponsored by: Network Appliance, Inc.
Reviewed by: rick, mohans
Approved by: re, silby
When the kernel is compiled with options IPXIP, run the network stack
with Giant, as there is current unsafety in the IPX tunneled over IP
code. There have been no reports of trouble, but there probably would
be if anyone were running this code at high speed on SMP systems.
Include kernel.h to get NET_NEEDS_GIANT() definition, which for some
reason compiled fine here. I may be running with other include file
changes locally.
Approved by: re (kensmith)
- When res_send() fails, we should reserve an error code.
- When res_nquerydomain() returns SERVFAIL, we should try next domain.
src/lib/libc/net/getaddrinfo.c: 1.75, 1.76
src/lib/libc/resolv/res_query.c: 1.3
Approved by: re (hrs)
The rpc.pcnfsd server was in the base for a little over seven
minutes back in 1994. Change the example entry to point at the
port, as per the entries for uucpd et al.
Approved by: re (kensmith)
Loopback pf_norm.c rev. 1.106 from OpenBSD:
fixup IP checksum when modifying IP header fields
PR: kern/93849
Obtained from: OpenBSD
Approved by: re (kensmith)
> Free the newtag if we exit with a failure from alloc_bounce_zone().
>
> Found by: Coverity Prevent(tm)
>
> Revision Changes Path
> 1.73 +3 -1 src/sys/amd64/amd64/busdma_machdep.c
> 1.76 +6 -1 src/sys/i386/i386/busdma_machdep.c
Approved by: re (mux)
>
> Don peril sensitive sunglasses and jack up the MAX_BPAGES limit to 8192
> on amd64. If you're going to stuff >4GB into your box, reserving 32MB for
> bonce pages amounts to a rounding error in the overall scheme of things.
>
> Revision Changes Path
> 1.72 +1 -1 src/sys/amd64/amd64/busdma_machdep.c
Approved by: re (mux)
events and turn off NIC interrupts while in the interrupt handler.
This fixes the device timeouts seen with the VMware LANCE.
- Relax the watchdog timer somewhat; don't enable it until the last
packet is enqueued and if there is a TX interrupt but there are
still outstanding ones reload the timer.
Approved by: re (hrs)
at reports that have the specified kind, instead of assuming that
there is only one report of the right kind in the report descriptor.
Approved by: re (kensmith)
it on the very beginning of the second sector. This makes it compatible
with labels created by disklabel(8) on non-512-byte-per-sector
devices.
Approved by: re
Fix version number when the feature was added.
Submitted by: Yoshihiko Sarumaru (mistral at imasy dot or dot jp)
PR: docs/93801 and docs/93803
Approved by: re (kensmith)
in a cluster instead of just the first buffer.
Delay buf_start() calls until snapshots have a copy of old content.
Allow compilation when not using softupdates.
Remove unused leaked debug function prototype.
PR: kern/93942
Approved by: re (kensmith)
Correctly identify the user running opiepasswd(1) when the login name
differs from the account name. [2]
Modify timeout handling logic in sendmail(8) to correct a reported
signal handling race condition. [3]
Approved by: re (scottl)
Security: FreeBSD-SA-06:11.ipsec [1]
Security: FreeBSD-SA-06:12.opie [2]
Security: FreeBSD-SA-06:13.sendmail [3]
Revert to setting vlan and vlandev parametes synchronously, as soon
as both have been read from the command line. Still use the callback,
but this time only to verify that both vlan and vlandev have been
found on the command line.
This should allow for control over the relative order of processing
parameters, which is needed to satisfy some caveats of the if_vlan
driver. E.g., MTU cannot be changed on a vlan interface until it's
attached to its parent.
Approved by: re (scottl)
- When a process is de-configuring a log file, also stop all of its
PMCs that require a log file to operate. This change should fix
PR 90269. [1]
- When deconfiguring a log, only stop PMCs that are in the RUNNING
state. [2]
Approved by: re (scottl) [1], (hrs) [2]
PR: kern/90269
Correctly locate the character proceeding the matched string in -w
mode when in non-UTF-8 multibyte locales (e.g. EUC, GB2312, etc.).
PR: gnu/91909
Silence from: tjr
Approved by: re (kensmith)
Reorganize /etc/rc.d/syscons and move all keyboard related settings
into one function syscons_configure_keyboard(). Call new function from
both syscons_start() and sysconst_setkeyboard(). The reason for this
is because syscons_start() will (re)configure both keyboard and screen
settings. Apparently, some graphics cards have problems with running
vidcontrol(1) while X11 is running.
Remove "/etc/rc.d/syscons restart" from /etc/devd.conf. It is no longer
required. Using "/etc/rc.d/syscons setkeyboard" is enough. This also
should fix annoying "syscons not running?" message.
Tested by: Ulrich Spoerlein < q at galgenberg dot net >
Approved by: re (hrs)
Synchronize graid3(8) with HEAD:
- Speed up synchronization process by using configurable number of parallel
I/O requests.
- Reimplement graid3 softc synchronization by using per-device sx(9) lock.
- Stop synchronization from pre-sync hook.
- Fix possible race between synchronization and regular requests.
Approved by: re (mux)
Synchronize gmirror(8) with HEAD:
- Speed up synchronization process by using configurable number of parallel
I/O requests.
- Allow for kernel dumps to the mirror.
- Reimplement gmirror softc synchronization by using per-device sx(9) lock.
- Stop synchronization from pre-sync hook.
- Fix possible race between synchronization and regular requests.
Approved by: re (mux)
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.
Reported by: kris
PR: 94278
Approved by: re (scottl)
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.
Reported by: Martin <nakal at nurfuerspam dot de>
PR: 94278
Approved by: re (scottl)
denoting cycles where the CPU is not in a halt or sleep state. [1]
Increment the manual page date, bring the copyright year upto-date.
Approved by: re (mux) [1]
- If a keymap file is not found for the selected country then default to the
more common USA ISO rather than index 0 (Belgian).
- Use jp.pc98 as default keymap for pc98
Approved by: re (murray)
- Introduce ifmedia_baudrate(), which returns correct baudrate of the
given media status. [1]
- Utilize ifmedia_baudrate() in miibus_statchg() to update ifp->if_baudrate.
Obtained from: NetBSD [1]
Approved by: re (scottl)
> date: 2006/03/17 02:05:46; author: kensmith; state: Exp; lines: +0 -5
> First pass at trimming package set down. Disc2 is still too big
> even with this but we're still deciding exactly what to do about
> that.
Approved by: re (scottl)
calls that simply return ENOSYS. This will allow basic forward
compatibility with userland audit pieces to be committed in the future,
avoiding the "login killed by SIGSYS" problem users of CVS HEAD
experienced when booting older kernels with newer user spaces (an
unsupported but not uncommon situation when debugging problems).
Approved by: re (scottl)
Obtained from: TrustedBSD Project
Only catch SIGINFO (for dumping thread states) when LIBPTHREAD_DEBUG
is defined in the environment.
Modify the code path of the ifdef NOTYET part of _kse_single_thread():
o Don't reinitialise the atfork() handler list in the child. We
are meant to call the child handler, and on subsequent fork()s
should call all three functions as normal.
o Don't reinitialise the thread specific keyed data in the
child after a fork. Applications may require this for context.
o Reinitialise curthread->tlflags after removing ourselves from
(and reinitialising) the various internal thread lists.
o Reinitialise __malloc_lock in the child after fork() (to balance
our explicitly taking the lock prior to the fork()).
With these changes, it is possible to enable the NOTYET code in
thr_kern.c to allow the use of non-async-safe functions after
fork()ing from a threaded program.
Eliminate a race condition in timed waits (cv, mutex, and sleeps).
Don't forget to initialize a tailq before using it.
For the ``#ifdef NOTYET'' code that allows calling non-async-safe
functions in the child after a fork() from a threaded process,
use __sys_setprocmask() rather than setprocmask() to keep our
signal handling sane. Without this fix, signals are essentially
ignored in said child and things such as protection violations
result in an endless busy loop.
Allocate a thread's tcb last so it is easier to handle failures to
malloc() siginfo.
Include needed headers that were obtained through <pthread.h>. Sort headers
while here.
amd64
-----
Fix a race condition introduced when redzones were added. Use an
atomic operation to return and adjust the stack (amd64).
test
-----
o Include <string.h>
o Make this ILP32/LP64 clean: cast pointers to long.
Approved by: re (scottl)
File Revisions
kern/imgact_aout.c 1.100
kern/imgact_elf.c 1.167-1.172, 1.175
kern/imgact_gzip.c 1.55
vm/vm_extern.h 1.77
vm/vm_glue.c 1.214
Use sf_buf_alloc() instead of vm_map_find() on exec_map to create
the ephemeral mappings that are used as the source for three copy
operations from kernel space to user space. There are two reasons
for making this change: (1) Under heavy load exec_map can fill up
causing vm_map_find() to fail. When it fails, the nascent process
is aborted (SIGABRT). Whereas, this reimplementation using
sf_buf_alloc() sleeps. (2) Although it is possible to sleep on
vm_map_find()'s failure until address space becomes available (see
kmem_alloc_wait()), using sf_buf_alloc() is faster. Furthermore,
the reimplementation uses a CPU private mapping, avoiding a TLB
shootdown on multiprocessors.
The second argument to vm_map_find() should be NULL instead of 0.
Correct a long-standing problem in elfN_map_insert(): In order to
copy a page to user space, the user space mapping must allow write
access.
Eliminate an unneeded (vm_prot_t) parameter from two functions.
Eliminate unnecessary uses of a local variable.
Maintain the vnode lock throughout elfN_load_file() rather than
releasing it and reacquiring it in vrele(). Consequently, there is
no reason to increase the reference count on the vm object caching
the file's pages.
Eliminate unused parameters to elfN_load_file().
Maintain the lock on the vnode for most of exec_elfN_imgact().
Specifically, it is required for the I/O that may be performed by
elfN_load_section().
Avoid an obscure deadlock in the a.out, elf, and gzip image
activators. Add a comment describing why the deadlock does not
occur in the common case and how it might occur in less usual
circumstances.
Eliminate an unused variable from exec_aout_imgact().
Avoid a vm object reference leak in a rarely used code path.
An executable contains at most one PT_INTERP program header.
Therefore, the loop that searches for it can terminate after it is
found rather than iterating over the entire set of program headers.
Eliminate an unneeded initialization.
Approved by: re (mux)
eliminates some performance degradation seen in some workloads when
the change was made from logical APIC addresses to physical APIC addresses.
Approved by: re (scottl)
Add inverted amplifier sense quirks for:
[1] Sony VAIO Type T
[2] Kvazar-Micro Senator 3592XT.
PR: [1] kern/94056
Submitted by: [1] Yoshihiko Sarumaru <mistral at imasy.or.jp>
[2] Alexandr Krivulya <admin at marcom-group.com>
Approved by: re (scottl)
[2] http://lists.freebsd.org/pipermail/freebsd-multimedia/2006-March/003773.html
Further refine the bridge hack in the arp code. Only do the special arp
handling for interfaces which are actually in the bridge group, ignore all
others.
Approved by: re (hrs)
Two years ago, in rev. 1.12, a typo slipped in etc/isdn/Makefile:
a control variable was misspelled as `SCRIPTS_NAME_isdntel.sh'
(should've been `SCRIPTSNAME_isdntel.sh') when the Makefile was
converted to using <bsd.prog.mk>. Consequently, `isdntel.sh' has
been installed as `isdntel' since then. Nevertheless, nobody has
been unhappy with the change. So it's time to make it official.
Approved by: re (mux)
associated changes. More details below:
Remove public declarations of variables that were forgotten when they were
made static.
Revision Changes Path
1.31 +0 -1 src/sys/sys/interrupt.h
Make sure the interrupt is masked before processing it, or bad things
can happen.
Revision Changes Path
1.10 +3 -3 src/sys/arm/arm/intr.c
Reorganize the interrupt handling code a bit to make a few things cleaner
and increase flexibility to allow various different approaches to be tried
in the future.
- Split struct ithd up into two pieces. struct intr_event holds the list
of interrupt handlers associated with interrupt sources.
struct intr_thread contains the data relative to an interrupt thread.
Currently we still provide a 1:1 relationship of events to threads
with the exception that events only have an associated thread if there
is at least one threaded interrupt handler attached to the event. This
means that on x86 we no longer have 4 bazillion interrupt threads with
no handlers. It also means that interrupt events with only INTR_FAST
handlers no longer have an associated thread either.
- Renamed struct intrhand to struct intr_handler to follow the struct
intr_foo naming convention. This did require renaming the powerpc
MD struct intr_handler to struct ppc_intr_handler.
- INTR_FAST no longer implies INTR_EXCL on all architectures except for
powerpc. This means that multiple INTR_FAST handlers can attach to the
same interrupt and that INTR_FAST and non-INTR_FAST handlers can attach
to the same interrupt. Sharing INTR_FAST handlers may not always be
desirable, but having sio(4) and uhci(4) fight over an IRQ isn't fun
either. Drivers can always still use INTR_EXCL to ask for an interrupt
exclusively. The way this sharing works is that when an interrupt
comes in, all the INTR_FAST handlers are executed first, and if any
threaded handlers exist, the interrupt thread is scheduled afterwards.
This type of layout also makes it possible to investigate using interrupt
filters ala OS X where the filter determines whether or not its companion
threaded handler should run.
- Aside from the INTR_FAST changes above, the impact on MD interrupt code
is mostly just 's/ithread/intr_event/'.
- A new MI ddb command 'show intrs' walks the list of interrupt events
dumping their state. It also has a '/v' verbose switch which dumps
info about all of the handlers attached to each event.
- We currently don't destroy an interrupt thread when the last threaded
handler is removed because it would suck for things like ppbus(8)'s
braindead behavior. The code is present, though, it is just under
#if 0 for now.
- Move the code to actually execute the threaded handlers for an interrrupt
event into a separate function so that ithread_loop() becomes more
readable. Previously this code was all in the middle of ithread_loop()
and indented halfway across the screen.
- Made struct intr_thread private to kern_intr.c and replaced td_ithd
with a thread private flag TDP_ITHREAD.
- In statclock, check curthread against idlethread directly rather than
curthread's proc against idlethread's proc. (Not really related to intr
changes)
Tested on: alpha, amd64, i386, sparc64
Tested on: arm, ia64 (older version of patch by cognet and marcel)
Revision Changes Path
1.88 +43 -29 src/sys/alpha/alpha/interrupt.c
1.38 +5 -5 src/sys/alpha/isa/isa.c
1.16 +58 -52 src/sys/amd64/amd64/intr_machdep.c
1.6 +1 -1 src/sys/amd64/include/intr_machdep.h
1.16 +2 -2 src/sys/amd64/isa/atpic.c
1.11 +28 -22 src/sys/arm/arm/intr.c
1.462 +2 -2 src/sys/dev/sio/sio.c
1.6 +1 -1 src/sys/dev/uart/uart_kbd_sun.c
1.24 +2 -2 src/sys/dev/uart/uart_tty.c
1.15 +58 -52 src/sys/i386/i386/intr_machdep.c
1.8 +1 -1 src/sys/i386/include/intr_machdep.h
1.21 +2 -2 src/sys/i386/isa/atpic.c
1.52 +32 -25 src/sys/ia64/ia64/interrupt.c
1.180 +3 -2 src/sys/kern/kern_clock.c
1.127 +437 -270 src/sys/kern/kern_intr.c
1.206 +0 -1 src/sys/kern/subr_witness.c
1.6 +3 -3 src/sys/powerpc/include/intr_machdep.h
1.7 +35 -32 src/sys/powerpc/powerpc/intr_machdep.c
1.14 +1 -1 src/sys/sparc64/include/intr_machdep.h
1.24 +43 -36 src/sys/sparc64/sparc64/intr_machdep.c
1.32 +36 -36 src/sys/sys/interrupt.h
1.440 +1 -3 src/sys/sys/proc.h
Catch up with interrupt-thread changes.
Revision Changes Path
1.32 +1 -1 src/sys/dev/zs/zs.c
Catch up with new interrupt handling code.
Revision Changes Path
1.16 +3 -3 src/sys/netgraph/bluetooth/drivers/bt3c/ng_bt3c_pccard.c
Catch up with new interrupt handling code.
Revision Changes Path
1.162 +2 -2 src/sys/dev/cy/cy.c
1.101 +2 -2 src/sys/dev/rc/rc.c
Catch up with new interrupt handling code.
Revision Changes Path
1.50 +2 -2 src/sys/dev/cx/if_cx.c
1.41 +1 -1 src/sys/dev/sab/sab.c
1.238 +2 -2 src/sys/pc98/cbus/sio.c
Add a swi_remove() function to teardown software interrupt handlers. For
now it just calls intr_event_remove_handler(), but at some point it might
also be responsible for tearing down interrupt events created via swi_add.
Revision Changes Path
1.128 +17 -0 src/sys/kern/kern_intr.c
1.33 +1 -0 src/sys/sys/interrupt.h
- Use swi_remove() to teardown swi handlers rather than
intr_event_remove_handler().
- Remove tty: prefix from a couple of swi handler names.
Revision Changes Path
1.51 +1 -1 src/sys/dev/cx/if_cx.c
1.102 +2 -2 src/sys/dev/rc/rc.c
1.42 +1 -1 src/sys/dev/sab/sab.c
1.25 +1 -1 src/sys/dev/uart/uart_tty.c
1.33 +1 -1 src/sys/dev/zs/zs.c
1.17 +2 -2 src/sys/netgraph/bluetooth/drivers/bt3c/ng_bt3c_pccard.c
Remove a stray return statement in the interrupt dispatch function
that caused a premature exit after calling a fast interrupt handler
and bypassing a much needed critical_exit() and the scheduling of
the interrupt thread for non-fast handlers. In short: unbreak :-)
Revision Changes Path
1.53 +0 -1 src/sys/ia64/ia64/interrupt.c
If we get a stray interrupt, return after logging it. In the extremely
rare case of a stray interrupt to an unregistered source (such as a stray
interrupt from the 8259As when using APIC), this could result in a page
fault when it tried to walk the list of interrupt handlers to execute
INTR_FAST handlers. This bug was introduced with the intr_event changes,
so it's not present in 5.x or 6.x.
Submitted by: Mark Tinguely tinguely at casselton dot net
Revision Changes Path
1.17 +1 -0 src/sys/amd64/amd64/intr_machdep.c
1.16 +1 -0 src/sys/i386/i386/intr_machdep.c
Approved by: re (scottl)
Only use the channel in the request given to ata_completed if its
still present.
Only look for ICRC and CORR errors on ATA devices not ATAPI.
Get rid of all the "long long"/"maxint" casting around in printf's.
On all our platforms intmax == int64_t so simply using %j to print
int64_t's is safe all over, and doesn't pullute the code.
Update atapi-fd to support direct devices such as disks.
ATAUSB will need to hook into the delayed boot identify to have
interrupts running, so externalize it.
Add USB modes.
Approved by: re@ (mux)
Some years ago handling login.access(5) was moved from login(1) to
pam_login_access(8) completely and unconditionally. This patch is
to finalize the move by deleting unused files and defines, and by
updating the manpages. In addition, login.access.5 will be installed
from the pam_login_access src directory, to where it belongs and
where it has lived for quite a while, too.
Besides satisfying general purism, this patch should stop ongoing
attempts to fix the dead code.
Approved by: re (mux)
Move the functionality controlled by "options TDFX_LINUX"
from 3dfx.ko to a separate module, 3dfx_linux.ko.
The option is retained in RELENG_6 for POLA reasons
while it has been turned into "device tdfx_linux" in HEAD.
Approved by: re (scottl)
1.21 src/lib/libipsec/ipsec_set_policy.3
1.14 src/lib/libipsec/ipsec_strerror.3
1.17,1.18 src/share/man/man4/ipsec.4
Clean up some descriptions and remove ambiguities in the language.
Add explanations to the examples.
Approved by: re (scottl)
Fix for an inappropriate bzero of the ICMPv6 stats. The code was zero'ing the wrong structure member but setting the correct one.
Submitted by: James dot Juran at baesystems dot com
Approved by: re (scottl)
- Reduce needless DNS query by lookup only appropriate address
family.
- Specify appropriate hints to getaddrinfo(3).
- Obtain address family from peername in inetd mode.
Approved by: re (mux)
vn_start_write() must be called without any vnode locks held.
Remove calls to vn_start_write() and vn_finished_write() in
vnode_pager_putpages() and add these calls before the vnode lock
is obtained to most of the callers that don't already have them.
Approved by: re (mux)
to the system when brelse() was called with B_RELBUF set on the buffer.
This could be a problem when the system was low on memory, had many
buffers on QUEUE_EMPTYKVA and started to traverse directories. For
each getnewbuf(), pages were allocated from the system, driving the
free reserve downwards. For each brelse(), the system put the buffer
on QUEUE_CLEAN, with B_INVAL set.
This commit changes the semantics of B_RELBUF to also free pages from
non-VMIO buffers.
Approved by: re (mux)
Add periodic scripts that check the status of gmirror(8), graid3(8), gstripe(8)
and gconcat(8) devices, respectively. Also sort.
Approved by: re (mux), rwatson (mentor)
Add /var/audit, mode 750, which will hold audit trail files.
Change group for /var/audit to audit, so that audit review can be
delegated to non-administrators.
Obtained from: TrustedBSD Project
Approved by: re (mux)
We need to check if file system size is equal to provider's size, because
sysinstall(8) still bogusly puts the first partition at offset 0 instead of 16,
so glabel/ufs will find file system on a slice instead of partition.
Before sysinstall is fixed, we must keep this code, which means that we
wont't be able to detect UFS file systems created with 'newfs -s ...'.
PS. bsdlabel(8) creates partitions properly.
Approved by: re (hrs)
exit1() to block until any current PHOLD's are released. This includes
Simplifying the cleanup code in kern_ptrace() and removing the now
unnecessary vmspace ref counting magic from proc_rwmem(). Also, the
locking for ptrace_single_step(), ptrace_set_pc(), and
ptrace_clear_single_step() have been fixed to be consistent across the
tree.
Approved by: re (scottl)
syscons and pop it up during installs. In addition, use the specified
country as a hint for the keymap to use and if the non-default country is
chosen during the install startup, pop up the keymap menu before entering
the main sysinstall menu.
Approved by: re (scottl)
Add new 'setkeyboard' method to the /etc/rc.d/syscons. It accepts the
keyboard device name (i.e. /dev/kbd0). This method will do nothing is
kbdmux(4) is the current active keyboard, otherwise it will switch
active keyboard as requested.
Modify ukbd(4) entries in the /etc/devd.conf to use /etc/rc.d/syscons
and new 'setkeyboard' method.
Approved by: re (scottl)
Assign gid 77 to audit instead of gid 73. The ports group list did not
include '73', which was assigned in a ports passwd entry to ircservices.
Pointed out by: ceri
Allocate an 'audit' group, membership in which will grant the audit
review right by virtue of read file permission on /var/audit and its
contents.
Obtained from: TrustedBSD Project
Approved by: re (scottl)
Make pflog a seperate module. As a result pflog_packet() becomes a
function pointer that is declared in pf_ioctl.c
Requested by: yar (as part of the module build reorg)
Approved by: re (scottl)
Don't truncate f_mntfromname & f_mntonname to 16 characters when
translating statfs into ostatfs. Also use strlcpy instead of bcopy
to make sure the copied strings are properly terminated.
Approved by: re (scottl)
Fix bug in malloc_uninit():
Releasing items from the mt_zone can not be done by a simple
uma_zfree() call since mt_zone is allocated with the UMA_ZONE_MALLOC
flag. Use uma_zfree_arg instead and supply the slab.
This bug caused panics in low memory situations on unloading kernel
modules containing MALLOC_DEFINE(..) statements.
Approved by: re (scottl)
crypto.ko depends on zlib.
Submitted by: Ben Kelly <bkelly at vadev.org>
Approved by: rwatson
Point hat to: me
MFC after: 1 day
Approved by: re (scottl)
- Just query 'as is', if there is a trailing dot in the name.
- Don't query 'as is' twice.
lib/libc/net/getaddrinfo.c: 1.71
lib/libc/net/res_query.c: 1.31
Approved by: re (scottl)
- Synchronize status block on every call of bge_poll_locked() (rev. 1.121)
- Return immediately out of bge_rxeof()/bge_txeof() if there are no packets
to process. This could save some pci register accesses. (rev. 1.122)
- Enable 'complete' (including tcp/udp pseudo header) hardware rx checksum
offloading. (rev. 1.123)
- Ignore link events for MII/GMII cards if MI auto-polling disabled.(rev. 1.124)
- Clear bge_link flag in bge_stop() (rev. 1.124)
- Force link state check after bge_ifmedia_upd(). Otherwise we can miss link
event if PHY changes it's state fast enough.(rev. 1.124)
- Fix some comments.
Approved by: re (scottl)
Properly initialize args structure before passing it to ipfw_chk(): having
uninitialized args.inp is unhealthy for uid/gid/jail ipfw rules.
PR: kern/92589
Approved by: re (scottl)
Fix five years old bug in ip_reass(): if we are using 'full' (i.e. including
pseudo header) hardware rx checksum offloading ip_reass() fails to calculate
TCP/UDP checksum for reassembled packet correctly.
Reviewed by: sam (earlier version), bde
Approved by: re (scottl)
Integrate kbdmux(4) into syscons(4) and kbd code.
By default syscons(4) will look for the kbdmux(4) keyboard first, and then,
if not found, look for any keyboard.
Current kbd code is modified so if kbdmux(4) is the current keyboard, all
new keyboards are automatically added to the kbdmux(4).
Switch to kbdmux(4) can be done at boot time, by loading kbdmux module at
the loader prompt, or at runtime, by kldload'ing the kbdmux module and
releasing current active keyboard.
If, for whatever reason, kbdmux(4) is not required/desired then just do
not load it and everything should work as before. It is also possible to
kldunload kbdmux at runtime and syscons(4) will automatically switch to
the first available keyboard.
Approved by: re (scottl)
Provide ability to disable kbdmux(4) with the hint.kbdmux.0.disabled="1" hint.
Document hint in the kbdmux(4) man page.
Fix endian bugs accessing ioctl arguments that are passed by value.
Approved by: re (scottl)
CODA_COMPAT_5 may not be defined unconditionally in the coda5 module.
Otherwise a kernel build would break in the coda5 module if the main
kernel conf file enabled CODA_COMPAT_5, too. Redefined symbols are
strictly disallowed by -Werror.
To overcome this issue, introduce a different symbol indicating coda5
build, CODA5_MODULE, and translate it to CODA_COMPAT_5 appropriately
in /sys/coda/coda.h.
Approved by: re (scottl)
Move the hard-coded ETHER_* options to where they belong --
inside !if defined(KERNBUILDDIR).
Utilize the fact the module will support all frames by default --
it needs no ETHER_* options unless some frames need to be disabled.
Fix the comment respectively.
Don't forget to create fake opt_ef.h if no ETHER_* are set.
Approved by: re (scottl)
- Fix severe crackling after long running and abusive module load / unload
by forcing DMA alignment to default buffer size.
- Make sure DMA pointer properly aligned to avoid being truncated by caller
which causing severe underruns and random popping (especially in 32bit
playback / recording).
- Add AC97 inverted external amplifier quirk for Maxselect x710s
- http://maxselect.ru/
- Trim unnecessary pointer alignment.
Approved by: re (scottl)
Connect zlib to the build.
This patch fixes a problem, which exists if you have IPSEC in your kernel
and want to have crypto support loaded as KLD. By moving zlib to separate
module and adding MODULE_DEPEND directives, it is possible to use such
configuration without complication. Otherwise, since IPSEC is linked with
zlib (just like crypto.ko) you'll get following error:
interface zlib.1 already present in the KLD 'kernel'!
Approved by: cognet (mentor)
Approved by: re (scottl)
threshold.
The sysctl net.inet.tcp.inflight.rttthresh specifies the threshold
in milliseconds below which inflight will disengage. It defaults
to 10ms.
Sponsored by: TCP/IP Optimization Fundraise 2005
Approved by: re (scottl)
functional changes. It was done by accident. Proper comment to the previous
commit should be:
MFC:
Extend kldunload(8) functionality and fix minor problems:
o multiple modules can be unloaded at once (specified either by id or be
module name)
o exit with EX_USAGE after usage() is called.
o remove unused variables, since we keep command line flags as bitmask,
in 'opt'.
o 'kldload -n ...' does nothing. Add comment to this options.
Additionally:
o Update manual page to conform new functionality.
o Increace WARNS to 6. Because we can.
o Bump a date in .Dd field. Spotted by brueffer@.
Approved by: cognet (mentor)
Approved by: re (scottl)
Note: The jumbo mbuf cluster API has been MFC'd only recently and
never shipped in a release. Thus the API change does not violate
our stable branch guidelines with regard to API compatibility.
Requested by: glebius, gallatin
Sponsored by: TCP/IP Optimization Fundraise 2005
Approved by: re (scottl)
Keep the parent device (in this case the channel) around in ata_request,
so we dont panic device removal or failure.
Clean up ata_fail_requests to prevent the queue munging to fail.
Fix ata_reinit so it does things in the right order to prevent panic's.
Lock the channel so master/slave setups wont trash during reinit.
Work around the deadlock that occours when ATA waits for the taskqueue
to call back for completition and something else is holding the taskqueue
waiting for ATA to return data.
This should clear up the "semaphore timeout !! DANGER Will Robinson !!"
in most situations, and log "taskqueue timeout - completing request directly"
instead, with a delayed "WARNING - freeing taskqueue zombie request" when
the taskqueue finally calls us back with the now stale request.
(It would have been nice if there was a way to remove a scheduled item from
the taskqueue finally calls us back with the now stale request.
Approved by: re@ (scottl)
unknown ways. Until that breakage is sorted out, be conservative. I'm
not backing this out in current so I can track down the issues.
I'm also not backing out the pci parts of this commit because with the
old cardbus code they work perfectly as far as I've been able to test.
I'm leaving cardbus_device.c in place as well since I anticipate being
able to reconnect it when I resolve this issue in head and cvs rm +
cvs add on branches can be a pita...
Approved by: re@ (scottl)
Add boot.nfsroot.options loader tunable.
It allows to specify options for NFS root file system.
Currently supported options are: soft, intr, conn, lockd.
I'm adding this functionality mostly for 'lockd' option, which is only
honored when performing the initial mount and will be silently ignored
if used while updating the mount options.
This will allow to use flock(2) without the need of using varmfs or
rpc.lockd and friends.
Example of use:
boot.nfsroot.options="intr,lockd"
Approved by: re (scottl)
Use 'ipfw list' instead of 'ipfw l', since it's deprecated (and warning is
printed on system startup).
Approved by: cognet (mentor)
Approved by: re (scottl)
Developed with: Norbert Koch < NKoch at demig dot de >
No response from: freebsd-current@
Tested by: Norbert Koch < NKoch at demig dot de >
Approved by: re (scottl)
endpoint is closed and then reopened. This is reported to fix
timeouts with USB scanners and some other USB devices that were
seen since the recent removal of the clear-stall-on-open code.
Approved by: re (scottl)
- Fix a memory leak (Found by: Coverity).
- Plug a memory leak: free up per-cpu sample buffers at module unload
time.
- Correct a few style nits.
Approved by: re (scottl)
Disable custom locking in the vkbd(4) for now and make it rely on the
Giant mutex (just like the rest of keyboard drivers and syscons(4) do).
Approved by: re (scottl)
src/tools/tools/ministat/ministat.c:
1. rev. 1.6 -> 1.7
Add option -w to specify graph width.
Use COLUMNS, terminal width for default graph width.
2. rev 1.7 -> 1.8
Fix the way in which median is calculated. If the data source has even
number of data points, value should be calculated by adding two middle
elements and dividing them by 2.
[1] Reviewed by: rwatson
[2] Approved by: cognet (mentor)
Approved by: re (scottl)
- Back out 1.155. I mismerged my ancient local patch. Luckily it was
completely noop.
- Geometry sanitization for non-interactive mode is moved to correct place.
Approved by: re (scottl)
Fix hard lockup caused by kbdmux(4) when kbdmux(4), PS/2 keyboard
(atkbd(4)) and PS/2 mouse (psm(4)) are used together.
Turns out that atkbd(4) check_char() method may return "true" while
read_char() method returns NOKEY. When this happens kbdmux(4) was
simply stuck in the dead loop. Avoid dead loop in kbdmux(4) by breaking
out of the loop if read_char() method returns NOKEY.
It almost seems like a bug in atkkbd(4), atkbd_check_char() calls
kbdc_data_ready(), and, the later will return "true" if there are
pending data in either kbd or aux queue. However, because both aux
and kbd are on the same controller, I'm not sure if this is a bug
or feature.
While I'm here fix a couple of whitespaces.
Tested by: markus
Approved by: re (scottl)
revision 1.6
date: 2006/01/23 14:03:14; author: cognet; state: Exp; lines: +5 -3
Donc recompute the io port address if it's already the good one.
Approved by: re (mux)
- Use official version strings for LMP and HCI version reporting and add
version strings up to Bluetooth 2.0
- Update manufacturer list
Revisions:
hccontrol.h rev. 1.5
info.c rev. 1.4
link_control.c rev. 1.10
util.c rev. 1.6
Approved by: re (scottl), emax
operations before returning, and point the bus at a dummy cam_sim
structure. This avoids crashes in camisr() when umass devices are
unplugged during probing.
It may however be better to simply sleep in xpt_bus_deregister()
until all operations have completed, but it is still useful to have
this MFC'd in the meantime.
Approved by: re (scottl)
The tcsh 6.14 uses libiconv to convert catalogs to appropriate charset
dynamically. However, we don't have libiconv in our tree. So, I made
some hack to load libiconv dynamically. If libiconv is available, you
can use catalogs for more locales than the locales which catalog is
actually installed.
To use this feature, you need to symlink catalogs to appropriate
locales. You can do this by installing ports/shells/tcsh_nls.
bin/csh/Makefile: 1.38
bin/csh/config.h: 1.13
bin/csh/iconv.h: 1.1
bin/csh/iconv_stub.c: 1.1
contrib/tcsh/nls/C/charset: 1.1.1.1
contrib/tcsh/nls/et/charset 1.1.1.1
contrib/tcsh/nls/finnish/charset 1.1.1.1
contrib/tcsh/nls/french/charset 1.1.1.1
contrib/tcsh/nls/german/charset 1.1.1.1
contrib/tcsh/nls/greek/charset 1.1.1.1
contrib/tcsh/nls/italian/charset 1.1.1.1
contrib/tcsh/nls/ja/charset 1.1.1.1
contrib/tcsh/nls/pl/charset 1.1.1.1
contrib/tcsh/nls/russian/charset 1.1.1.1
contrib/tcsh/nls/spanish/charset 1.1.1.1
contrib/tcsh/nls/ukrainian/charset 1.1.1.1
Approved by: re (hrs)
firmware(9) is a subsystem to load binary data into the kernel via a
specially crafted module. There are several handrolled sollutions to this
problem in the tree already which will be replaced with this. They
include iwi(4), ipw(4), ispfw(4) and digi(4).
Approved by: re(scottl)
Work around the fact that nfsclient SRCS must include
nfs_diskless.c if NFS_ROOT is in effect, e.g., present
in the kernel config file. Otherwise the built module
won't load due to an undefined reference to nfs_setup_diskless.
Approved by: re (scottl)
vnode_create_vobject() while preserving the binary ABI
to filesystem modules in RELENG_6: introduce a new function
vnode_create_vobject_off() that takes the size argument
as off_t; move all stock file systems to it; re-implement
the old vnode_create_vobject() using vnode_create_vobject_off()
so that old or binary-only FS modules can work w/o hitting the
bug. The trick is to pass a size of 0 to vnode_create_vobject_off()
so that it will call VOP_GETATTR() and thus get the actual,
untruncated file size even if the calling module still uses
the old vnode_create_vobject().
PR: kern/92243
Approved by: re (scottl)
Add support for the JMicron JMB363 dual SATA + single PATA controller.
Add r/w support for JMicron ATA RAID metadata.
Add a reset of the AHCI machinery to the ICH6/ICH7 support.
Unbreak Promise SATAII/150 controllers caused by the DMA dump changes.
Unbreak DMA dump on Intel 31224.
Approved by: re@ (scottl)
But it returned 1.
It fixes the problem reported by many Japanese people that tcsh 6.14
doesn't work correctly with ja_JP.eucJP and ja_JP.SJIS locale.
share/mklocale/ja_JP.SJIS.src: 1.5
share/mklocale/ja_JP.eucJP.src: 1.4
Approved by: re (scottl)
Default number of direct access devices had been changed from three to two.
Reflect this in other paragraphs.
PR: 93201
Submitted by: Marian Cerny
Approved by: re (scottl)
- mdoc sweep.
- s/5.5/6.0/ in HISTORY section.
- Document the latest changes for controlling the fan
- s/Thinklight/ThinkLight/
- Xref led(4)
Approved by: re (scottl)
Rework icmp_error() and always quote the entire TCP header, fixes
issues in draft-gont-icmp-payload-00.txt.
New net.inet.icmp.reply_from_interface and net.inet.icmp.quotelen.
Sponsored by: TCP/IP Optimization Fundraise 2005
Approved by: re (scottl)
Fix two important typos in watchdog handling:
- Restart watchdog if we *did* processed any descriptors. [1]
- Log the watchdog event if the link is *up*. [2]
PR: kern/92948 [1]
Submitted by: Mihail Balikov <mihail.balikov interbgc.com> [1]
PR: kern/92895 [2]
Submitted by: Vladimir Ivanov <wawa yandex-team.ru> [2]
Approved by: re (kensmith)
- Increase maximum number of interfaces to 2048.
- Regroup softc so that frequently used elements are
grouped in the beginning, while the interfaces
array is at the end.
Approved by: re (kensmith)
opened. This should not be necessary, and it is known to confuse
certain devices.
Remove the UQ_NO_OPEN_CLEARSTALL quirk, as this is now the default
behaviour for all devices.
Approved by: re (scottl)
Enable getty(8) on ttyu2 by default in order to get machines that use a
RSC (Remote System Control) connected via uart2 as console working out
of the box.
Approved by: re (scottl)
sys/dev/uart/uart_cpu_sparc64.c 1.20, 1.22
- Add support for using LOM (Lights Out Management) and RSC (Remote System
Control) devices as console.
- Add my copyright to uart_cpu_sparc64.c.
- Recognize the SAB82532 in USIII machines. This is MFC'ed for consistency
as one part of the original commit, sys/dev/uart/uart_bus_ebus.c rev. 1.7,
was already MFC'ed to RELENG_6 (in rev. 1.6.2.2).
Approved by: re (scottl)
- Use a dedicated kthread to call acctwatch() periodically rather than
a callout from softclock().
- Validate new values for the kern.acct_chkfreq sysctl.
- Whitespace and include sorting.
Approved by: re (scottl)
Convert last four functions in coda_vnops.c to ANSI C function
declarations. I knew I would get to fix something in Coda
eventually.
Approved by: re (scottl)
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)
Approved by: re (scottl)
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)
Approved by: re (scottl)
Remove dead code: 'opts' is not used in udp_append(), only in udp_input(),
so no need to assign it to NULL or conditionally free it.
Found with: Coverity Prevent(tm)
Approved by: re (scottl)
When storing the results of malloc() in a pointer to a pointer, check
the pointer to a pointer for NULL, not the pointer for NULL.
Noticed by: Coverity Prevent analysis tool
Approved by: re (scottl)
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
Approved by: re (scottl)
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
Approved by: re (scottl)
Check the right ifnet pointer to see if if_alloc() failed or not in
ef_clone(); we were testing the original ifnet, not the one allocated.
When aborting ef_clone() due to if_alloc() failing, free the allocated
efnet structure rather than leaking it.
Noticed by: Coverity Prevent analysis tool
Approved by: re (scottl)
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
Approved by: re (scottl)
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.
PR: kern/72728
Submitted by: Luca Morettoni <morettoni at libero dot it>
Approved by: re (scottl)
Teach gbde(8) to use a key file in addition to a passphrase. This
makes it practical to use GBDE for "something you have plus something
you know" security together with a USB flash drive.
Approved by: re (scottl)
- Move the command setup from amr_start1 into the card specific submit
routines.
- Add or replace cpu_spinwait() with DELAY(1) to a few of the busy
loops when reading from the controller to work around firmware bugs
which can crash the controller.
Approved by: re
- Add loader(8) variables for RB_DFLTROOT, RB_MUTE, and RB_PAUSE:
"boot_dfltroot", "boot_mute", and "boot_pause" respectively.
- Cause all flags passed by boot2 to set the respective loader(8)
boot_* variable. The end effect is that all flags from boot2
are now passed to the kernel.
Approved by: re (scottl)
The uma_zone data structure defines the size of its uz_cpu[] array as 1,
but then sizes the containing data structure at run-time to make room
for per-cpu cache data. Modify libmemstat to separately allocate a
buffer to hold per-cpu cache data, sized based on the run-time mp_maxid
variable when using libkvm to access UMA data. This avoids reading
invalid cache data from beyond the end of the uma_zone data structure
on the stack, which can result in invalid statistics and/or reads from
invalid kernel addresses.
Approved by: re (scottl)
When reporting an error reading from UMA per-cpu cache pointers using KVM,
return a KVM error rather than an out of memory error, so that the caller
reports the KVM error state. This replaces a misleading error message
with a more accurate although equally confusing one.
Approved by: re (scottl)
Read all_cpus variable out of kmem, and validate CPUs against the all_cpus
cpu mask before looking at the cache entries for the CPU. For systems
with sparse CPU id arrays, this skips otherwise uninitialized cache
structures.
Approved by: re (scottl)
Correct a typo in the extraction of zone information from UMA using kmem:
bytes = allocated - freed, not bytes = allocated = freed.
Approved by: re (scottl)
When calling bioq_first() to see if a queue is empty in bioq_disksort(),
don't save the return value as we won't use it.
Noticed by: Coverity Prevent analysis tool
Approved by: re (scottl)
present in kdump.1:1.15:
Add a "-H" argument to kdump, which causes kdump to print an additional
field holding the threadid. This is more useful for libthr than
libpthread, but still quite useful in libpthread as it can be used to
process interlaced records from multiple threads over the course of a
system call.
Detect old ktr_buffer values using the heuristic "if it's negative,
then it must not be a valid threadid". This may leave something to be
desired.
Reviewed by: davidxu
Approved by: re (scottl)
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.
Approved by: re (scottl)
In nfs_dolock(), GC now under-used ioflg, rendered obsolete when we moved
from using a fifo to talk to rpc.lockd to using a special device node.
Approved by: re (scottl)
Reuse ktr_unused field in ktr_header structure as ktr_tid; populate
ktr_tid as part of gathering of ktr header data for new ktrace
records. The continued use of intptr_t is required for file layout
reasons, and cannot be changed to lwpid_t at this point.
Reviewed by: davidxu
Approved by: re (scottl)
Add a -A argument to mergemaster to allow explicitly specifying an
architecture to pass through to the underlying makefiles. This is
quite useful when building on an i386 box to populate an amd64 NFS
root.
Head nod: dougb
Approved by: re (scottl)
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.
Approved by: re (scottl)
sys/conf/files.sparc64 1.78, sys/modules/Makefile 1.471,
sys/modules/le/Makefile 1.1, sys/sparc64/conf/GENERIC 1.105
Hook up le(4) to the build.
Approved by: re (scottl)
sys/dev/le/am79900reg.h 1.1, sys/dev/le/am79900var.h 1.1,
sys/dev/le/am7990reg.h 1.1, sys/dev/le/am7990var.h 1.1,
sys/dev/le/if_le_ledma.c 1.1, sys/dev/le/if_le_pci.c 1.1,
sys/dev/le/lance.c 1.1, sys/dev/le/lancereg.h 1.1,
sys/dev/le/lancevar.h 1.1
Add le(4), a driver for AMD Am7900 LANCE and Am79C9xx PCnet NICs,
ported from NetBSD.
This version differs from HEAD in that if_le_ledma.c inlines
lsi64854_enet_intr() from rev. 1.8 of sys/sparc64/sbus/lsi64854.c
in le_dma_hwintr() in order to not break the API of the LSI64854
driver in RELENG_6.
Approved by: re (scottl)
- Don't shift the clock frequency in MHz left by 8 before assigning it
to sbus_mdvec.dv_clock as sbus_mdvec.dv_clock is meant to be specified
in MHz. While this was a bug it shouldn't have affected FreeBSD/sparc64
as sbus_mdvec.dv_clock is used to limit the clock rate of chips when
a machine isn't able to support them at maximum speed which isn't the
case for sun4u machines.
- Remove the code that checks whether the clock frequency returned by
sbus_get_clockfreq() is 0 and falls back to 25MHz if it is as that's
already done in sbus(4).
Approved by: re (scottl)
- Sync the list of supported chips with pcn_probe() as of sys/pci/if_pcn.c
rev. 1.77 (also applies to RELENG_6), i.e. remove Am53C974/Am79C970/
Am79C974 PCnet-PCI and Am79C970A PCnet-PCI II.
- Change the entry of the PCnet-Home in the list of supported chips to
match the other ones, i.e. s,PCnet/Home HomePNA,Am79C978 PCnet-Home,.
- s,familly,family
Approved by: re (scottl)
* network.c,v 1.53 (by ceri):
Fixes DHCP handling to use a more robust way to determine whether
DHCP should be used.
* tcpip.c,v 1.134:
Avoid adding unnecessary tailing space when no media option(s) is
specified.
Approved by: re (scottl)
Set IFF_BROADCAST and IFF_MULTICAST on vlan interfaces from the
beginning and simply refuse to attach to a parent without either
flag. Our network stack doesn't like those flags changing and
there is no need in them doing so.
Approved by: re (scottl)
to :: if we have another PCB which is bound to 0.0.0.0. If a PCB has
the INP_IPV6 flag, then we set its cost higher than IPv4 only PCBs.
Approved by: re (scottl)
Avoid creating (and subsequently using) fake opt_*.h files
when the modules are built with the kernel and hence actual
opt_*.h files are available in ${KERNBUILDDIR}. Fix a few
small bugs that would prevent this from working.
At last the build options of the modules become consistent
with those of the kernel unless the MODULES_WITH_WORLD way
still is used.
Approved by: re (kensmith, scottl)
Requested by: ru
Tested on: amd64 i386 sparc64
Tested by: md5
Do address assignment/removal operations after callbacks. Presently,
ifconfig callbacks are used for L2 configuration, media and vlan,
so actions associated with address assignment, like sending out a
gratuitous ARP, should go when L2 is running already.
Return ifvlan.c to the state of rev. 1.7.2.2 -- undo the last
back-out. The above change to ifconfig.c lets us use a callback
for vlan set-up without facing the evil side-effects from IP
assignment to an orphaned vlan interface.
Approved by: re (scottl)
Allow to use more than 7 buttons (31 in case you don't want to look
at the code) with USB mice.
Requested by: Seán C. Farley <[email protected]>
Approved by: re (kensmith)
Work around an mdoc bug.
Actually MFC the enhanced SYNOPSIS section, wasn't a real bug according
to ru.
Requested/reminded by: marius
Approved by: re (scottl)
it's not defined in <sys/cdefs.h>. This situation happens early when building
the bootstrap-tools, where the new <nl_types.h> is mixed with the old
<sys/cdefs.h>.
Submitted by: imp
Reviewed by: ru
- Hide 'incorrect geometry warning' in non-interactive mode. Users should
know what they are doing in non-interactive mode. Less scarier warning
goes to debugging info instead.
- Print sanitized geometry to debugging info.
For example, you can dynamically generate and load configuration file
depending on the hardware configuration with the following template:
mediaSetCDROM
mediaOpen
command=/dist/scripts/install.sh
system
mediaClose
configFile=generated.cfg
loadConfig
Now we have full access to files on the media before installation begins.
- Mention that users need to be in the wheel group to `su - root' by default, and how to change it.
PR: docs/70616
Submitted by: Jilles Tjoelker <jilles at stack dot nl>
Reviewed by: ru@
Approved by: ceri@
- Remove the comment about WSS/MSS cards being the best supported
cards on the market.
- Remove the entire HARDWARE section. It's superfluous since all
snd_* manual pages have their own HARDWARE sections these days.
- In pipe() return the error returned by pipe_create(), rather then
hardcoded ENFILES, which is incorrect. pipe_create() can fail due
to ENOMEM.
- Update manual page, describing ENOMEM return code.
Reviewed by: arch
Fix minor bug in uRPF: if net.link.ether.inet.useloopback=1 and we send
broadcast packet using our own source ip address it may be rejected by
uRPF rules.
PR: kern/76971
__PCI_REROUTE_INTERRUPT, so merging it was in error. I thought I'd
specifically checked before the commit, but it looks like I was wrong.
Thanks to Peter Pentchev (roam@) for his help in finding this...
sys/sparc64/fhc/fhc_central.c 1.10, sys/sparc64/fhc/fhc_nexus.c 1.9,
sys/sparc64/pci/psycho.c 1.59, sys/sparc64/sbus/dma_sbus.c 1.3 - 1.4,
sys/sparc64/sbus/sbus.c 1.37
- Register the generic implementations for the device shutdown, suspend
and resume methods so these events propagate through the device driver
hierarchy.
- Remove dma_setup_intr() (was commented out in RELENG_6).
- Only touch the LED bit of the (LED) AUXIO register when turning the
system LED on or off. Unlike the EBus LED AUXIO register where the
remaining bits are unused the upper bits of the SBus AUXIO register
are used to control other things like the link test enable pin of
the on-board NIC which we don't want to change as a side-effect.
- Remove the superfluous bzero()'ing of the softc obtained from
device_get_softc().
o Move resource allocation into pci layer, rather than duplicating
it in this layer (poorly at that).
o Provide preliminary support for dumping of CardBus card's CIS.
o Simplify I/O memory range allocations
o Use PCI layer symbols rather than cardbus layer symbols
o Improve cis tuple callbacks
1.308, 1.307, 1.306: expose pci_add_resources to the outside
world. Implement force in pci_add_map. Write values of allocated
resources to the BARs.
1.304: Improve diagnostic messages
1.303: Improved resource allocation.
1.302: Use symbolic names
1.301: Minor style(9) nitage
1.296: Allow code to access cached values for CMDREG, CACHLNSZ, MINGNT,
MAXLAT and LATTIMER.
Check for BGE_RXBDFLAG_IP_CSUM flag before marking mbuf as with valid
checksum. This fixes operation of PPPoE and other non-IP Ethernet
protocols.
MFC 1.117:
Use m_getcl() instead of getting mbuf, and then getting a cluster.
Replace "fetch" with "fetch -r" when downloading the initial ~38MB
snapshot in order to avoid unnecessary re-downloading.
Remove the earlier "rm -f ${SNAPSHOTHASH}.tgz" to make this work.
Add [-J jid_file] option to write out a JidFile, similar to a PidFile,
containing the jailid, path, hostname, ip and the command used to start
the jail.
src/usr.sbin/jail/jail.8: rev 1.71 -> 1.72
src/usr.sbin/jail/jail.c: rev 1.20 -> 1.21
PR: misc/89883
Submitted by: L. Jason Godsey <lannygodsey -at- yahoo.com>
Reviewed by: phk
Add "yet another" moused(8) hack: suspend handling mouse events when SIGUSR1
is caught. Can be assigned to a window manager shortcut to prevent accidents
with touchpads.
src/usr.sbin/moused/moused.8: rev 1.57 -> 1.58
src/usr.sbin/moused/moused.c: rev 1.74 -> 1.75
PR: bin/89357
Submitted by: Nick Hibma <nick -at- van-laarhoven.org>
Catch up with 64bit time_t on sparc64. The rstat packet expects a 32bit
time_t and times will look incorrect on machines with 64bit time_t.
src/usr.bin/rup/rup.c: rev 1.18 -> 1.19
PR: 88788
Submitted by: Keith White <Keith.White -at- site.uottawa.ca>
r1.27:
o Re-enable scatter/gather
o Change MEM_READ_1/MEM_READ_4 into macros (move them to if_iwireg.h)
o Add support for association LED
o Silently discard f/w notifications that are unknown (fixes spurious
"unknown notification 15" in logs with latest firmware)
o Fix scanning of 5GHz channels
r1.23:
Fix endianness issues. iwi now works on big endian architectures too.
r1.22
Be more robust when handling Rx interrupts. If we can't allocate and DMA map
a new mbuf, just discard the received frame and reuse the old mbuf.
This should fix kernel panics on high network traffic.
r1.20:
o Use firmware extended scan command; this one doesn't crash when scanning
the 5GHz band.
o Enable 802.11a channels scanning for 2915ABG adapters.
o Fix a typo (negociated->negotiated).
etc/defaults/rc.conf 1.271
etc/rc.d/Makefile 1.63
etc/rc.d/ftpd 1.1 (new)
share/man/man5/rc.conf.5 1.281, 1.282
Also MFC the addition of a missing xref to geli.8 in
SEE ALSO on rc.conf.5 as a part of rev. 1.282.
enable "aggressive mode" only when operating in ap or station mode; in
particular this fixes use of wme in adhoc demo mode, it wasn't possible
to set the txop limit because the aggressive mode logic would override
feeder.h:
feeder.c:
- Implement scoring mechanisme to select best format for conversion.
This is actually part of newer format chaining procedures which
will be commited someday. Confusion during chaining process solved
by this scoring since it will try to reduce list of from/to formats
to a single, best format.
Related PR: kern/91683
channel.c:
- Simplify feeder building process since we have smarter format
chaining.
- (1) Fix DMA alignment, based on bytes per sample.
feeder_fmt.c:
- Add few more sign conversion feeders for 24 and 32 bit format.
feeder_rate.c:
- Force buffer / bytes allignment. Unaligned buffer may cause
panics during recording on pure 32bit sample format if it
involves feeder_rate as part of feeders chain. Handle strayed
bytes (mostly caused by #1) better.
Tested on: ATI IXP, force 32bit recording.
This DMA alignment issues are extremely hard to reproduce unless the user
happen to have a 32bit capable soundcards (ATI IXP) and knowledgeable enough
to force it to operate under pure 32bit operations on both record and play
directions.
The problem with it was that it swapped the relative order of IP
assignment and parent interface attachment. The present if_vlan
code gets certain flags from the parent, including those meaningful
to the upper layers. E.g., IP assignment to an interface with
IFF_BROADCAST goes somewhat differently from that to a non-broadcast
interface. Consequently, assigning IP before attaching the parent
results in a bogus or missing broadcast address on the vlan interface.
This bug is still here, but at least it won't be triggered by doing
both vlanX configuration steps, IP and vlan+vlandev, in a single
ifconfig invocation, which is usual to setting up vlans via rc.conf.
Work at the global issue is under way.
rev. 1.39 sys/net/if_gre.c
rev. 1.21 sys/netinet/ip_gre.c rev. 1.4 sys/netinet/ip_gre.h
rev. 1.12 sys/netipsec/keysock.c rev. 1.3 sys/netipsec/keysock.h
rev. 1.32 sys/netkey/keysock.c rev. 1.9 sys/netkey/keysock.h
Fix stack corruptions on amd64.
Vararg functions have a different calling convention than regular
functions on amd64. Casting a varag function to a regular one to
match the function pointer declaration will hide the varargs from
the caller and we will end up with an incorrectly setup stack.
Entirely remove the varargs from these functions and change the
functions to match the declaration of the function pointers.
Remove the now unnecessary casts.
Lots of explanations and help from: peter
PR: amd64/89261
Use thread0 instead of user's thread for sobind.
This fixes reconnect after, for example, tcp idle disconnection.
Previously this would fail if a normal user tried to bind to a privileged
port.
a slightly different mechanism to load geom_md (g_me) which was renamed at
some point. This has been tested on RELENG_6 by erwin and glebius.
Reviewed by: erwin, glebius
- hw.ata.wc can cause data loss on crashes too. This brings the
description of the hw.ata.wc in sync with tuning(7)
- Via VT8251 support.
- Support for Marvell chipsets.
Add a64l(), l64a(), and l64a_r() XSI extentions. These functions convert
between a 32-bit integer and a radix-64 ASCII string. The l64a_r() function
is a NetBSD addition.
PR: 51209 (based on submission, but very different)
Reviewed by: bde, ru
date: 2006/01/20 03:21:25; author: csjp; state: Exp; lines: +1 -0
Destroy the dynamic rule zone in the event that we fail to insert the
initial default rule.
MFC revision 1.123
date: 2006/01/20 05:35:27; author: csjp; state: Exp; lines: +25 -10
- Change the return type for init_tables from void to int so we can propagate
errors from rn_inithead back to the ipfw initialization function.
- Check return value of rn_inithead for failure, if table allocation has
failed for any reason, free up any tables we have created and return ENOMEM
- In ipfw_init check the return value of init_tables and free up any mutexes or
UMA zones which may have been created.
- Assert that the supplied table is not NULL before attempting to dereference.
This fixes panics which were a result of invalid memory accesses due to failed
table allocation. This is an issue mainly because the R_Zalloc function is a
malloc(M_NOWAIT) wrapper, thus making it possible for allocations to fail.
Found by: Coverity Prevent (tm)
Coverity ID: CID79
MFC after: 1 week
from HEAD to RELENG_6:
Add a "comconsole_speed" loader variable that can be used to change
the serial console speed (i386 and amd64 only). If the previous
stage boot loader requested a serial console (RB_SERIAL or RB_MULTIPLE)
then the default speed is determined from the current serial port
speed. Otherwise it is set to 9600 or the value of BOOT_COMCONSOLE_SPEED
at compile time.
Approved by: rwatson (mentor)
MFC 1.88:
Improve handling flags that must be propagated
to the parent interface, such as IFF_PROMISC and
IFF_ALLMULTI. In addition, vlan(4) gains ability
to migrate from one parent to another w/o losing
its own flags.
PR: kern/81978
Mega update to the LSI MegaRAID driver:
1. Implement a large set of ioctl shims so that the Linux management apps
from LSI will work. This includes infrastructure to support adding, deleting
and rescanning arrays at runtime. This is based on work from Doug Ambrosko,
heavily augmented by LSI and Yahoo.
2. Implement full 64-bit DMA support. Systems with more than 4GB of RAM
can now operate without the cost of bounce buffers. Cards that cannot do
64-bit DMA will automatically revert to using bounce buffers. This option
can be forced off by setting the 'hw.amr.force_sg32" tunable in the loader.
It should only be turned off for debugging purposes. This work was sponsored
by Yahoo.
3. Streamline the command delivery and interrupt handler paths after
much discussion with Dell and LSI. The logic now closely matches the
intended design, making it both more robust and much faster. Certain
i/o failures under heavy load should be fixed with this.
4. Optimize the locking. In the interrupt handler, the card can be checked
for completed commands without any locks held, due to the handler being
implicitely serialized and there being no need to look at any shared data.
Only grab the lock to return the command structure to the free pool. A
small optimization can still be made to collect all of the completions
together and then free them together under a single lock.
Items 3 and 4 significantly increase the performance of the driver. On an
LSI 320-2X card, transactions per second went from 13,000 to 31,000 in my
testing with these changes. However, these changes are still fairly
experimental and shouldn't be merged to 6.x until there is more testing.
Thanks to Doug Ambrisko, LSI, Dell, and Yahoo for contributing towards
this.
These have now had more testing and Scott requested them to be merged
before the freeze.
o Add workaround for dropped interrupts on VIA and ATI controllers
o Add various identification strings and vendor IDs
o Set sc_dying to 1 when detaching
o Don't bother clearing the unused transfer `hcpriv' field
them to userland. [1]
MFC rev. 1.16 of sys/contrib/pf/net/pf_norm.c: Correct an error in pf
handling of IP packet fragments which could result in a kernel panic.
[2]
Security: FreeBSD-SA-06:06.kmem [1]
Security: FreeBSD-SA-06:07.pf [2]
Bring ATA up to -current standards:
Fix SiS SATA support, the SATA registers was off.
Update the ICH7 support so it deals better with chips without AHCI.
Unbreak hotplug support on the ICH6 and ICH7 chipsets.
Add support for VIA VT8251 southbridge.
Add new nVidia nForce4 chips.
Add support for the Marvell 88SX[56]0[48][01] series of SATA chips.
Fix the promise modesetting for old chips.
Get rid of the advertising clause in the copyright.
Add support for using DMA on dump, greatly speeds up the dump process.
When IOCATAGPARM is called, update the capabilities page that is stored
in the kernel and return the new values.
Fix rebuilds of arrays that got stuck.
Add dump support in ataraid.
Add support for for reading and writing SiS metadata.
Add support for writing VIA metadata.
Add support for writing Intel metadata.
Correct calculation of RAID0 sizes on VIA RAID arrays.
Update Intel MatrixRAID support to be able to pick up RAID0+1 (RAID10)
rmdir() fails with EINVAL if the last component of the path is "..".
Document the previously undocumented behaviour of rmdir(".") returning
EINVAL as required by POSIX and SUSv3. Bump the man page change date.
undelete() fails with EINVAL if the last component of the path is "..".
Bump the man page change date.
Return EINVAL from lookup() if cn_nameiop is DELETE or RENAME and
the last component of the path name is "..". This keeps VOP_LOOKUP()
from locking vnodes in reverse order.
In kern_unlink(), remap EINVAL errors returned from namei() to EPERM
to match existing (and POSIX required) behaviour.
On i386, 7.0 requires 106MB on /usr. 6.0 requires 101MB.
Bump USR_MIN_SIZE to 128MB, so that an auto-layout install won't fail
due to /usr being too small.
Resolve the mount point's path with realpath(2) before checking if file
system is mounted. This prevevents duplicated mounts.
The change I made against the original patch is to fall back to the given
path on realpath(2) failure instead of exiting with an error.
Submitted by: Andreas Kohn <[email protected]>
PR: bin/89782
1.17: convert from network byte order to host byte order not to reverse.
1.19: Get rid of the bogus IFP2FC() macro and use IFP2FWC().
1.20: Fix ip_fastforward() return handling.
PR: kern/91307 (1.19)
Found by: Coverity Prevent(tm) (1.20)
When we give up on an interface, use the arp(8) command to remove all
entries from the interface rather than using ifconfig's delete command.
This preserves non-dhclient configured addresses (though they are wiped
out when dhclient is restarted).
date: 2006/01/15 20:14:11; author: csjp; state: Exp; lines: +1 -1
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.
date: 2005/12/30 20:10:21; author: csjp; state: Exp; lines: +1 -1
mkstemp(3) and friends use a combination of base 10 digits, along
with upper and lower case letters from the English alphabet. Change
the number of possible file names mktemp will return from 26**6
to (10+26+26)**6 instead. This keeps things consistent with mkstemp(3)
date: 2006/01/15 01:02:20; author: csjp; state: Exp; lines: +1 -1
Fix potential overrun of static stack allocated array which stores
the rules. If an array is N elements large, we can only access
elements 0..(N-1).
date: 2006/01/16 17:03:21; author: csjp; state: Exp; lines: +6 -2
Although we check the return value of copyin(9) while determaining how
long the string is in userspace, afterwards we call malloc(M_WAITOK),
which could sleep for an unknown amount of time. Check the return
value of copyin(9) just to be sure that nothing has changed during that
time.
date: 2005/12/30 06:16:20; author: csjp; state: Exp; lines: +5 -0
Document the LOGIN_SETMAC setusercontext(3) flag. While we are here, drop
in an external reference to mac_set_proc(3).
date: 2006/01/15 20:30:13; author: csjp; state: Exp; lines: +5 -0
Validate that the supplied file is not empty before trying mmap(2) it
and access the pages associated with it.
Add myself to the list (Ehi, I'm not the youngest!)
src/usr.bin/calendar/calendars/calendar.freebsd: rev 1.173 -> 1.174
(tomorrow is my birthday..)
Approved by: philip (mentor, implicit)
sys/sparc64/pci/psychoreg.h 1.10 - 1.11,
sys/sparc64/pci/psychovar.h 1.13 - 1.14
Sync psycho(4) with HEAD expect for the UPA_RANGE_* -> OFW_PCI_RANGE_*
and PCI_CS_* -> OFW_PCI_CS_* changes in order to mainly obtain the
following changes:
- Add a workaround for the incorrect interrupt map entry for the EBus
bridge on E250 machines. [1]
- Register an interrupt handler for the spare hardware interrupt which
according to OpenSolaris is used as the over-temperature interrupt in
systems with Psycho bridges.
PR: 88279 [1]
Use <sys/ktr.h> directly in .S files instead of exporting the
KTR_* class macros via genassym.c. Together with sys/sys/ktr.h 1.34
(MFC'ed in 1.32.2.2) this has the desired side-effect of providing a
default value for KTR_COMPILE. Thus this fixes warnings from -Wundef
regarding KTR_COMPILE not being defined for .S files.
Extend the scope of #ifndef LOCORE to also cover the prototype of
ktr_tracepoint() and the macros using it. This allows this header
to be included in .S files for obtaining the KTR_* class macros
directly and providing a default value for KTR_COMPILE in case it's
not specified in the kernel config file including defining it to 0
when not using 'options KTR' at all.
- The inline asm in this file uses output operands before all input
operands are consumed so use the appropriate constraint modifier.
Before this change GCC used one register for both an input and an
unrelated output operand of in_addword(), causing the input to be
overwritten before it was consumed and thus breaking in_addword().
For in_cksum_hdr() and in_pseudo() this change is more or less
cosmetic.
- Fix a misspelling in a nearby comment.
In moduledir_readhints() cast the value returned by sizeof() to ssize_t
when checking whether it's greater than a struct stat st_size in order
to also catch the case when st_size is -1. Previously this check didn't
trigger on sparc64 when st_size is -1 (as it's the case for a file on
a bzipfs, TFTP server etc.), causing the content of the linker hints
file to be copied to memory referenced by a null-pointer.
PR: 91231
Use a callback to set up a vlan interface so that "vlan"
and "vlandev" commands can be specified in any order.
This makes the code more compact and clear as well.
Improve error check on vlan argument.
Eliminate some unneeded code bits.
contains incorrect fractional second values (outside the range
0-999999).
Prior to this change users could create files with values outside
that range. Moreover, on 32-bit machines tv_usec offsets larger than
4.3s would result in an unnormalized AND wrong timestamp value,
due to overflow.
Simplify the code by making use of 'kldstat -q -m <mod>'.
Use available rc.subr features.
Reduce code duplication.
Follow the current style of rc.d scripting.
Document that `reload' is not provided by default
yet it can be enabled when applicable.
Use consistent punctuation and vertical indenting around .Dl's.
Wrap a too long line.
As rse@ agreed, "status" should stay in $extra_commands
if an rc.d script doesn't use $command and default methods
associated with it. This is true since rc.subr r1.42.
With r1.42 merged to rc.subr on RELENG_6 (thanks Doug!),
it's right time to re-add "status" to $extra_commands in
this script.
When sending export datagram from interrupt thread, use NG_QUEUE
in flags. When sending export datagram from expiry thread, then
use default zero flags. This removes unpleasant contention of the
interrupt thread on mutexes (usually ng_ksocket's socket buffer
mutex).
Do not force queueing on peer hooks. This was important only for
5.0-CURRENT. And it looks like this didn't work before Julian's
revamp of netgraph queue code.
Reviewed by: julian
Mark appropriate commands with NGM_READONLY and NGM_HASREPLY and
bump type cookie.
This fixes flowctl(8) exiting without any output under high load on SMP.
Provide additional macros for sending netgraph items, which allow
to use non-default flags for netgraph functions. Implement current
macros via new ones.
Add a warning pointing out that incomplete ports trees are not
supported and that users of REFUSE directives should update their
entire ports tree before asking for help on the mailing lists.
Add support for the Wacom Graphire 3 4x5. Like the Graphire 3, it has a
broken report descriptor. While I'm here, make all the other report
descriptors const to match the newly added one.
Add support for Xbox 360 gamepads. They are HID-capable devices, but
lack a report descriptor and don't use the standard interface class.
This patch works around these deficiencies so that the uhid(4) driver
can recognize and use those broken devices.
Allow to use Time DPA20B 1GB MP3 Player [1]
Allow to use Qware BeatZkey! Pro [2]
PR: usb/81846 [1], usb/79164 [2]
Submitted by: Ruben de Groot <[email protected]> [1], Radek Kozlowski <[email protected]> [2]
Approved by: njl (implict)
sys/cam/scsi/scsi_da.c 1.182
sys/dev/usb/umass.c 1.125
sys/dev/usb/usbdevs 1.238
Allow to use TransFlash drive, which can be found in Motorola E398 Mobile Phone.
PR: usb/89889
Submitted by: Wojciech A. Koszek <[email protected]>
r1.36:
Correct obsolete chown syntax.
r1.37:
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>.
- Workaround for sb16 behave poorly when running at 45000 hz while
vchan is enabled.
Ruthless vchan speed workaround against the dreaded sb16 / sb16x.
It appear that nothing else using this weird 45k / 49k speed upper
limit.
- Raise VCHAN_DEFAULT_SPEED from 44100 to 48000.
Reported by: many sb16, AWE64 users.
markable changes are:
o Suspend/resume methods.
o Link state detection fixes.
o Utilization of jumbo allocator and extended RX descriptors.
o busdma(9) cleanup and support for big-endian architectures.
o Improved checksum offloading support.
o Reduced number of PCI register writes in bge_start().
o Counting RX/TX errors as input/output interface errors.
struct mbuf *m_getjcl(int how, short type, int flags, int size)
void *m_cljget(struct mbuf *m, int how, int size)
For size both take MCLBYTES, MJUM4BYTES, MJUM9BYTES, MJUM16BYTES.
Tested by: glebius
Sponsored by: TCP/IP Optimization Fundraise 2005
- Locking fixes. Release lock while chn_intr().
- Mark MPSAFE since most of the locking procedures already implemented.
- Turn on inverted external amplifier sense flag for selected boards.
Tested by: bland
In realloc(9), determine size of the original block based on
UMA_SLAB_MALLOC flag.
In some circumstances (I observed it when I was doing a lot of reallocs)
UMA_SLAB_MALLOC can be set even if us_keg != NULL.
If this is the case we have wonderful, silent data corruption, because less
data is copied to the newly allocated region than should be.
Add -K option to pkg_add and pkg_info.
This option saves packages to PKGDIR (if defined or current directory by default)
as they are downloaded.
Silent a warning when -n is used and package has a +DISPLAY file.
src/usr.sbin/pkg_install/info/perform.c: rev 1.53 -> 1.54
src/usr.sbin/pkg_install/add/main.c: rev 1.65 -> 1.66
src/usr.sbin/pkg_install/lib/lib.h: rev 1.56 -> 1.57
src/usr.sbin/pkg_install/info/pkg_info.1: rev 1.55 -> 1.56
src/usr.sbin/pkg_install/add/add.h: rev 1.12 -> 1.13
src/usr.sbin/pkg_install/add/pkg_add.1: rev 1.68 -> 1.69
src/usr.sbin/pkg_install/add/perform.c: rev 1.78 -> 1.79
src/usr.sbin/pkg_install/info/info.h: rev 1.28 -> 1.29
src/usr.sbin/pkg_install/lib/url.c: rev 1.4 -> 1.5
src/usr.sbin/pkg_install/info/main.c: rev 1.48 -> 1.49
Add a new feature for optimizining ipfw rulesets - substitution of the
action argument with the value obtained from table lookup. The feature
is now applicable only to "pipe", "queue", "divert", "tee", "netgraph"
and "ngtee" rules.
Optimize parallel processing of ipfw(4) rulesets eliminating the locking
of the radix lookup tables. Since several rnh_lookup() can run in
parallel on the same table, we can piggyback on the shared locking
provided by ipfw(4).
However, the single entry cache in the ip_fw_table can't be used lockless,
so it is removed. This pessimizes two cases: processing of bursts of similar
packets and matching one packet against the same table several times during
one ipfw_chk() lookup. To optimize the processing of similar packet bursts
administrator should use stateful firewall. To optimize the second problem
a solution will be provided soon.
Details:
o Since we piggyback on the ipfw(4) locking, and the latter is per-chain,
the tables are moved from the global declaration to the
struct ip_fw_chain.
o The struct ip_fw_table is shrunk to one entry and thus vanished.
o All table manipulating functions are extended to accept the struct
ip_fw_chain * argument.
o All table modifing functions use IPFW_WLOCK_ASSERT().
First step in removing welding between ipfw(4) and dummynet.
o Do not use ipfw_insn_pipe->pipe_ptr in locate_flowset(). The
_ipfw_insn_pipe isn't touched by this commit to preserve ABI
compatibility.
o To optimize the lookup of the pipe/flowset in locate_flowset()
introduce hashes for pipes and queues:
- To preserve ABI compatibility utilize the place of global list
pointer for SLIST_ENTRY.
- Introduce locate_flowset(queue nr) and locate_pipe(pipe nr).
o Rework all the dummynet code to deal with the hashes, not global
lists. Also did some style(9) changes in the code blocks that were
touched by this sweep:
- Be conservative about flowset and pipe variable names on stack,
use "fs" and "pipe" everywhere.
- Cleanup whitespaces.
- Sort variables.
- Give variables more meaningful names.
- Uppercase and dots in comments.
- ENOMEM when malloc(9) failed.
date: 2005/12/16 18:32:39; author: delphij; state: Exp; lines: +2 -0
In pipe_write(): when uiomove() fails, do not spin on it forever.
Submitted by: Kostik Belousov <kostikbel at gmail.com> on -current@
Message-ID: <[email protected]>
Security: Local DoS
Add some cards:
- several TerraTec TValue [1]
- PixelView PlayTV Pro REV-4C [2]
In case you have the PixelView card, please tell us the "pciconf -v -l"
output on [email protected] if it works. There are revisions out there
which may not work and we need to know which ones work.
PR: 53383 [1], 76002 [2]
Submitted by: Tanja Wittke <[email protected]> [1], barner [1],
Dan Angelescu <[email protected]> [2]
The minimum / maximum speed was way too low / high!
minspeed = 2000 - is this for real ?
maxspeed = 767999 - is this for real ?????
Wrap everything into 8000 - 48000 boundary, just to be safe.
- Use VLAN_TAG_VALUE() not only to read a dot1q tag
value from an m_tag, but also to set it. This reduces
complex code duplication and improves its readability.
- Fix VLAN_INPUT_TAG() macro, so that it doesn't touch mtag in
case if memory allocation failed.
- Remove fourth argument from VLAN_INPUT_TAG(), that was used
incorrectly in almost all drivers. Indicate failure with
mbuf value of NULL.
Prevent module unloading if there are active connections.
PR: kern/89085
Submitted by: Rostislav Krasny
Requested by: Rostislav Krasny <rosti dot bsd at gmail dot com>
- MPSAFE
- Fix / reorganize attach routine. Device specific initialization must
be done after generic bus / DMA setup. At last, Virtual Channels
(vchan) works as expected.
Tested by: barner
Instead of dragging the entire ICH4/82801DB into this mess, select
only few boards based on pci subdevice / subvendor.
Tested by: Daisuke Orikasa <luxury-acura-3.5rl at nifty.com>
src/sys/dev/atkbdc/psm.c; revision 1.88
date: 2006/01/05 19:24:01; author: dumbbell; state: Exp; lines: +2 -1
Fix a bug in Synaptics Touchapd support where psm(4) will enter an infinite
loop if it receives an out of sync packet.
Reviewed by: mux (mentor)
date: 2005/12/13 15:32:52; author: delphij; state: Exp; lines: +5 -5
In Linux, kernel parameters passed to ioctl are by value, while in FreeBSD
they are passed by reference. Handle the difference within the
linux_ioctl_termio on the LINUX_TCFLSH path.
Submitted by: Jaroslav Drzik <jaro_AT_coop-voz_dot_sk>
Reminded by: glebius
When returning EIO from DEVFSIO_RADD ioctl, drop the exclusive rule
lock. Otherwise the system comes to a rather sudden and grinding
halt.
As the underlying devfs locking changes that lead to this bug have not
been merged to RELENG_5, this fix to those locking changes does not
need to be merged.
Correct insecure temporary file usage in ee. [06:02]
Correct a race condition when setting file permissions, sanitize file
names by default, and fix a buffer overflow when handling files
larger than 4GB in cpio. [06:03]
Fix an error in the handling of IP fragments in ipfw which can cause
a kernel panic. [06:04]
Security: FreeBSD-SA-06:01.texindex
Security: FreeBSD-SA-06:02.ee
Security: FreeBSD-SA-06:03.cpio
Security: FreeBSD-SA-06:04.ipfw
info/show.c:1.40 lib/plist.c:1.51
date: 2006/01/07 22:10:57; author: krion; state: Exp; lines: +10 -3
When using @cwd %%FOO%%, we must ensure to return in the original
prefix later, but doing so with @cwd %%OLDPREFIX%% (having
PLIST_SUB+="OLDPREFIX=${PREFIX}") hardcodes the value in the packing
list. That's not really a problem when dealing with ports but that's
a problem with packages since pkg_add -p option only overrides the
first @cwd occurrence.
This patch allow us to use @cwd without any argument. If no
directory argument is given, it will set current working directory
to the first prefix given by the @cwd command.
PR: bin/77212
Submitted by: flz
some DL380s):
- Release the pci_link acpi serial lock if a link device has no actual
links.
- Don't panic if a _PRT entry references an invalid link on a link device
unless we actually try to route an interrupt using that _PRT entry.
In ng_netflow_disconnect() check whether we are working with "iface"
or with "out" hook, and clear the right pointer.
Reported by: Vitaliy Ovsyannikov <V.Ovsyannikov kr.ru>
When in rev. 1.47 cardbus_alloc_resources() function was moved from
cardbus_cis.c to this file, some code was not merged and thus resource
list entries were invalid. They didn't have a resources attached to
them.
However, the problem was masked for some time later, because newer
resources list entries were added to the head of the list, and
resource_list_find() always returned the first matching resource list
entry. Usually the underlying driver allocated a valid resource and
added it to the head of the list, and invalid one wasn't used.
In rev. 1.174 of subr_bus.c the sorting of resource list entries was
reversed demasking the problem in cardbus_alloc_resources().
This commit fixes the problem returning back some code from
cardbus_cis.c, pre-1.49 revisions.
PR: kern/87114
PR: kern/90441
Hardware provided by: Vasily Olekhov <olekhov yandex.ru>
Reviewed by: imp
emulating architectures that allow this (Linux so far).
To preserve kernel modules ABI, unlike the version commited into the trunk,
which adds new flag field into Brandinfo structure for this purpose, this
one checks if brand field of Brandinfo matches ELFOSABI_LINUX.
PR: kern/87615
Submitted by: Marcin Koziej <[email protected]>
1. Add missing semicolon between "warn" and "return" to make sure
the line continuation backslash doesn't cause "warn" to print "return".
2. Group "warn" and "return" together as the "return 1" should be
performed only if the "kldload nfsclient" also failed (and not
already if the "vfs.nfs" sysctl(8) check failed).
Fix semantics in the documentation of the "jail_socket_unixiproute_only"
variable ("YES" vs. "NO") and be more precise and intuitive on what is
actually allowed/restricted by this variable ("UNIX/IP/route sockets"
vs. "TCP/IP protocols").
The ObsoleteFiles removal/test targets
- check-old
- delete-old
- delete-old-libs
and the corresponding docs.
Note: Someone may want to have a look at the man-page and perhaps MFC
some other parts (unrelated to ObsoleteFiles).
Tested by: bz
inetd(8) requires that /etc/netconfig be present, and contain entries
for each of udp and tcp (and their IPv6 equivalents when INET6 is
enabled). Note that dependency here.
PR: docs/90435
Submitted by: Dmitry Kazarov <kazarov at mcm dot ru>
Pointed out by: Daniel Gerzo <danger at rulez dot sk>
kern_sig.c revision 1.319
sys_process.c revision 1.134
Avoid kernel panic when attaching a process which
may not be stopped by debugger, e.g process is dumping core.
An i386 machine with 32MB of RAM requires a 700MB disk for auto-layout to
succeed, whilst an i386 with 256MB of RAM requires more. Up the amount
of disk hinted at as a minimum requisite for auto-layout.
Call fill_kinfo_proc_only() instead of fill_kinfo_proc()
before calling fill_kinfo_thread(), because fill_kinfo_proc()
calls both fill_kinfo_proc_only() and fill_kinfo_thread().
This is a minor optimization and there should be no change
in functionality.
Leading whitespace cleanup.
kbyanc 2005-12-28 20:36:55 UTC
FreeBSD src repository
Modified files:
usr.bin/netstat Makefile ipsec.c main.c netstat.h
Added files:
usr.bin/netstat pfkey.c
Log:
Add support for printing IPSEC protocol stats if the kernel was
compiled with FAST_IPSEC rather than the KAME IPSEC stack.
Note that the output of "netstat -s -p ipsec" differs depending on
which stack is compiled into the kernel since they each keep different
stats. This delta also adds the "esp", "ah", and "ipcomp" protocol
stats, which are also available when the kernel is compiled with the
FAST_IPSEC stack (e.g. "netstat -s -p esp").
Submitted by: Matt Titus <titus at nttmcl dot com>
Revision Changes Path
1.31 +2 -1 src/usr.bin/netstat/Makefile
1.13 +266 -94 src/usr.bin/netstat/ipsec.c
1.81 +29 -0 src/usr.bin/netstat/main.c
1.47 +6 -0 src/usr.bin/netstat/netstat.h
1.1 +184 -0 src/usr.bin/netstat/pfkey.c (new)
Original commit message:
Log:
Apply the same fix to a potential race in the ISDOTDOT code in
cd9660_lookup() that was used to fix an actual race in ufs_lookup.c:1.78.
This is not currently a hazard, but the bug would be activated by
marking cd9660 as MPSAFE.
Requested by: bde
Original commit message:
Log:
Apply the same fix to a potential race in the ISDOTDOT code in
ext2_lookup() that was used to fix an actual race in ufs_lookup.c:1.78.
This is not currently a hazard, but the bug would be activated by
marking ext2fs as MPSAFE.
Requested by: bde
MFC after: 2 weeks
Original commit messages:
Log:
Track all lock relationships instead of pruning direct relationships
if an indirect relationship exists (keep both A->B->C and A->C).
This allows witness_checkorder() to use isitmychild() instead of
the much more expensive isitmydescendant() to check for valid lock
ordering.
Don't do an expensive tree walk to update the w_level values when
the tree is updated. Only update the w_level values when using the
debugger to display the tree.
Nuke the experimental "witness_watch > 1" mode that only compared
w_level for the two locks. This information is no longer maintained
at run time, and the use of isitmychild() in witness_checkorder
should bring performance close enough to the acceptable level that
this hack is not needed.
Report witness data structure allocation statistics under the
debug.witness sysctl.
Reviewed by: jhb
MFC after: 30 days
Log:
Relocate witness_levelall(), witness_leveldescendents(), and
witness_displaydescendants() so that they are protected by
"#ifdef DDB/#endif" to unbreak kernels not using "option DDB".
MFC after: 3 weeks
- Fix possible memory leak due to repetetive strdup(3) without matching
free(3).
- print_recsrc() should honor shortflag and give appropriate output for
later consumption by /etc/rc.d/mixer. This will ensure that recording
device selections survived across reboot. Output everything to stdout
instead of stderr.
In watchdog_config enable the software watchdog iff the WD_ACTIVE flag
is set. When watchdogd(1) is terminated intentionally it clears the
bit, which should then disable it in the kernel.
PR: kern/74386
Submitted by: Alex Hoff <ahoff at sandvine dot com>
Approved by: rwatson (mentor)
most of the sysctl's (those which would introduce a new interface).
The spdif_enabled sysctl is still there (or more correctly: added
to another driver).
A rough overview what's there now:
- new driver for ATI chips (snd_atiixp)
- support for some Intel HDA chips in AC97 mode (no real HDA
support!), this doesn't work with every mainboard and is
subject to the wiring on the mainboard (no servicable parts
inside)
- MPSAFE and fixes for snd_als4000(4), snd_es137x(4),
snd_via82c686(4), snd_via8233(4) and snd_ich(4)
- 24bit and 32bit sound format support
- feeder infrastructure (format, rate) has been reworked, new
feeder (volume) has been introduced
- lots of LOR and panic issues fixed
- and a lot of small or not so small fixes I may have forgotten...
As noted in UPDATING: you may want to recompile mplayer (after booting
into the new world) to get all new features.
Tested by: a lot of people
Requested by: ariff
Submitted by: ariff
Move PFSTATE_EXPIRING from sync_flags to a new local_flags. sync_flags
has special handling when zero. This caused no PFSYNC_ACT_DEL message and
thus disfunction of pfflowd and state synchronisation in general.
Discovered by: thompsa
Good catch by: thompsa
and
Only decrement the max-src-conn counter for tcp connections that reached
"established" state.
Similar to OpenBSD's rev. 1.499 by joel but not breaking ABI.
Obtained from: OpenBSD (with changes)
Reported by: Bruno Afonso
ok reyk@
It seems ciss should ignore overrun and underrun on a SCSI INQUIRY
command. This fixes some weird booting issues on newer versions
of the firmware on the MSA20.
osigpending, osigvec, osigblock, osigsetmask, osigsuspend, osigstack,
clock_gettime, clock_settime, and clock_getres.
Also correct the prototype for freebsd32_nanosleep in syscalls.master.
Calling setrlimit from 32bit apps could potentially increase certain
limits beyond what should be capiable in a 32bit process, so we
must fixup the limits.
This is slightly different than HEAD to not change the ABI.
Move execve's access time update functionality into a
new vfs_mark_atime() function, and use the new function
for performing efficient atime updates in mmap().
power outages, spontaneously generated mini (or larger) black holes,
planetary disruptions, or personal injury or worse that may result from the
use of this material.
-- taken from Samuel M. Goldwasser's
Sam's Strobe FAQ Notes on the Troubleshooting
and Repair of Electronic Flash Units and Strobe Lights
Make nve(4) work for people with nf3/nf4 who never got it
working at all and only saw "nve0: device timeout (N)" messages.
- Setup PHY before handing control to NVidia API setting
speed, duplex, enabling interrupts, etc.
- Add restriction of MAXADDR_32BIT for high address to contigmalloc
to make the driver work on machines with 4+GB of memory.
- fixed typos
- improved some comment descriptions
- use NULL, instead of 0, to denote a NULL pointer
- avoid embedding a magic number in the code
- use nd6log() instead of log() to record NDP-specific logs
- nuked an unnecessay white space
Revision Path
1.67 src/sys/netinet6/icmp6.c
1.55 src/sys/netinet6/in6.c
1.29 src/sys/netinet6/in6_ifattach.c
1.56 src/sys/netinet6/nd6.c
1.35 src/sys/netinet6/nd6_nbr.c
1.29 src/sys/netinet6/nd6_rtr.c
was fixed in the new ppp script, but I did not merge the ppp-user -> ppp
change, so this got missed. Mea culpa.
Submitted by: Greg Rivers <[email protected]>
When using m_dup(9) to copy more than MHLEN bytes of data, don't
create an mbuf chain that starts with a cluster containing just MHLEN
bytes. This happened because m_dup called m_get or m_getcl depending
on the amount of data to copy, but then always set the size available
in the first mbuf to MHLEN.
Approved by: jmg
Silence from: rwatson (mentor)
When removing the local domain, only do so when the result
will be a host name. This is matches the documented behaviro.
The previous behavior would remove the domain name even if
the result retained a dot.
This fixes rsh connections from a.example.com to example.com.
This is also reported to fix rsh connections from host xxx to
yyy.example.com.
PR: 88301
When we get a bogus hostname in an option, drop the option
rather than refusing the lease. This allow obtaining leases
on misadministered networks that use host names with
underscores in them.
Reminded by: avatar
before rc.d/mountcritremote, so it is possible to mount /usr/ over
IPsec.
Discussed on: arch@
Suggested by: Tomasz Pi³at <[email protected]>
Prodded by: dougb
Add prototype for following functions:
pthread_condattr_getpshared
pthread_condattr_setpshared
pthread_mutexattr_getpshared
pthread_mutexattr_setpshared
thr_exit.c:
Revision 1.19
Fix code for user stack recycling.
thr_join.c:
Revision 1.18
Fix code for user stack recycling.
Revision 1.17
Add function pthread_timedjoin_np.
transfer "done" method for non-repeat transfers to avoid problems
if the transfer gets recycled by the callback. In particular this
fixes page faults seen when using OHCI controllers with ucom devices.
usb_quirks.c: 1.43
usb_quirks.h: 1.19
usb_subr.c: 1.78
usbdevs: 1.236
While this might not be the best solution, this has been considered good enough
to be MFC'ed.
Approved by: ssouhlal
Discussed on: src-committers@
- i915 (i830-i915) driver ported.
- S3 Savage driver ported.
- Added support for ATI_fragment_shader registers for r200.
- Improved r300 support, needed for latest r300 DRI driver.
- (possibly) r300 PCIE support, needs X.Org server from CVS.
- Added support for PCI Matrox cards.
- Software fallbacks fixed for Rage 128, which used to render badly or hang.
- Some issues reported by WITNESS are fixed.
register, remove or change services in the local database. For now only
accept the request if the peer has effective user ID the same as 'root'
user ID.
- Add locked variants of nve_start(), nve_init(), and nve_ifmedia_upd().
- Use callout_* to manage callouts rather than timeout(9).
- Mark interrupt handler MPSAFE (IFF_NEEDGIANT was already clear).
- Lock the driver lock in driver entry points such as the interrupt
handler, if_start, and if_init rather than locking the driver mutex
in the various work functions called by the binary blob.
- Use IFQ_DRV_IS_EMPTY() macro rather than doing it by hand.
- Fix locking in detach.
- Remove some unused fields from the softc.
- Don't make the driver lock recursive, it shouldn't be recursively
acquired anywhere in the driver now.
- Axe the spin mutex used for the nve_oslock*() routines. The driver lock
already provides sufficient synchronization.
- Don't mess around with IFF_UP when the link state changes. IFF_UP is
an administrative flag, not a link status indicator.
Document that changes to nsswitch.conf might be needed when
compiling with NO_NIS.
[ also see make.conf(5) and nsswitch.conf(5) ]
MFC rev. 1.270 by keramida
Add extra '#' comment characters at the beginning of two
lines that started with TABs, to avoid make(1) warnings introduced
in rev. 1.267.
Since we want a vinum geom created anytime the module loads, move the
geom creation to a seperate init function and ignore the tasting.
The config is now parsed only in the vinumdrive geom, which hopefully
fixes the problem, that the drive class tasted before the vinum class
had a chance, for good.
Also restore the behaviour that the module can be loaded at boot time
and on a running system.
--
Check for g_read_data(9) errors properly; don't pass error value
pointer to g_read_data(9) at all if we don't have any use of it.
- bump the date to represent the addition of ipv4_addrs_<ifn>.
- ru's -mdoc sweep
- bring in documentation of NOAUTO
- remove obsolete documentation of dead removable_interfaces
1.47: Be less IPv4 centric. When checking if the interface is
already configured, check if the UP flag is set instead of
checking for the netmask keyword.
1.48: Use more rc.subr bits to clean up pccard_ether and implement
new features. Both the presence of a NOAUTO keyword and an
interface being up can be ignored is the forcestart option
is used. Additionally, a restart option has been added.
revision 1.2
date: 2005/10/21 09:15:26; author: dumbbell; state: Exp; lines: +3 -1
Apply the same fix to a potential race in the ISDOTDOT code
in reiserfs_lookup() that was used to fix an actual race in
ufs_lookup.c:1.78. This is not currently a hazard, but the
bug would be activated by marking reiserfs as MPSAFE.
Reviewed by: mux (mentor)
Move zs.c from files to files.powerpc as zs(4) by now is only supported
on powerpc (more or less...). That way people updating from FreeBSD 5 to
FreeBSD 6 and beyond on sparc64 will get an error from config(8) rather
than a mysterious compile error when they have a stale 'device zs' in
their kernel config file.
- Update the flow sequence before converting count to
network byte order.
- Update the flow sequence in one atomic op instead of two.
Reported by: Denis Shaposhnikov <dsh vlink.ru>
Reported by: Daniil Kharoun <kdl chelcom.ru>
PR: kern/89417
IPv6 support was committed:
- Stop treating `ip' and `ipv6' as special in `proto' option as they
conflict with /etc/protocols.
- Disuse `ipv4' in `proto' option as it is corresponding to `ipv6'.
- When protocol is specified as numeric, treat it as it is even it is
41 (ipv6).
- Allow zero for protocol as it is valid number of `ip'.
sbin/ipfw/ipfw.8: 1.180
src/sbin/ipfw/ipfw2.c: 1.80
This eliminates the possibility of a crash due to getting an interrupt after
we free the ifp and the interrupt handler depending on ifp being still alive.
moused.8 r1.54 to r1.57
moused.c r1.71:
Add a -H option to enable horizontal virtual scrolling, much like -V for
vertical virtual scrolling. This also respects -U for the distance.
moused.c 1.74:
Add an option to stop 'mouse drift' in some defective/cheap mice. This
stops the pointer slowly wandering away on its own in an annoying way when
the mouse isn't physically moved.
moused.8:
Documentation of above and ru's mdoc magic.
Procrastinator of the year: philip
Preserve /etc/sysctl.conf when doing a binary update. This prevents, for
instance, the dreaded shared memory problem in PostgreSQL coming back to
haunt you after a binary update.
- Add a workaround for the fact that OFW doesn't guarantee that
devices can be opened multiple times simultaneously but we're
expected to be able to do so by the rest of the loader.
This fixes booting from disks attached to the on-board SCSI
controller of Sun Ultra 1 (previously this triggered a trap)
and probably also of AX1115 boards.
- While here, remove unused variables and add empty lines where
style(9) requires such.
In ofw_parsedev() check the return value of malloc() and protect
against a NULL pointer dereference when ofw_parsedev() is called
with a NULL path argument.
Use an ihandle_t to store the instance handle of an opened device
instead of a phandle_t (package handle). Since both are typedefed
to unsigned int, this is more or less cosmetic.
- Convert hme(4) to use TX side bus_dmamap_load_mbuf_sg(9).
- Move hardware counter reading/zeroing to hme_tick(). This saves
8 register access per interrupt. [1]
- Use imax macro for getting max. argument between two integers.
- Invoke bus_dmamap_sync(9) first before freeing mbuf.
- Check driver queue first to reduce locking operation in hme_start_locked()
and interrupt handler.
- Simplyfy watchdog timer setup in interrupt handler.
- Don't log normal errors such as RX overrun. If we have DMA stuck
condition, reinitialize the driver and log it.
Significant refactoring of the accounting code to improve locking and VFS
happiness, as well as correct other bugs:
- Replace notion of current and saved accounting credential/vnode with a
single credential/vnode and an acct_suspended flag. This simplifies the
accounting logic substantially.
- Replace acct_mtx with acct_sx, a sleepable lock held exclusively during
reconfiguration and space polling, but shared during log entry
generation. This avoids holding a mutex over sleepable VFS operations.
- Hold the sx lock over the duration of the I/O so that the vnode I/O
cannot occur after vnode close, which could occur previously if
accounting was disabled as a process exited.
- Write the accounting log entry with Giant conditionally acquired based
on the file system where the log is stored. Previously, the accounting
code relied on the caller acquiring Giant.
- Acquire Giant conditionally in the accounting callout based on the file
system where the accounting log is stored. Run the callout MPSAFE.
- Expose acct_suspended via a read-only sysctl so it is possibly to
programmatically determine whether accounting is suspended or not without
attempting to parse logs.
- Check both acct_vp and acct_suspended lock-free before entering the
accounting sx lock in acct().
- When accounting is disabled due to a VBAD vnode (i.e., forceable unmount),
generate a log message indicating accounting has been disabled.
- Correct a long-standing bug in how free space is calculated and compared
to the required space: generate and compare signed results, not unsigned
results, or negative free space will cause accounting to not be suspended
when required, or worse, incorrectly resumed once negative free space is
reached.
Check IFF_DRV_RUNNING in the re_intr() loop. It can disappear,
since re_rxeof() drops the lock for some time.
Reported & tested by: XueFeng Deng <dsnofe yahoo.com.cn>
the underlying drive had been hot-unplugged from the system.
This merges the following revisions:
Revision Path
1.94 src/sys/cam/scsi/scsi_cd.c
1.181 src/sys/cam/scsi/scsi_da.c
1.98 src/sys/geom/geom_disk.c
1.5 src/sys/geom/geom_disk.h
1.88 src/sys/geom/geom_subr.c
Finally bring in what was produced during Google SoC 2005:
Add functions to rename objects and to move a subdisk from one drive
to another.
Add manual page (finally).
Bring up-to-date the online help.
Plus several cleanups and whitespace fixes.
Finally bring in what was produced during Google SoC 2005:
Add functions to rename objects and to move a subdisk from one drive
to another.
Plus several whitespace/style fixes.
Since carp(4) interfaces presently are kinda fake yet possess
IP addresses, mark them with LOOPBACK so that routing daemons
take them easy for link-state routing protocols.
Reviewed by: glebius
Prevent backup CARP hosts from replying to arp requests, fixes strangeness
with some layer-3 switches. From Bill Marquette.
Tested by: Kazuaki Oda <kaakun highway.ne.jp>
- Document last change to ARP behavior.
- Document several undocumented sysctl variables.
- Fix spelling of few diagnostics.
- Improve the documentation of "proxyall" knob, somewhat: we do not
proxy for hosts that are reachable through the same interface the
request came in from. This feature is mainly for hosts reachable
through some P2P link, e.g. the gif(4) tunnel.
Rework ARP retransmission algorythm so that ARP requests are
retransmitted without suppression, while there is demand for
such ARP entry. As before, retransmission is rate limited to
one packet per second. Details:
- Remove net.link.ether.inet.host_down_time
- Do not set/clear RTF_REJECT flag on route, to
avoid rt_check() returning error. We will generate error
ourselves.
- Return EWOULDBLOCK on first arp_maxtries failed
requests , and return EHOSTDOWN/EHOSTUNREACH
on further requests.
- Retransmit ARP request always, independently from return
code. Ratelimit to 1 pps.
MFC 1.142:
Use monotonic 'time_uptime' instead of 'time_second' as timebase
for rt->rt_rmx.rmx_expire.
- Do not raise IFF_DRV_OACTIVE flag in vlan_start, because this
can lead to stalled interface
- Explain this fact in a comment.
Reviewed by: rwatson, thompsa, yar
Fix several races between socket closure and node/hook
destruction:
- Backout 1.62, since it doesn't fix all possible
problems.
- Upon node creation, put an additional reference on node.
- Add a mutex and refcounter to struct ngsock. Netgraph node,
control socket and data socket all count as references.
- Introduce ng_socket_free_priv() which removes one reference
from ngsock, and frees it when all references has gone.
- No direct pointers between pcbs and node, all pointing
is done via struct ngsock and protected with mutex.
revision 1.117
date: 2005/11/02 15:23:47; author: glebius; state: Exp; lines: +47 -8
Fix two races which happen when netgraph is restructuring:
- Introduce ng_topo_mtx, a mutex to protect topology changes.
- In ng_destroy_node() protect with ng_topo_mtx the process
of checking and pointing at ng_deadnode. [1]
- In ng_con_part2() check that our peer is not a ng_deadnode,
and protect the check with ng_topo_mtx.
- Add KASSERTs to ng_acquire_read/write, to make more
understandible synopsis in case if called on ng_deadnode.
Reported by: Roselyn Lee [1]
----------------------------
revision 1.116
date: 2005/11/02 14:27:24; author: glebius; state: Exp; lines: +106 -121
Rework the ng_item queueing on nodes:
- Introduce a new flags NGQF_QREADER and NGQF_QWRITER,
which tell how the item should be actually applied,
overriding NGQF_READER/NGQF_WRITER flags.
- Do not differ between pending reader or writer. Use only
one flag that is raised, when there are pending items.
- Schedule netgraph ISR in ng_queue_rw(), so that callers
do not need to do this job.
- Fix several comments.
Submitted by: julian
As well as some lesser changes: ng_base.c 1.114, 1.113, 1.107, 1.118.
revision 1.83
date: 2005/11/09 08:43:18; author: yongari; state: Exp; lines: +41 -38
Make em(4) work on big-endian architectures.
- disable jumbo frame support on strict alignment architectures due
to the limitation of hardware. The driver needs a fix-up code for
RX side. The fix will show up in near future.
- fix endian issue for 82544 on PCI-X bus. I couldn't test this as
I don't have the NIC/hardware.
- prefer PCIR_BAR to hardcoded EM_MMBA.
- Properly checks for for 64bit BAR [1]
- replace inl/outl with bus_space(9) [1]
- fix endian issue on VLAN handling.
- reorder header files and remove unnecessary one.
Reviewed by: cognet
No response from: pdeuskar, tackerman
Obtained from: OpenBSD [1]
revision 1.84
date: 2005/11/09 15:23:54; author: glebius; state: Exp; lines: +7 -3
- Introduce two more stat counters, counting number of RX
overruns and number of watchdog timeouts.
- Do not log(9) RX overrun events, since this pessimizes
things under load [1].
- Do not increase if->if_oerrors in em_watchdog(), since
this leads to counter slipping back, when if->if_oerrors
is recalculated in em_update_stats_counters(). Instead
increase watchdog counter in em_watchdog() and take it
into account in em_update_stats_counters().
revision 1.86
date: 2005/11/11 16:04:51; author: ru; state: Exp; lines: +1 -1
- Store pointer to the link-level address right in "struct ifnet"
rather than in ifindex_table[]; all (except one) accesses are
through ifp anyway. IF_LLADDR() works faster, and all (except
one) ifaddr_byindex() users were converted to use ifp->if_addr.
- Stop storing a (pointer to) Ethernet address in "struct arpcom",
and drop the IFP2ENADDR() macro; all users have been converted
to use IF_LLADDR() instead.
revisions 1.85, 1.87
- Introduce tunables em.hw.txd and em.hw.rxd, which allow administrator
to configure number of transmit and receive descriptors.
- Check em.hw.txd and em.hw.rxd against hardware limits [*] and require
them to be multiple of 128.
revision 1.88
date: 2005/11/21 04:17:43; author: yongari; state: Exp; lines: +121 -83
busdma cleanup for em(4).
- don't force busdma to pre-allocate bounce pages for parent tag.
- use system supplied roundup2 macro instead of rolling its own version.
- TX/RX decriptor length should be multiple of 128. There is no
no need to expand the size with the multiple of 4096.
- don't create/destroy DMA maps in TX/RX handlers. Use pre-allocated
DMA maps. Since creating DMA maps on sparc64 is time consuming
operations(resource mananger overhead), this change should boost
performance on sparc64. I could get > 2x speedup on Ultra60.
- TX/RX descriptors could be aligned on 128 boundary. Aligning them
on PAGE_SIZE is waste of resource.
- don't blindly create TX DMA tag with size of MCLBYTES * 8. The size
is only valid under jumbo frame environments. Instead of using the
hardcoded value, re-compute necessary size on the fly.
- RX side bus_dmamap_load_mbuf_sg(9) support.
- remove unused macro EM_ROUNDUP and constant EM_MMBA.
Reviewed by: scottl
Tested by: glebius
revision 1.89
date: 2005/11/24 01:44:48; author: glebius; state: Exp; lines: +131 -77
Merge in new driver version from Intel - 3.2.18.
The most important change is support for adapters based on
82571 and 82572 chips.
Tested on: 82547EI on i386
Tested on: 82540EM on sparc64
revision 1.90
date: 2005/11/24 15:13:47; author: cognet; state: Exp; lines: +3 -1
Remember the bus_dmamap_t where we loaded the mbuf, and sync this map instead
of tx_buffer->map, or we could end up syncing the wrong map.
1. make_index no longer coredumps if input has zero lines.
2. phttpget no longer enters an infinite loop if the TCP connection is
closed while phttpget is reading HTTP headers.
Correct a number of serious and closely related bugs in the UNIX domain
socket file descriptor garbage collection code, which is intended to
detect and clear cycles of orphaned file descriptors that are "in-flight"
in a socket when that socket is closed before they are received. The
algorithm present was both run at poor times (resulting in recursion and
reentrance), and also buggy in the presence of parallelism. In order to
fix these problems, make the following changes:
- When there are in-flight sockets and a UNIX domain socket is destroyed,
asynchronously schedule the garbage collector, rather than running it
synchronously in the current context. This avoids lock order issues
when the garbage collection code reenters the UNIX domain socket code,
avoiding lock order reversals, deadlocks, etc. Run the code
asynchronously in a task queue.
- In the garbage collector, when skipping file descriptors that have
entered a closing state (i.e., have f_count == 0), re-test the FDEFER
flag, and decrement unp_defer. As file descriptors can now transition
to a closed state, while the garbage collector is running, it is no
longer the case that unp_defer will remain an accurate count of
deferred sockets in the mark portion of the GC algorithm. Otherwise,
the garbage collector will loop waiting waiting for unp_defer to reach
zero, which it will never do as it is skipping file descriptors that
were marked in an earlier pass, but now closed.
- Acquire the UNIX domain socket subsystem lock in unp_discard() when
modifying the unp_rights counter, or a read/write race is risked with
other threads also manipulating the counter.
While here:
- Remove #if 0'd code regarding acquiring the socket buffer sleep lock in
the garbage collector, this is not required as we are able to use the
socket buffer receive lock to protect scanning the receive buffer for
in-flight file descriptors on the socket buffer.
- Annotate that the description of the garbage collector implementation
is increasingly inaccurate and needs to be updated.
- Add counters of the number of deferred garbage collections and recycled
file descriptors. This will be removed and is here temporarily for
debugging purposes.
With these changes in place, the unp_passfd regression test now appears
to be passed consistently on UP and SMP systems for extended runs,
whereas before it hung quickly or panicked, depending on which bug was
triggered.
Reported by: Philip Kizer <pckizer at nostrum dot com>
Introduce /etc/rc.d/bluetooth script to start/stop Bluetooth devices. It
will be called from devd(8) in response to device arrival/departure events.
It is also possible to call it by hand to start/stop particular device
without unplugging it.
Introduce generic way to set configuration parameters for Bluetooth devices.
By default /etc/rc.d/bluetooth script has hardwired defaults compatible
with old rc.bluetooth from /usr/share/netgraph/bluetooth/examples. These
can be overridden using /etc/defaults/bluetooth.device.conf file (system
wide defaults). Finally, there could be another device specific override
file located in /etc/bluetooth/$device.conf (where $device is ubt0, btccc0
etc.)
The list of configuration parameters and their meaning described in the
/etc/defaults/bluetooth.device.conf file. Even though Bluetooth device
configuration files are not shell scripts, they must follow basic sh(1) syntax.
Add rc.d scripts for the hcsecd(8) and sdpd(8) daemons. Put defaults into
/etc/defaults/rc.conf. Both daemons can run even if no Bluetooth devices
are attached to the system. Both daemons depend on Bluetooth socket layer.
Fix Bluetooth assigned numbers URL in /etc/bluetooth/protocols file.
MFC revision 1.110
MFC revision 1.109
- Lock the object while traversing the list of it's backing objects
- Use the correct object while calculating offsets
- Conditionally pickup Giant if debug.mpsafevfs == 0 or if the file
system is not marked as being MP safe.
Print (total - used) as the amount of available swap for a swap device
when printing swapinfo output, rather than (total), as that is (strictly
speaking) more accurate.
Pointed out by: Rob <spamrefuse at yahoo dot com>
Modify netstat -mb to use libmemstat when accessing a core dump or live
kernel memory and not using sysctl. Previously, libmemstat was used
only for the live kernel via sysctl paths.
This results in netstat output becoming both more consistent between
core dumps and the live kernel, and also more information in the core
dump case than previously (i.e., mbuf cache information).
Statistics relating to sfbufs still rely on a kvm descriptor as they
are not currently exposed via libmemstat. netstat -m operating on a
core is still unable to print certain sfbuf stats available on the live
kernel.
Begin and end the initialization of pvzone in pmap_init().
Previously, pvzone's initialization was split between pmap_init() and
pmap_init2(). This split initialization was the underlying cause of
some UMA panics during initialization. Specifically, if the UMA boot
pages was exhausted before the pvzone was fully initialized, then UMA,
through no fault of its own, would use an inappropriate back-end
allocator leading to a panic. (Previously, as a workaround, we have
increased the UMA boot pages.) Fortunately, there is no longer any
reason that pvzone's initialization cannot be completed in
pmap_init().
Eliminate a check for whether pv_entry_high_water has been initialized
or not from get_pv_entry(). Since pvzone's initialization is
completed in pmap_init(), this check is no longer needed.
Use cnt.v_page_count, the actual count of available physical pages,
instead of vm_page_array_size to compute the maximum number of pv
entries.
Introduce the vm.pmap.pv_entries tunable on alpha and ia64.
Eliminate some unnecessary white space.
When support for 2MB/4MB pages was added in revision 1.148 an error was
made in pmap_protect(): The pmap's resident count should not be reduced
unless mappings are removed.
The errant change to the pmap's resident count could result in a later
pmap_remove() failing to remove any mappings if the errant change has set
the pmap's resident count to zero.
MFC revision 1.518
Decouple the unrefing of a page table page from the removal of a pv entry.
In other words, change pmap_remove_entry() such that it no longer unrefs
the page table page. Now, it only removes the pv entry.
MFC revision 1.519
Eliminate unneeded diagnostic code.
MFC revision 1.520
Eliminate unneeded diagnostic code.
Eliminate an unused #include. (Kernel stack allocation and deallocation
long ago migrated to the machine-independent code.)
MFC revision 1.521
Simplify the page table page reference counting by pmap_enter()'s change of
mapping case.
Eliminate a stale comment from pmap_enter().
MFC revision 1.522
Correct a performance bug in revision 1.462. The effect of the bug is to
execute the outer loop in procedures such as pmap_protect() many more times
than necessary.
MFC revision 1.523
Introduce pmap_pml4e_to_pdpe() and pmap_pdpe_to_pde() and use them to avoid
recomputation of the pml4e and pdpe in pmap_copy(), pmap_protect(), and
pmap_remove().
MFC revision 1.524
Change pmap_extract() and pmap_extract_and_hold() to use PG_FRAME rather
than ~PDRMASK to extract the physical address of a superpage from a PDE.
The use of ~PDRMASK is problematic if the PDE has PG_NX set. Specifically,
the PG_NX bit will be included in the physical address if ~PDRMASK is used.
MFC revision 1.525
Pass the PDE from pmap_remove() to pmap_remove_page() so that the latter
procedure doesn't have to recompute it.
MFC revision 1.526
Remedy the following three problems:
1. The amd64 pmap, unlike the i386 pmap, maintains a reference count
for each page directory (PD) page. However, in the transformation
of the i386 pmap into the amd64 pmap, operations, such as
pmap_copy() and pmap_object_init_pt(), that create 2MB "superpage"
mappings by setting the PG_PS bit in a PD entry were not modified
to adjust the underlying PD page's reference count. Consequently,
superpage mappings could disappear prematurely.
2. pmap_object_init_pt() could crash or corrupt memory if either the
virtual address range being mapped crosses a 1GB boundary in the
virtual address space or nothing is mapped in the 1GB area.
3. When pmap_allocpte() destroys a 2MB "superpage" mapping it does not
reduce the pmap's resident count accordingly. It should. (This
bug is inherited from i386.)
MFC revision 1.528
Eliminate unnecessary TLB invalidations by pmap_enter(). Specifically,
eliminate TLB invalidations when permissions are relaxed, such as when a
read-only mapping is changed to a read/write mapping. Additionally,
eliminate TLB invalidations when bits that are ignored by the hardware,
such as PG_W ("wired mapping"), are changed.
date: 2005/11/12 11:45:01; author: krion; state: Exp; lines: +9 -2
Add -P flag, it does the same as the -p option, except that the
given prefix is also used recursively for the dependency packages,
if any. If the -P flag appears after any -p flag on the
command line, it overrides it's effect, causing pkg_add to use the
given prefix recursively.
PR: bin/75742
Submitted by: Frerich Raabe <raabe AT kde DOT org>
Add a DDB "show files" command to list the current open file list, some
state about each open file, and identify the first process in the process
table that references the file. This is helpful in debugging leaks of
file descriptors.
Expand the set of details printed for each file descriptor to include
it's garbage collection flags. Reformat generally to make this fit and
leave some room for future expansion.
Add the f_msgcount field to the set of struct file fields printed in show
files.
In closef(), remove the assumption that there is a thread associated
with the file descriptor. When a file descriptor is closed as a result
of garbage collecting a UNIX domain socket, the file descriptor will
not have any associated thread, so the logic to identify advisory locks
held by that thread is not appropriate. Check the thread for NULL to
avoid this scenario. Expand an existing comment to say a bit more about
this.
Replace ktr_buffer pointer in struct ktr_header with a ktr_unused
intptr_t. The buffer length needs to be written to disk as part
of the trace log, but the kernel pointer for the buffer does not.
Add a new ktr_buffer pointer to the kernel-only ktrace request
structure to hold that pointer. This frees up an integer in the
ktrace record format that can be used to hold the threadid,
although older ktrace files will have a garbage ktr_buffer field
(or more accurately, a kernel pointer value).
Space requested by: davidxu
- Pass -i to pwd_mkdb(8) to ignore locking failures. This can be useful
for NFS installing world/kernel to another machine.
- Require that DESTDIR be set before running "make distribution".
o Makefile: 1.319, 1,320
o Makefile.inc1: 1.500, 1.508, 1.509, 1.513, 1.515, 1.517
- Embed the "buildkernels" target into the "universe" target so that
the "make -n universe" output looks more builder (human) friendly.
- Wrap the "universe" target into a ".if make(universe)"; it's only
intended to be called directly so it should be safe to do it.
- Make the `distrib-dirs' target official and working properly
when cross-building (installing). (This is useful for NFS
installing world/kernel to another architecture machine.)
- Remove duplicate settings from LIB32MAKE definition.
- Install lib32 bits using the real install(1) program.
- clean ${LIB32TMP} in _worldtmp
- clean ${OBJTREE}/lib32 in _cleanobj
- ensure that ${WORLDTMP} exists in build32
- Require DESTDIR to be set when cross-installing.
- Force a full Groff upgrade during the build.
When support for 2MB/4MB pages was added in revision 1.148 an error was
made in pmap_protect(): The pmap's resident count should not be reduced
unless mappings are removed.
The errant change to the pmap's resident count could result in a later
pmap_remove() failing to remove any mappings if the errant change has set
the pmap's resident count to zero.
MFC revision 1.526
Decouple the unrefing of a page table page from the removal of a pv entry.
In other words, change pmap_remove_entry() such that it no longer unrefs
the page table page. Now, it only removes the pv entry.
MFC revision 1.527
Eliminate unneeded diagnostic code.
MFC revision 1.528
Eliminate unneeded diagnostic code.
Eliminate an unused #include. (Kernel stack allocation and deallocation
long ago migrated to the machine-independent code.)
MFC revision 1.529
Simplify the page table page reference counting by pmap_enter()'s change of
mapping case.
Eliminate a stale comment from pmap_enter().
MFC revision 1.530
When pmap_allocpte() destroys a 2/4MB "superpage" mapping it does not
reduce the pmap's resident count accordingly. It should.
MFC revision 1.532
Eliminate unnecessary TLB invalidations by pmap_enter(). Specifically,
eliminate TLB invalidations when permissions are relaxed, such as when a
read-only mapping is changed to a read/write mapping. Additionally,
eliminate TLB invalidations when bits that are ignored by the hardware,
such as PG_W ("wired mapping"), are changed.
- Add a work-around for nForce3, ULi, and VIA chipsets. Aperture base
address encoded in misc. control register and AGP bridge seems to be
inconsistent with some BIOSes. Instead of relying on BIOS settings,
we just take the initial aperture size and encode them for both
miscellaneous control register and AGP bridge.
- Add preliminary ULi M1689 chipset support. The idea was taken from Linux
because hardware and documentation are unavailable. Not tested.
- Add one more VIA chipset PCI ID taken from Linux driver.
fixed a bug that uRPF does not work properly for an IPv6 packet bound for the sending machine itself
(this is a bug introduced due to a change in ip6_input.c:Rev.1.81.2.2)
Put probe-time printf of adapter speed and duplex behind bootverbose:
since the link takes a bit to negotiate, the information is pretty
much never available during the probe. As such, the boot output
pretty much always prints N/A for speed and duplex. Since we print
out the output of ifconfig during the user space boot, this early
boot information is also generally redundant, and added to the noise.
ls.c r1.81 and ls.1 r1.92:
date: 2005/11/10 00:02:32; author: mux; state: Exp; lines: +16 -8
Add a -I option to disable the automatic -A flag for the super-user.
ls.1 r1.93:
date: 2005/11/10 14:26:50; author: mux; state: Exp; lines: +2 -1
Mention the non-standardness of the -I option in ls(1).
Consider the zero-copy transmission of a page that was wired by mlock(2).
If a copy-on-write fault occurs on the page, the new copy should inherit
a part of the original page's wire count.
If a physical page is mapped by two or more virtual addresses, transmitted
by the zero-copy sockets method, and written to before the transmission
completes, we need to destroy all of the existing mappings to the page,
not just the one that we fault on. Otherwise, the mappings will no longer
be to the same page and changes made through one of the mappings will not
be visible through the others.
1. phttpget (and thus portsnap) now understands the HTTP_PROXY_AUTH
environment variable and basic HTTP proxy authentication.
2. portsnap.8 now contains a privacy notice.
3. portsnap can now ignore parts of the tree (similar to cvsup
"refuse" directives).
4. portsnap reacts sensibly if host(1) does not exist.
Introduce a new lock for the purpose of synchronizing access to the
UMA boot pages.
Disable recursion on the general UMA lock now that startup_alloc() no
longer uses it.
Eliminate the variable uma_boot_free. It serves no purpose.
Note: This change eliminates a lock-order reversal between a system
map mutex and the UMA lock. See
http://sources.zabbadoz.net/freebsd/lor.html#109 for details.
Attempt to complete the userspace integration of POSIX.1e extended ACLs.
This includes adding support for ACLs into cp(1) and mv(1) userspace
utilities.
For mv(1), if _PC_ACL_EXTENDED is in effect for the source AND destination
operands, the destination file's ACLs shall reflect the source.
For cp(1), if _PC_ACL_EXTENDED is in effect for both source and destination
operands, and -p has been specified, the ACLs from the source shall be
preserved on the destination.
src/sys/fs/devfs/devfs_vnops.c 1.128
src/sys/kern/vfs_subr.c 1.652
This is a workaround for a complicated issue involving VFS cookies and devfs.
The PR and patch have the details. The ultimate fix requires architectural
changes and clarifications to the VFS API, but this will prevent the system
from panicking when someone does "ls /dev" while running in a shell under the
linuxulator.
PR: 88249
Submitted by: "Devon H. O'Dell" <[email protected]>
-style(9) nits
MFC Log:
Fix long standing race condition associated with how lockf uses open(2)
for mutual exclusion:
A brief description of the problem:
1) Proc A picks up non-blocking lock on file X
2) Proc B attempts to pickup lock, fails then waits
3) Proc C attempts to pickup lock, fails then waits
4) Proc A releases lock
5) Proc B acquires lock, release it to pickup a non-blocking version
6) Proc C acquires lock, release it to pickup a non-blocking version
7) Both process B and C race each other to pickup lock again
This occurs mainly because the processes do not keep the lock after they have
been waiting on it. They drop it, attempt to re-acquire it. (They use the wait
to notify when the lock has become available then race to pick it up). This
results in additional CPU utilization during the race, and can also result
in processes picking locks up out of order.
This change attempts to correct this problem by eliminating the test/acquire
race and having the operating system handle it.
Un-break processing of device major/minor values with fstat -n. We do
this by accessing the cdev_priv element of the cdev structure. Looking
forward we need a better way to handle this, as this structure shouldn't
be frobbed by userspace.
Convert the primary ACL allocator from malloc(9) to using a UMA zone instead.
Also introduce an aclinit function which will be used to create the UMA zone
for use by file systems at system start up.
date: 2005/11/08 20:48:26; author: krion; state: Exp; lines: +1 -0
Introduce 3 new options for pkg_create(1), -x for using basic regular
expressions for pkg-name, -E for extended regexps and -G for exact matching.
These new options are only meaningful when using the -b flag of pkg_create(1),
and that the default for the -b parameter is now to do glob matching, as in
other pkg_foo utilities that support package patterns.
Submitted by: mux
> Copy SPRG0-3 registers at boot-time and restore when calling into
> OpenFirmware. FreeBSD/ppc uses SPRG0 as the per-cpu data area pointer,
> and SPRG1-3 as temporary registers during exception handling. There
> have been a few instances where OpenFirmware does require these to
> be part of it's context, such as cd-booting an eMac.
> Finally (!?) get to the bottom of the mysterious G3 boot-time panics.
> After a number of tests using nop's to change the alignment, it was
> confirmed that the mtibat instructions should be cache-aligned.
> FreeScale app note AN2540 indicates that the isync before and after
> the mtdbat is the right thing to do, but sync/isync isn't required
> before the mtibat so it has been removed.
>
> Fix by using a ".balign 32" to pull the code in question to the correct
> alignment.
revision 1.4
date: 2005/11/01 21:16:39; author: trhodes; state: Exp; lines: +0 -6
Quick kill links to the nsmb(8) manual page, there is no such
utility that I can find.
| There is no need to explicitly add "status" to $extra_commands in
| the /etc/rc.d/pf script as it is implicitly added by /etc/rc.subr's
| run_rc_command() because of the existing $pf_program.
|
| Submitted by: Christoph Schug <[email protected]>
Teach vmstat's domemstat_zone() to use memstat_kvm_uma() when the kvm
descriptor is non-NULL, restoring vmstat -z support for core dumps and
kmem access. These were broken with the introduction of UMA.
memstat_malloc:1.6 from HEAD to RELENG_6:
Teach libmemstat(3) how to extract malloc(9) statistics using kvm(3),
so that libmemstat can be used to view full memory statistics from
kernel core dumps and /dev/mem. This is provided via a new query
function, memstat_kvm_malloc(), which is also automatically invoked
by memstat_kvm_all(). A kvm handle must be passed in.
This will allow malloc(9)-specific code to be removed from vmstat(8).
memstat_uma.c:1.10 from HEAD to RELENG_6:
Add memstat_kvm_uma(), an implementation of a libmemstat(3) query routine
that knows how to extract UMA(9) allocator statistics from a core dump or
live memory image using kvm(3). The caller is expected to provide the
necessary kvm_t handle, which is then used by libmemstat(3).
With these changes, it is trivially straight forward to re-introduce
vmstat -z support on core dumps, which was lost when UMA was introduced.
In the short term, this requires including vm/ include files that are not
intended for extra-kernel use, requiring in turn some ugliness.
Merge memstat_uma.c:1.11 from HEAD to RELENG_6:
Define LIBMEMSTAT so that vm_page.h won't perform a nested include of
opt_vmpage.h.
Remove definition of _KERNEL, it is no longer required in order to
include uma_int.h, as the sensitive parts of uma_int.h (a number of
inlines depending on kernel-only constants) are now protected by
_KERNEL.
The use of LIBMEMSTAT here will be cleaned up in the future.
- Use if_printf() and device_printf() and remove vr_unit from the softc.
I had to initialize the ifnet a bit earlier in attach so that the
if_printf()'s in vr_reset() didn't explode with a page fault.
- Use M_ZERO with contigmalloc() rather than an explicit bzero.
- Use callout_*() to manage the callout and make it MPSAFE.
- Fix locking in detach(), we only need to lock across vr_stop().
is an instant MFC as it was actually tested on 5.x and 6.x. Note that like
the change to HEAD, this renames the devices, and there is no easy way on
6.x to create compatibility names in the kernel.
Reviewed by: phk
Tested by: Jim Pazarena paz at qcislands dot net
Add a "show malloc" command to DDB, which prints out the current stats for
available kernel malloc types. Quite useful for post-mortem debugging of
memory leaks without a dump device configured on a panicked box.
Add a "show uma" command to DDB, which prints out the current stats for
available UMA zones. Quite useful for post-mortem debugging of memory
leaks without a dump device configured on a panicked box.
- Support for command -v and -V.
- Fixes for the errexit option.
- A fix for a crash caused by SIGINT.
- POSIX compliant set +o ouput.
- A fix for unalias' exit code.
- Man page updates.
- Code cleanups, WARNS 3.
- Enforce an implicit lock order that Giant cannot be locked while holding
any other non-sleepable lock. In plain English: Giant comes before all
other mutexes.
- Add some extra description to the lock order reversal printf's to indicate
when a reversal is triggered by a hard-coded implicit rule.
- disable IPv6 operation if DAD fails for some EUI-64 link-local addresses.
- export get_hw_ifid() (and rename it) as a subroutine for this process.
Revision Changes Path
1.30 +5 -6 src/sys/netinet6/in6_ifattach.c
1.6 +1 -0 src/sys/netinet6/in6_ifattach.h
1.36 +39 -2 src/sys/netinet6/nd6_nbr.c
- pmcstat(8) 32-bit executables handling problem on FreeBSD/amd64[1],
- boot-time panic on some PowerMac G4 systems[2], and
- incompatible change of LC_* in 6.0-RELEASE and misc/compat5x.
Submitted by: jkoshy[1], grehan[2]
than 8 entries in the 0xe821 map. This includes things like ACPI
exclusion zones, memory segments and recoverable memory segments after
the kernel has booted.
one worried too much even though we actually validate the parameters.
This code also is more compatible with other *BSDs, which do copyin
within setsockopt().
- most of the kernel code will not care about the actual encoding of
scope zone IDs and won't touch "s6_addr16[1]" directly.
- similarly, most of the kernel code will not care about link-local
scoped addresses as a special case.
- scope boundary check will be stricter. For example, the current
*BSD code allows a packet with src=::1 and dst=(some global IPv6
address) to be sent outside of the node, if the application do:
s = socket(AF_INET6);
bind(s, "::1");
sendto(s, some_global_IPv6_addr);
This is clearly wrong, since ::1 is only meaningful within a single
node, but the current implementation of the *BSD kernel cannot
reject this attempt.
sys/net/if_gif.c: 1.53
sys/net/if_spppsubr.c: 1.120
sys/netinet/icmp6.h: 1.19
sys/netinet/ip_carp.c: 1.28,1.29
sys/netinet/ip_fw2.c: 1.107
sys/netinet/tcp_subr.c: 1.230,1.231,1.235
sys/netinet/tcp_usrreq.c: 1.125
sys/netinet6/ah_core.c: 1.26
sys/netinet6/icmp6.c: 1.63,1.64
sys/netinet6/in6.c: 1.52
sys/netinet6/in6.h: 1.38
sys/netinet6/in6_cksum.c: 1.11
sys/netinet6/in6_ifattach.c: 1.27
sys/netinet6/in6_pcb.c: 1.63
sys/netinet6/in6_proto.c: 1.33
sys/netinet6/in6_src.c: 1.31,1.32
sys/netinet6/in6_var.h: 1.22
sys/netinet6/ip6_forward.c: 1.29
sys/netinet6/ip6_input.c: 1.83
sys/netinet6/ip6_mroute.c: 1.30
sys/netinet6/ip6_output.c: 1.95
sys/netinet6/ip6_var.h: 1.33
sys/netinet6/ipsec.c: 1.43
sys/netinet6/mld6.c: 1.21
sys/netinet6/nd6.c: 1.50
sys/netinet6/nd6_nbr.c: 1.30
sys/netinet6/nd6_rtr.c: 1.27
sys/netinet6/raw_ip6.c: 1.54
sys/netinet6/route6.c: 1.12
sys/netinet6/scope6.c: 1.13,1.14,1.15
sys/netinet6/scope6_var.h: 1.5
sys/netinet6/udp6_output.c: 1.23
sys/netinet6/udp6_usrreq.c: 1.55
sys/netkey/key.c: 1.72,1.73
in6p_outputopts at the entrance of the functions. this trick was
necessary when we passed an in6 pcb to in6_embedscope(), within which
the in6p_outputopts member was used, but we do not use this kind of
interface any more.
sys/netinet6/raw_ip6.c: 1.52
sys/netinet6/udp6_output.c: 1.21
| Fix parsing of mdmfs(8) option "-w <user>:<group>" in case <user> or
| <group> is a numeric user/group ID instead of a user/group name (as
| explicitly intended to be allowed by both the manual page and the
| implementation).
|
| Before this fix, mdmfs(8) aborted:
|
| | # mdmfs -s 32m -w 0:0 md /var/tmp/foo
| | Assertion failed: (mip->mi_have_uid), function extract_ugid, file /usr/src/sbin/mdmfs/mdmfs.c, line 555.
| | Abort trap (core dumped)
|
| The "mi_have_[ug]id" fields were only set in case a name lookup was
| successful. Instead they also have to be set in case the string to
| integer conversion was successful.
|
| Additionally, as a result of this fix, two assertions at the end of
| the function are now always true and hence can be just be removed. It
| is guarrantied that both the UID and the GID are set when the function
| returns regularily, else it would have been already bailed out with
| usage()/exit(3) or errx(3) before.
|
| Spotted by: Christoph Schug <[email protected]>
- First fill in structure with valid values, and only then attach it
to the global list.
- In in_addprefix() compare not only route addresses, but their masks,
too. This fixes problem when connected prefixes overlap.
- When flushing node input queue, check whether item has a callback. If
it does, then call it suppling ENOENT as error value.
- Add assert, that helped to catch the above error.
Fix an unaligned I/O memory access in the event that a SCB times out.
The FXP_SCR_FLOWCONTROL registers is at offset 0x19, but 2 bytes wide.
It cannot be read as a word without causing a panic on architectures
that enforce strict alignment.
> date: 2005/11/03 00:23:13; author: kensmith; state: Exp; lines: +1 -6
> It had been noticed disc2 was overflowing earlier but committing the
> fix slipped through a crack. Remove the apache and php packages under
> the assumption someone installing a Web server has network access and
> doesn't *need* the packages on disc2.
Approved by: re (scottl)
date: 2005/10/10 12:35:30; author: krion; state: Exp; lines: +9 -4
* pkg_version(1) exits if INDEX files is not found and -I is not
specified. The result is that the package will be listed with a '?'
as if it was not found within the INDEX file, so fix this behaviour.
* Remove trailing spaces.
PR: bin/87136
Submitted by: Sean Farley <sean-freebsd at farley dot org>
Approved by: re
Fix pkg_info(1) and pkg_delete(1) to handle properly packages which
names start with a digit.
PR: bin/76858
Submitted by: Matthew D. Fuller <fullermd@over-yonder dot net>
Approved by: re
"firewire" to "if_firewire." According to the PR originator and Cai's
test, this bug prevents a RELENG_6 GENERIC kernel from loading if_fwip.ko
and will panic the kernel if users compile "device fwip" into their
GENERIC kernel.
Approved by: re (scottl)
memory for request.
I was sure graid3 should handle such situations well, but green@ reported
it is not and we want to fix it before 6.0.
Submitted by: green
Approved by: re (scottl)
- Add -V option to dump version.
- Implicitly include DEFAULTS if it exists in the current directory before
the specified kernel config.
Approved by: re (scottl)
kern/87959 cracauer ext2fs: no cp(1) possible, mmap returns EINVAL
ext2fs was missing vnode_create_vobject.
(Reisefs probably has the same problem but I want to get this in quick
for 6-release)
releng-6 branches commits approved by Scott Long.
Approved by: re
Specifically panic() in the case where pmap_insert_entry() fails to
get a new pv under high system load where the available pv entries
have been exhausted before the pagedaemon has a chance to wake up
to reclaim some.
Approved by: re (scottl)
- Mention that this is -STABLE
- Mention that only 5.3+ is supported for source upgrade
- When just building a kernel we assume that the user got a
system that is fresh enough
- The in-place update is supported for 5.x-STABLE and 6.x-STABLE
- Since we don't support systems that is prior to 5.3, don't
mention about mergemaster three years before.
- Since source upgrade from 4.x is no longer supported, we
are supposed that COMPAT_FREEBSD5X is better suited for the
source upgrade
- At the end, call this a -STABLE
Approved by: re (scottl)
Only set B_RAM (Read ahead mark) on an incore buffers if we can lock it.
This fixes a race condition caused by the unlocked write access to the
b_flags field.
Approved by: re (scottl)
> The BCM5401 dspcode load on media changes also applies
> to the 100/1000 BCM5400 phy. This fixes the problem with
> the GEM port not syncing up on Sawtooth G4's.
>
> Obtained from: NetBSD
> Reported by: Ben Rosengart <ben + freebsd org at narcissus net>
Approved by: re (scottl)
work. The code comment describes the issue, basically an as yet not
totally understood interrupt routing problem. This hack is being done
to RELENG_6 so that the hme interface works on E250's for the release,
but is not being done in HEAD so more work on the interrupt routing
issue can be done.
Requested by: marius
Approved by: re (scottl)
> If we have been called from ether_ifdetach() then do not try and clear the
> promisc flag from the member interface, this is a no-op anyway since the
> interface is disappearing. The driver may have already released
> its resources such as miibus and this is likely to panic the kernel.
Approved by: re (scottl)
- Fix leak of struct nlminfo on process exit.
- Fix malloc type collision, that made the above problem
difficult to understand.
Reported by: Vladimir Sharun <sharun ukr.net>
Approved by: re (scottl)
Enclose the delayed attach in Giant so we dont loose the race with other
drivers trying to attach ATA devices like pccard.
Dont clear the delayed flag before we are acutally finished.
Approved by: re@ (scottl)
capabilities. This solve various mysterious slowdown especially
for fixed-rate ac97 soundcards.
Approved by: re (scottl), netchild (mentor)
Reviewed by: andreas
state and destroy it before anything else. This solve panic issue
during sound module unloading if the sound / mixer device being
held by external processes.
Approved by: re (scottl), netchild (mentor)
Reviewed by: andreas
cause a kernel compiled with ZERO_COPY_SOCKETS to panic under certain
circumstances:
sys/kern/uipc_cow.c: 1.24 - 1.26
sys/vm/vm_object.c: 1.351
Approved by: re (scottl)
Mempage size needs to be 1k rather than 4k. Prior versions of FreeBSD
used this value and it was recently increased to 4k. This broke the
two 16-bit card at boot scenario. Revert it back to 1k.
Approved by: re (scottl)
by default, to match the reality that these has been turned off on
the 6-STABLE branch since 6.0-BETA6.
This is a direct commit against RELENG_6 since it is not applicable
for HEAD.
Approved by: re (scottl)
- rev. 1.76. Removed FreeBSD 4.x code.
- rev. 1.77, 1.79. Together with rev. 1.71 (already merged) this
fixes problems when some code is executed in driver when
em_process_receive_interrupts() drops lock. This can occur
at runtime, when polling(4) mode is changed to interrupt driver
or vise versa, but more likely this can happen when administrator
issues some ifconfig commands.
- rev. 1.78. In em_process_receive_interrupts(), call bus_dmamap_sync()
for the descriptors set each time we modify one descriptor, instead
of doing it only at the function exit.
- rev. 1.80. Loop in em_intr() until interrupt cause register is clear,
don't mask overrun interrupt.
- rev. 1.81. Several locking and other fixes.
See particular revision logs for more detailed information.
Approved by: re
Rev: 1.261
Ensure that a thread stays on same CPU when calculating per CPU
TLB shootdown requirements. Otherwise a CPU may not get the needed
TLB invalidation.
The PTE valid and access flags can not be used here to avoid TLB
shootdowns unless sf->cpumask == all_cpus.
( Otherwise some CPUs may still hold an even older entry in the TLB)
Since sf_buf_alloc mappings are normally always used this is
also not really useful and presetting accessed and modified
allows the CPU to speculatively load the entry into the TLB.
Both bugs can cause random data corruption.
Rev: 1.262
Restore optimizations to reduce TLB shootdowns.
Alan Cox pointed out that they are really useful for
sendfile().
Rev: 1.263
Restore the UP optimization to reduce the number of TLB
invalidations. The
previous revision only restored the MP optimization.
Describe the optimization strategy for TLB invalidations in a comment.
Approved by: re@ (scottl)
> Use bridge_ifdetach() to notify the bridge that a member has been detached.
> The bridge can then remove it from its interface list and not try to send
> out via a dead pointer.
Approved by: re (scottl)
Original commit messages:
Modified files:
sys/ufs/ufs ufs_lookup.c
Log:
Close a race in the ufs_lookup() code that handles the ISDOTDOT
case by saving the value of dp->i_ino before unlocking the vnode
for the current directory and passing the saved value to VFS_VGET().
Without this change, another thread can overwrite dp->i_ino after
the current directory is unlocked, causing ufs_lookup() to lock
and return the wrong vnode in place of the vnode for its parent
directory. A deadlock can occur if dp->i_ino was changed to a
subdirectory of the current directory because the root to leaf vnode
lock ordering will be violated. A vnode lock can be leaked if
dp->i_ino was changed to point to the current directory, which
causes the current vnode lock for the current directory to be
recursed, which confuses lookup() into calling vrele() when it
should be calling vput().
The probability of this bug being triggered seems to be quite low
unless the sysctl variable debug.vfscache is set to 0.
Reviewed by: jhb
MFC after: 2 weeks
Revision Changes Path
1.78 +3 -1 src/sys/ufs/ufs/ufs_lookup.c
Modified files:
sys/ufs/ufs ufs_lookup.c
Log:
Correct the type of the temporary variable used by ufs_lookup.c:1.78
to fix the race condition in the ufs_lookup() ISDOTDOT code.
Noticed by: bde
MFC after: 12 days
Revision Changes Path
1.79 +1 -1 src/sys/ufs/ufs/ufs_lookup.c
Approved by: re (scottl)
Original commit message:
Modified files:
sys/fs/nwfs nwfs_vnops.c
Log:
Update nwfs_lookup() to match the current cache_lookup() API.
cache_lookup() has returned a ref'ed and locked vnode since
vfs_cache.c:1.96, dated Tue Mar 29 12:59:06 2005 UTC. This change
is similar to the change made to smbfs_lookup() in smbfs_vnops.c:1.58.
Tested by: "Antony Mawer" ant AT mawer.org
MFC after: 2 weeks
Revision Changes Path
1.42 +11 -26 src/sys/fs/nwfs/nwfs_vnops.c
Approved by: re (scottl)
> imp 2005-10-13 22:06:02 UTC
> Modified files:
> sys/dev/ed if_ed_rtl80x9.c
> Log:
> o Fix probing of rtl80x9 parts. We shouldn't be calling
> ed_probe_generic8390 where we're calling it. It will be done as part
> of ed_probe_Novel_generic after things are setup in a way that
> ed_probe_generic8390 will grok.
> o Fix operator precedence botch that causes a panic when setting the media
> type for 10baseT connections.
> o Save the type of device so that it prints with the rest of the probe.
>
> # this should make it work with qemu again, but only if it has my patches
> # to actually implement the RTL8029 specific registers.
> Revision Changes Path
> 1.2 +6 -5 src/sys/dev/ed/if_ed_rtl80x9.c
>
> Modified files:
> sys/dev/ed if_ed_pci.c
> Log:
> If we can't probe the RTL80x9 for some reason, fall back to probing it
> as a Novell NE-2000. This is necessary for unpatched qemu working
> correctly. qemu claims to be a RTL8029, but doesn't implement the
> RTL8029 specific registers at this time. I've created patches for
> that, but there's no reason we can't use qemu's emulation w/o these
> patches. This should make life easier for those folks that boot
> FreeBSD via qemu.
> Revision Changes Path
> 1.48 +9 -2 src/sys/dev/ed/if_ed_pci.c
Approved by: re@ (kensmith)
Add a default value for VM_BCACHE_SIZE_MAX of 400MB. This is copied from
amd64, and is a factor of 3 less than the value previously auto-sized on
a 12GB machine, which would cause an overflow in calculations involving the
maxbcache int, causing bufinit() to loop forever at boot.
Approved by: re (kensmith)
When performing a VOP_LOOKUP() as part of UFS1 extended attribute
auto-start, set cnp.cn_lkflags to LK_EXCLUSIVE. This flag must now
be set so that lockmgr knows what kind of lock to acquire, and it
will panic if not specified. This resulted in a panic when using
extended attributes on UFS1 as of locking work present in the 6.x
branch.
This is a RELENG_6_0 merge candidate.
Reported by: lofi
Approved by: re (kensmith)
MFC after: 1 day
Acquire Giant conditionally in in_addmulti() and in_delmulti() based on
whether the interface being accessed is IFF_NEEDSGIANT or not. This
avoids lock order reversals when calling into the interface ioctl
handler, which could potentially lead to deadlock.
The long term solution is to eliminate non-MPSAFE network drivers.
Discussed with: jhb
Unlock Giant symmetrically with respect to lock acquire order as that's
generally nicer.
Spotted by: johan
RELENG_6_0 candidate.
MFC after: 1 day
Approved by: re (kensmith)
| Correct bug that caused the completed "recovery" scb to have its
| timer reset rather than the timer of an SCB still pending on the
| controller after recovery completed. This should correct timeout
| loops seen in the field.
|
| Revision Changes Path
| 1.22 +2 -1 src/sys/dev/aic7xxx/aic79xx_osm.c
| 1.43 +2 -1 src/sys/dev/aic7xxx/aic7xxx_osm.c
Approved by: re (kensmith)
The RIAD5 code is not complete, it does not use nor maintain the parity, so
it does actually only do RAID0. This is not wanted for a production release.
Approved by: re@ (scottl)
When breaking up a large request into smaller ones for the strategy
routine, create all the child bio objects before starting the
requests, rather than starting them as created. This closes a race
whereby some number of child operations could complete before the
rest were ever created, and prematurely freeing the parent bio.
This fixes the panics installing in VMWare and qemu
Approved by: re (scottl@)
> revision 1.277
> date: 2005/10/03 12:49:54; author: cperciva; state: Exp; lines: +8 -0
> If sufficiently bad things happen during a call to kern_execve(), it is
> possible for do_execve() to call exit1() rather than returning. As a
> result, the sequence "allocate memory; call kern_execve; free memory"
> can end up leaking memory.
>
> This commit documents this astonishing behaviour and adds a call to
> exec_free_args() before the exit1() call in do_execve(). Since all
> the users of kern_execve() in the tree use exec_free_args() to free
> the command-line arguments after kern_execve() returns, this should
> be safe, and it fixes the memory leak which can otherwise occur.
>
> Submitted by: Peter Holm
> MFC after: 3 days
> Security: Local denial of service
Approved by: re (scottl)
----------------------------
revision 1.281
date: 2005/10/04 16:27:54; author: rik; state: Exp; lines: +3 -1
Use FILEDESC_UNLOCK(fdp) after FILE_UNLOCK(p), not before to avoid LOR.
Slightly discussed on current@.
LOR #055
Approved by: re(scottl)
Requested by: delphij
they need special handling. makes it possible to take advantage of 9k ether
frames.
Approved by: re (scottl)
Committed at: CBUG Meeting meets XCAST6 Festival
| Set the G_PF_WITHER flag on the subdisk provider that is about to
| be destroyed. That way the GEOM system handles all deallocations
| and we don't have to do it ourselves.
|
| Revision Changes Path
| 1.8 +1 -34 src/sys/geom/vinum/geom_vinum_rm.c
Approved by: re (scottl)
| Prevent that sync operations can be started when they are already
| in progress, and be a bit more user friendly in terms of error
| messages returned from the kernel.
|
| Revision Changes Path
| 1.11 +81 -71 src/sys/geom/vinum/geom_vinum_init.c
Approved by: re (scottl)
| Correct the check if a plex is accessible in case it is not up.
| This makes degraded RAID5 plexes actually work.
|
| Revision Changes Path
| 1.10 +1 -1 src/sys/geom/vinum/geom_vinum_volume.cle
Approved by: re (scottl)
| Shuffle around the order in which the components are compiled.
|
| This way, the VINUMDRIVE class is loaded before the VINUM class,
| but since geom does the tasting for newly arrived classes
| last-in-first-out, the VINUM class tastes first.
|
| This removes the need to call gv_parse_config() in the drive
| taste path.
|
| Revision Changes Path
| 1.20 +4 -14 src/sys/geom/vinum/geom_vinum_drive.c
| 1.2 +1 -1 src/sys/modules/geom/geom_vinum/Makefile
Approved by: re (scottl)
| - Add an assertion to panic if one tries to call mtx_trylock() on a spin
| mutex.
| - Don't panic if a spin lock is held too long inside _mtx_lock_spin() if
| panicstr is set (meaning that we are already in a panic). Just keep
| spinning forever instead.
|
| Revision Changes Path
| 1.157 +4 -1 src/sys/kern/kern_mutex.c
Approved by: re (scottl)
| Test the mbuf flags against the correct constant. The previous
| version worked as intended but only by chance.
|
| MT_HEADER == M_PKTHDR == 0x2.
|
| Revision Changes Path
| 1.85 +1 -1 src/sys/compat/ndis/kern_ndis.c
Approved by: re (scottl)
| Ensure the full value is written into inode variables.
|
| PR: 85503
| Submitted by: Dmitry Pryanishnikov <[email protected]>
|
| Revision Changes Path
| 1.89 +2 -2 src/sys/fs/msdosfs/msdosfs_denode.c
Approved by: re (scottl)
| Reorder statements to avoid accessing unknown memory.
| In theory, invoking kenv with very long string can panic
| kernel.
|
| Revision Changes Path
| 1.41 +2 -2 src/sys/kern/kern_environment.c
Approved by: re (scottl)
| Fixes for NFS crashes on architectures that require strict alignment.
| - Fix nfsm_disct() so that after pulling up data, the remaining data
| is aligned if necessary.
| - Fix nfs_clnt_tcp_soupcall() to bcopy() the rpc length out of the
| mbuf (instead of casting m_data to a uint32).
|
| Submitted by: Pyun YongHyeon
| Reviewed by: Mohan Srinivasan
|
| Revision Changes Path
| 1.118 +12 -3 src/sys/nfs/nfs_common.c
| 1.38 +6 -0 src/sys/nfs/nfs_common.h
| 1.126 +2 -1 src/sys/nfsclient/nfs_socket.c
Approved by: re (scottl)
| In nfs_nget() if two threads race on the same filehandle, the loser
| should cause the nfsnode to get freed. This fixes a potential vnode
| (and nfsnode) leak in that path.
|
| Submitted by: Mohan Srinivasan
| Reviewed by: phk
|
| Revision Changes Path
| 1.78 +2 -1 src/sys/nfsclient/nfs_node.c
Approved by: re (scottl)
| Remove bogous semicolons at the end of the definitions of
| 'do { ... } while (0)' macros.
|
| PR: kern/83088
| Sumbitted by: <antoine.brodin at laposte.net>
Approved by: re (scottl)
Fix so that when a slice or a partition is removed through g_slice_config(),
it is destroyed in GEOM, in addition to being removed from /dev.
Before this patch, if you applied a new MBR which deleted a slice,
the deleted slice would not be in /dev, but it would still appear
in kern.geom.conftxt and kern.geom.confxml, which would confused
the diskPartitionEditor in sysinstall.
Submitted by: pjd
Requested by: delphij
Approved by: re (scottl)
Display the status of the spanning tree for each port.
member: xl0 flags=7<LEARNING,DISCOVER,STP>
member: gem0 flags=7<LEARNING,DISCOVER,STP>
to:
member: xl0 flags=7<LEARNING,DISCOVER,STP>
port 3 priority 128 path cost 55 forwarding
member: gem0 flags=7<LEARNING,DISCOVER,STP>
port 1 priority 128 path cost 55 learning
Approved by: re (scottl)
ISA/PCI chipset (RTL8019 and RTL8029). Eliminate ED_NO_MIIBUS option.
You are now required to have miibus if you have pccard in your kernel
(but not required if you don't!). Split out register definitions for
possible future subsetting.
Approved by: re@ (scottl)
| Add a cancellation point for usleep().
|
| While here, fix sleep() so that it is also a cancellation point (a
| missing weak reference prevented that).
|
| Revision Changes Path
| 1.10 +19 -0 src/lib/libthr/thread/thr_syscalls.c
Approved by: re (kensmith)
Ok'ed by: deischen, davidxu
| Make syslog() use the internal (non-cancellation point) _usleep().
| Prior to this it was calling the cancellable usleep() while holding
| a lock.
|
| Revision Changes Path
| 1.36 +1 -1 src/lib/libc/gen/syslog.c
Approved by: re (kensmith)
Ok'ed by: deischen, davidxu
| Make usleep() overridable by the thread libraries so they can provide
| cancellation points.
|
| Noticed by: phk
|
| Revision Changes Path
| 1.29 +4 -1 src/lib/libc/gen/usleep.c
Approved by: re (kensmith)
Ok'ed by: deischen, davidxu
| Add a short description of how a literal colon ':' can be inlined in the
| value of capability databases, since it's not really obvious how a colon
| can be escaped, and a pointer to the getcap(3) manpage for more details.
|
| Triggered by: a question by Ceri on -questions
Approved by: re (kensmith)
mp_ncpus is always (properly) initialized, even on UP kernels,
so just use it.
Approved by: re (scottl) (approval from 30 Aug 2005)
Reminded by: delphij
Add an rc.d script to start the pfsync interface after all
the conventional network interfaces have been started so that
pfsync can be attached to any of the latter.
Record the dependency of rc.d/pf on the newly added rc.d/pfsync.
Also make rc.d/pf start as early as before rc.d/routing to improve
system security.
Document rc.d/pfsync on pfsync(4) and rc.conf(5).
Approved by: re (scottl), mlaier
Add support for setting the SG list segment size.
Use this for the SiI3112 workaround to get rid of the "oversized DMA" errors.
Approved by: re@ (scottl)
Don't print anything if we can't do any localpkg shutdown (start already
does this).
Submitted by: Andre Albsmeier <Andre dot Albsmeier at siemens dot com>
PR: conf/86606
Approved by: re (kensmith)
Define HAVE_KERNEL_OPTION_HEADERS when building kernel and when building
modules along with kernel.
After this change it is possible to embrace opt_*.h includes with ifdef
HAVE_KERNEL_OPTION_HEADERS. And thus, avoid editing a lot of Makefiles
in modules directory each time we introduce a new opt_xxx.h.
Requested by: bde
Approved by: re (kensmith)
When bridging is enabled and an ARP request is recieved on a member interface,
the arp code will search all local interfaces for a match. This triggers a
kernel log if the bridge has been assigned an address.
arp: ac:de:48:18:83:3d is using my IP address 192.168.0.142!
bridge0: flags=8041<UP,RUNNING,MULTICAST> mtu 1500
inet 192.168.0.142 netmask 0xffffff00
ether ac:de:48:18:83:3d
Silence this warning for 6.0 to stop unnecessary bug reports, the code will need
to be reworked.
Approved by: re (scottl)
> Do not packet filter in the bridge_start() routine, locally generated packets
> are already filtered by the higher layers.
Approved by: re (kensmith)
- Use if_printf() and device_printf().
- Don't zero the softc.
- Cleanup error handling in attach().
- Don't double init the callout handle.
Approved by: re (scottl)
| Two minor optimizations of fdalloc():
|
| - if minfd < fd_freefile (as is most often the case, since minfd is
| usually 0), set it to fd_freefile.
|
| - remove a call to fd_first_free() which duplicates work already done
| by fdused().
|
| This change results in a small but measurable speedup for processes
| with large numbers (several thousands) of open files.
|
| PR: kern/85176
| Submitted by: Divacky Roman <[email protected]>
|
| Revision Changes Path
| 1.280 +3 -1 src/sys/kern/kern_descrip.c
Approved by: re
| Eliminate an unneeded reference on a vm object. If, in fact, the nearby
| vm_map_find() fails, then the excess reference causes the vm object to be
| leaked.
|
| Reviewed by: tegge
|
| Revision Changes Path
| 1.83 +0 -2 src/sys/kern/link_elf.c
| 1.88 +0 -2 src/sys/kern/link_elf_obj.c
Approved by: re (scottl)
| Revert the previous change for two reasons: (1) If vm_map_find() succeeds
| but vm_map_wire() fails, then a vm object, vm map entries, and kernel_map
| free space is leaked and (2) unwiring is handled automatically by
| vm_map_remove().
|
| Suggested by: tegge
|
| Revision Changes Path
| 1.82 +10 -17 src/sys/kern/link_elf.c
Approved by: re (scottl)
The major change here is the support for amd64, as well as possible
support for PAE. Many thanks to Highpoint for continuing to support
FreeBSD.
Obtained from: Steve Chang @ Highpoint
Merged revisions:
| 1.3 dev/hptmv/access601.h
| 1.1 dev/hptmv/amd64-elf.raid.o.uu
| 1.3 dev/hptmv/array.h
| 1.3 dev/hptmv/atapi.h
| 1.3 dev/hptmv/command.h
| 1.9+1.10 dev/hptmv/entry.c
| 1.4 dev/hptmv/global.h
| 1.5 dev/hptmv/gui_lib.c
| 1.3 dev/hptmv/hptintf.h
| 1.6 dev/hptmv/hptproc.c
| 1.5 dev/hptmv/i386-elf.raid.o.uu
| 1.5 dev/hptmv/ioctl.c
| 1.3 dev/hptmv/mv.c
| 1.4 dev/hptmv/mvOs.h
| 1.3 dev/hptmv/mvSata.h
| 1.4 dev/hptmv/mvStorageDev.h
| 1.5 dev/hptmv/osbsd.h
| 1.3 dev/hptmv/raid5n.h
| 1.3 dev/hptmv/readme.txt
| 1.3 dev/hptmv/vdevice.h
| 1.4 modules/hptmv/Makefile
Approved by: re (scottl)
| The resource_xxx routines in subr_hints.c are called before and after the
| kenv environment in kern_environment.c switches to dynamic kenv. The prior
| call sets the static variable hintp to the static hints in subr_hints.c
| (hintmode==0).
|
| However, changes to the environment are not detected by the resource_xxx
| lookups after the change to dynamic kernel environment, so the lookup
| routines only report the old stuff of hintmode==0, even after the change to
| the dynamic kenv. This causes kenv users to see a different environment than
| the kernel routines.
|
| This is a problem in the mixer.c code that looks up initial mixer volume
| settings from the hints: If the hints are dynamic and not from the
| device.hints file, mixer.c doesn't see them, but kenv does.
|
| The patch from the PR (modified to comply to the style of the function)
| solves this.
|
| PR: 83686
| Submitted by: Harry Coin <[email protected]>
Approved by: re (scottl)
| In ext2_mountfs(), check that the superblock size, SBSIZE,
| is aligned with the sectorsize value returned by GEOM, before
| doing a bread() of the superblock.
| This eliminates a panic when trying the following on an empty CD-ROM drive:
| mount_ext2fs /dev/acd0 /mnt
|
| Reviewed by: phk
|
| Revision Changes Path
| 1.154 +12 -0 src/sys/gnu/fs/ext2fs/ext2_vfsops.c
Approved by: re (scottl)
Add a note in example as well, that last sector is used for metadata,
so it don't provoke confusions.
Noticed by: Victor Sudakov <[email protected]>
Approved by: re (scottl)
Add a __packed keyword to g_eli_metadata struct definition, so
sizeof(struct g_eli_metadata) will return the exact number of bytes needed
for storing it on the disk.
Without this change GELI was unusable on amd64 (and probably other 64-bit
archs), because sizeof(struct g_eli_metadata) was greater than 512 bytes
and geli(8) was failing on assertion.
Reported by: Michael Reifenberger <[email protected]>
Reminded by: delphij
Approved by: re (scottl)
Don't pretend to be thread0 when calling sync().
It confuses the lock manager since in some places thread0 is
then used for vnode locking while curthread is used for vnode unlocking.
Approved by: re (scottl@)
ifconfig.c 1.116
For the sake of consistency and easier typing,
introduce "-tunnel" as an alias for "deletetunnel".
The latter is overly long and prone to typos, but
keep it for POLA since it costs nothing.
ifvlan.c 1.8
Deprecate the useless argument to -vlandev.
ifconfig.8 1.102-1.105
Document the above changes.
Logically group vlan- and tunnel-related parameters.
Approved by: re (scottl)
Add a DDB "traceall" function, which stack traces all known process
threads. This is quite useful if generating a debug log for post-mortem
by another developer, in which case the person at the console may not
know which threads are of interest. The output of this can be quite
long.
Discussed with: kris
Approved by: re (scottl)
- In gem_ioctl() move the call to ether_ioctl() to the default case of
the switch statement in order to make this driver more like other
Ethernet NIC drivers.
- In gem_attach() call gem_stop() in addition to gem_reset() to make
sure the chip actually is stopped and not just reset.
- In gem_stop() also stop the gem_rint_timeout() callout in case the
driver is compiled with GEM_RINT_TIMEOUT defined.
- Remove NOP spl*() calls and add locking (making gem(4) MPSAFE).
This MFC actually brings the RELENG_6 gem(4) in line with HEAD which
means that it additionally includes a comment update regarding the
IFF_OACTIVE -> IFF_DRV_OACTIVE rename which was part of if_gem.c 1.33
but missed in the respective MFC in 1.29.2.2.
Requested by: thompsa
Approved by: re (scottl)
ofw_syscons.c 1.9, s3_pci.c 1.10, scgfbrndr.c 1.23, scmouse.c 1.40,
scvgarndr.c 1.20, scvidctl.c 1.37, syscons.c 1.439, syscons.h 1.85,
tga.c 1.8, vesa.c 1.52, vga.c 1.35
Add a font width argument to vi_load_font_t, vi_save_font_t and vi_putm_t
and do some preparations for handling 12x22 fonts (currently lots of code
implies and/or hardcodes a font width of 8 pixels). This will be required
on sparc64 which uses a default font size of 12x22 in order to add font
loading and saving support as well as to use a syscons(4)-supplied mouse
pointer image.
Approved by: re (scottl)
Rename net.isr.enable to net.isr.direct.
No compatibility code is provided, as this will be the production name
as of 6.0. Previously this has been an experimental and unsupported
feature.
Requested by: scottl
Approved by: re (kensmith)
mac_lomac.c:1.37, mac_mls.c:1.74, mac_stub.c:1.55, mac_test.c:1.62,
mac.h:1.69, mac_policy.h:1.70 from HEAD to RELENG_6:
Remove mac_create_root_mount() and mpo_create_root_mount(), which
provided access to the root file system before the start of the
init process. This was used briefly by SEBSD before it knew about
preloading data in the loader, and using that method to gain
access to data earlier results in fewer inconsistencies in the
approach. Policy modules still have access to the root file system
creation event through the mac_create_mount() entry point.
Removed now, and will be removed from RELENG_6, in order to gain
third party policy dependencies on the entry point for the lifetime
of the 6.x branch.
Obtained from: TrustedBSD Project
Submitted by: Chris Vance <Christopher dot Vance at SPARTA dot com>
Approved by: re (scottl)
Original commit message:
FreeBSD src repository
Modified files:
sys/kern kern_proc.c
Log:
Always wire the sysctl output buffer in sysctl_kern_proc() before
calling sysctl_out_proc(). -- fix from jhb
Move the code in fill_kinfo_thread() that gathers data from struct proc
into the new function fill_kinfo_proc_only().
Change all callers of fill_kinfo_thread() to call both
fill_kinfo_proc_only() and fill_kinfo() thread. When gathering
data from a multi-threaded process, fill_kinfo_proc_only() only needs
to be called once.
Grab sched_lock before accessing the process thread list or calling
fill_kinfo_thread().
PR: kern/84684
Approved by: re (scottl)
Original commit message:
FreeBSD src repository
Modified files:
sys/ufs/ffs ffs_alloc.c
Log:
Initialize the inode i_flag field in ffs_valloc() to clean up any
stale flag bits left over from before the inode was recycled.
Without this change, a leftover IN_SPACECOUNTED flag could prevent
softdep_freefile() and softdep_releasefile() from incrementing
fs_pendinginodes. Because handle_workitem_freefile() unconditionally
decrements fs_pendinginodes, a negative value could be reported at
file system unmount time with a message like:
unmount pending error: blocks 0 files -3
The pending block count in fs_pendingblocks could also be negative
for similar reasons. These errors can cause the data returned by
statfs() to be slightly incorrect. Some other cleanup code in
softdep_releasefile() could also be incorrectly bypassed.
Reviewed by: tegge
Approved by: re (scottl)
Fix so that color changes are not lost when the video mode changes.
PR: bin/83553
Submitted by: Dan Lukes <dan at obluda dot cz>
Approved by: re (scottl)
Reminded by: delphij
| Fix system shutdown timeout handling by again supporting longer running
| shutdown procedures (which have a duration of more than 120 seconds).
|
| We have two user-space affecting shutdown timeouts: a "soft" one in
| /etc/rc.shutdown and a "hard" one in init(8). The first one can be
| configured via /etc/rc.conf variable "rcshutdown_timeout" and defaults
| to 30 seconds. The second one was originally (in 1998) intended to be
| configured via sysctl(8) variable "kern.shutdown_timeout" and defaults
| to 120 seconds.
|
| Unfortunately, the "kern.shutdown_timeout" was declared "unused" in 1999
| (as it obviously is actually not used within the kernel itself) and
| hence was intentionally but misleadingly removed in revision 1.107 from
| init_main.c. Kernel sysctl(8) variables are certainly a wrong way to
| control user-space processes in general, but in this particular case the
| sysctl(8) variable should have remained as it supports init(8), which
| isn't passed command line flags (which in turn could have been set via
| /etc/rc.conf), etc.
|
| As there is already a similar "kern.init_path" sysctl(8) variable which
| directly affects init(8), resurrect the init(8) shutdown timeout under
| sysctl(8) variable "kern.init_shutdown_timeout". But this time document
| it as being intentionally unused within the kernel and used by init(8).
| Also document it in the manpages init(8) and rc.conf(5).
|
| Reviewed by: phk
| MFC after: 2 weeks
|
| Revision Changes Path
| 1.48 +7 -1 src/sbin/init/init.8
| 1.61 +1 -1 src/sbin/init/init.c
| 1.264 +16 -1 src/share/man/man5/rc.conf.5
| 1.257 +11 -0 src/sys/kern/init_main.c
Approved by: re (scottl)
Second attempt at a work-around for fifo-related socket panics during
make -j with high levels of parallelism: acquire Giant in fifo I/O
routines.
Discussed with: ups
Approved by: re (scottl)
Bug fix: a numeric flag specification in the substitute command would
cause the next substitute flag to be ignored.
While working at it, detect and report overflows.
Reported by: Jingsong Liu
Bugged by: Xin Li
Approved by: re (kensmith)
In em_process_receive_interrupts() store and clear adapter->fmt. This
make function reenterable. In the runtime the race is masked by
serializing
of em_process_receive_interrupts() either by interrupt thread, or by
polling. The race can be triggered when polling is switched on or off.
Approved by: re (scottl)
msdosfs_vfsops.c v1.146
bootsect.h v1.13
Remove checks for BOOTSIG[23] from FAT32 bootblocks.
There seems to be very little documentary evidence outside this
implementation to suggest a these checks are neccessary, and more
than one camera-formatted flash disk fails the check, but mounts
successfully on most other systems.
Approved by: re (scottl@)
revision 1.146
date: 2005/09/28 16:05:13; author: cognet; state: Exp; lines: +7 -1
Use SO_REUSEADDR on the socket, to make the use of syslogd in jails easier.
Submitted by: Jeremie Le Hen <jeremie le-hen org>
Approved by: re
src/sys/kern/vfs_bio.c 1.495, 1.496
src/sys/kern/vfs_subr.c 1.648
src/sys/sys/buf.h 1.190, 1.191
src/sys/sys/proc.h 1.436
src/sys/ufs/ffs/ffs_snapshot.c 1.104, 1.105, 1.106
Original commit messages:
Log:
Un-staticize runningbufwakeup() and staticize updateproc.
Add a new private thread flag to indicate that the thread should
not sleep if runningbufspace is too large.
Set this flag on the bufdaemon and syncer threads so that they skip
the waitrunningbufspace() call in bufwrite() rather than than
checking the proc pointer vs. the known proc pointers for these two
threads. A way of preventing these threads from being starved for
I/O but still placing limits on their outstanding I/O would be
desirable.
Set this flag in ffs_copyonwrite() to prevent bufwrite() calls from
blocking on the runningbufspace check while holding snaplk. This
prevents snaplk from being held for an arbitrarily long period of
time if runningbufspace is high and greatly reduces the contention
for snaplk. The disadvantage is that ffs_copyonwrite() can start
a large amount of I/O if there are a large number of snapshots,
which could cause a deadlock in other parts of the code.
Call runningbufwakeup() in ffs_copyonwrite() to decrement runningbufspace
before attempting to grab snaplk so that I/O requests waiting on
snaplk are not counted in runningbufspace as being in-progress.
Increment runningbufspace again before actually launching the
original I/O request.
Prior to the above two changes, the system could deadlock if enough
I/O requests were blocked by snaplk to prevent runningbufspace from
falling below lorunningspace and one of the bawrite() calls in
ffs_copyonwrite() blocked in waitrunningbufspace() while holding
snaplk.
See <http://www.holm.cc/stress/log/cons143.html>
Revision Changes Path
1.495 +3 -3 src/sys/kern/vfs_bio.c
1.648 +2 -1 src/sys/kern/vfs_subr.c
1.190 +1 -0 src/sys/sys/buf.h
1.436 +1 -1 src/sys/sys/proc.h
1.104 +16 -4 src/sys/ufs/ffs/ffs_snapshot.c
Log:
Un-staticize waitrunningbufspace() and call it before returning from
ffs_copyonwrite() if any async writes were launched.
Restore the threads previous TDP_NORUNNINGBUF state before returning
from ffs_copyonwrite().
Revision Changes Path
1.496 +1 -1 src/sys/kern/vfs_bio.c
1.191 +1 -0 src/sys/sys/buf.h
1.105 +13 -1 src/sys/ufs/ffs/ffs_snapshot.c
Log:
Correct previous commit to fix the sense of the TDP_NORUNNINGBUF
check in ffs_copyonwrite() that is a precondition for calling
waitrunningbufspace().
Pointed out by: tegge
Pointy hat to: truckman
MFC after: 3 days
Revision Changes Path
1.106 +1 -1 src/sys/ufs/ffs/ffs_snapshot.c
Approved by: re (scottl)
Original commit messages:
truckman 2005-10-01 08:33:57 UTC
FreeBSD src repository
Modified files:
sys/kern kern_exec.c
Log:
Copy new process argument list in do_execve() before grabbing PROC_LOCK
to avoid touching pageable memory while holding a mutex.
Simplify argument list replacement logic.
PR: kern/84935
Submitted by: "Antoine Pelisse" apelisse AT gmail.com (in a different form)
MFC after: 3 days
Revision Changes Path
1.276 +10 -10 src/sys/kern/kern_exec.c
truckman 2005-10-04 04:02:33 UTC
FreeBSD src repository
Modified files:
sys/kern kern_exec.c
Log:
Add missing word to comment.
Revision Changes Path
1.278 +1 -1 src/sys/kern/kern_exec.c
PR: kern/84935
Submitted by: "Antoine Pelisse" apelisse AT gmail.com (in a different form)
Approved by: re (scottl)
Initialize uninitialized variables.
Remove one possible way of shooting yourself in the foot.
Requested by: Dan Lukes <[email protected]>
Approved by: RE (kensmith@)
And now for the scripts which refuse the line above:
Approved by: re
Close a race in biodone(), whereby the bio_done field of the passed
bio may have been freed and reassigned by the wakeup before being
tested after releasing the bdonelock.
Approved by: re (scottl@)
- /dev/ttyv* not found on FreeBSD/sparc64 when
there is no framebuffer[1].
- KLDs do not work on FreeBSD/sparc64 with >4GB RAM[2].
- kgdb is broken for debugging panics on FreeBSD/sparc64[2].
Thanks to: marius[1], kris[2]
Approved by: re (implicitly)
Assert v_fifoinfo is non-NULL in fifo_close() in order to catch
non-conforming cases sooner.
Reported by: Peter Holm <peter at holm dot cc>
Approved by: re (scottl)
Add "show allpcpu" to DDB, which prints the current CPU id followed by
the per-cpu data for all CPUs. This is easier to ask users to do than
"figure out how many CPUs you have, now run show pcpu, then run it
once for each CPU you have".
Approved by: re (scottl)
In lockstatus(), don't lock and unlock the interlock when testing the
sleep lock status while kdb_active, or we risk contending with the
mutex on another CPU, resulting in a panic when using "show
lockedvnods" while in DDB.
Reviewed by: jhb
Reported by: kris
Approved by: re (scottl)
Original commit message:
truckman 2005-09-29 21:50:26 UTC
FreeBSD src repository
Modified files:
sys/ufs/ffs ffs_softdep.c
Log:
After a rmdir()ed directory has been truncated, force an update of
the directory's inode after queuing the dirrem that will decrement
the parent directory's link count. This will force the update of
the parent directory's actual link to actually be scheduled. Without
this change the parent directory's actual link count would not be
updated until ufs_inactive() cleared the inode of the newly removed
directory, which might be deferred indefinitely. ufs_inactive()
will not be called as long as any process holds a reference to the
removed directory, and ufs_inactive() will not clear the inode if
the link count is non-zero, which could be the result of an earlier
system crash.
If a background fsck is run before the update of the parent directory's
actual link count has been performed, or at least scheduled by
putting the dirrem on the leaf directory's inodedep id_bufwait list,
fsck will corrupt the file system by decrementing the parent
directory's effective link count, which was previously correct
because it already took the removal of the leaf directory into
account, and setting the actual link count to the same value as the
effective link count after the dangling, removed, leaf directory
has been removed. This happens because fsck acts based on the
actual link count, which will be too high when fsck creates the
file system snapshot that it references.
This change has the fortunate side effect of more quickly cleaning
up the large number dirrem structures that linger for an extended
time after the removal of a large directory tree. It also fixes a
potential problem with the shutdown of the syncer thread timing out
if the system is rebooted immediately after removing a large directory
tree.
Submitted by: tegge
MFC after: 3 days
Revision Changes Path
1.185 +2 -0 src/sys/ufs/ffs/ffs_softdep.c
Submitted by: tegge
Approved by: re (scottl)
- Correct a typo.
- Note the requirement for 'device apic' on i386 systems.
- Consistently use 'x86' when referring to behaviour common to the
i386 and amd64.
Approved by: re (hrs)
The 'intr_bufferfull' driver statistic actually counts the number
of times sampling was stopped due to a space shortage; change its
description in the output of `pmcstat -s` to match reality.
Approved by: re (scottl)
sys/fs/msdosfs/msdosfs_vfsops.c:1.145,
sys/fs/ntfs/ntfs_vfsops.c:1.79-1.80,
sys/fs/udf/udf_vfsops.c:1.34-1.35,
sys/gnu/fs/ext2fs/ext2_vfsops.c:1.152-1.153,
sys/gnu/fs/reiserfs/reiserfs_vfsops.c:1.2-1.3 (by ssouhlal):
*_mountfs() (if the filesystem mounts from a device) needs devvp to be
locked, so lock it.
Approved by: re (scottl)
Don't unbusy the devfs mount in vfs_mountroot_try() as it gets accessed
and unbusied in devfs_fixup(), which assumes that the devfs mount is
still locked.
Approved by: re (scottl)
Take a first cut at cleaning up ifnet removal and multicast socket
panics, which occur when stale ifnet pointers are left in struct
moptions hung off of inpcbs:
- Add in_ifdetach(), which matches in6_ifdetach(), and allows the
protocol to perform early tear-down on the interface early in
if_detach().
- Annotate that if_detach() needs careful consideration.
- Remove calls to in_pcbpurgeif0() in the handling of SIOCDIFADDR --
this is not the place to detect interface removal! This also
removes what is basically a nasty (and now unnecessary) hack.
- Invoke in_pcbpurgeif0() from in_ifdetach(), in both raw and UDP
IPv4 sockets.
It is now possible to run the msocket_ifnet_remove regression test
using HEAD without panicking.
Reported by: Gavin Atkinson <gavin dot atkinson at ury dot york dot ac dot uk>
Approved by: re (scottl)
- Remove sis_unit and use device_printf() and if_printf() instead.
- Use callout_init_mtx() for the callout.
- Remove spls.
- Fix locking for ifmedia to happen in the ifmedia handlers rather than in
sis_ioctl().
Approved by: re (scottl)
rpcclnt.c:1.14 from HEAD to RELENG_6:
Acquire Giant in uprintf() and tprintf() due to the non-MPSAFEty of
the tty code invoked from these functions. In two cases, during
timeout handling in NFS-related RPC client code, acquire Giant in
the caller before other mutexes the caller might hold, in order to
avoid lock order reversals with Giant (a recursive acquire is not
a reversal as it won't ever wait).
Correct age-old comments about uprintf()/tprintf() sleeping: they
will never sleep.
Much useful feedback from: bde
Approved by: re (scottl)
- Print space character in show_stat(). Remove a lot of priuntf(" ").
- Utilize show_stat() in sidewaysintpr() loop. This makes periodic
statistics to honor -h flag.
Approved by: re (kensmith)
prevent a memory-referenced-after-free panic if the hme interface
fails to attach.
Patch obtained from: marius
Suggested same thing: brooks
Approved by: re (scottl)
Lock the read socket receive buffer when frobbing the sb_state flag on
that socket during open, not the write socket receive buffer.
Spotted by: ups
Approved by: re (scottl)
For reasons of consistency (and necessity), assert an exclusive vnode
lock on the fifo vnode in fifo_open(): we rely on the vnode lock to
serialize access to v_fifoinfo.
Approved by: re (scottl)
Add three new read-only socket options, which allow regression tests
and other applications to query the state of the stack regarding the
accept queue on a listen socket:
SO_LISTENQLIMIT Return the value of so_qlimit (socket backlog)
SO_LISTENQLEN Return the value of so_qlen (complete sockets)
SO_LISTENINCQLEN Return the value of so_incqlen (incomplete sockets)
Minor white space tweaks to existing socket options to make them
consistent.
Discussed with: andre
Approved by: re (scottl)
the RDONLY option, so subsequent call of UFS_TRUNCATE (ffs_truncate)
would not panic the system. This fixes a panic that can happen
when mounting a corrputed filesystem read-only, and reading data
from it.
Reviewed by: mckusick
Approved by: re (scottl)
date: 2005/09/24 21:41:47; author: krion; state: Exp; lines: +1 -1
Do not bitch about bsdpan modules not having origin.
Based on PR: bin/82269
Submitted by: Steven Hartland <killing at multiplay dot co dot uk>
MFC after: 3 days
Approved by: re (kensmith)
date: 2005/09/24 19:41:56; author: krion; state: Exp; lines: +1 -1
Remove '\n' since it's redundant in case if file doesn't exist while
running 'pkg_info -g'
Based on PR: bin/42609
Submitted by: Jeff King <peff-freebsd at peff dot net>
MFC after: 3 days
Approved by: re (kensmith)
Split the do_powerstaes knob into do_power_resume and do_power_nodriver.
Go ahead and enable power state management for suspend/resume, but leave
the nodriver powerdown off by default. The MFC that changed do_power_state
default to 0 broke some resume on some laptops.
Approved by: re@ (scottl)
- Understand EADDRINUSE, and forget EDQUOT. [1]
- Add description for EEXIST.
- Change description for ENOBUFS. Routing socket can return
this error for many different reasons, including general
memory shortage, mbuf memory shortage and rtentry zone.
PR: kern/64090 [1]
Approved by: re (scottl)
Several fixes to rt_setgate(), that fix problems with route changing:
- Rearrange code so that in a case of failure the affected
route is not changed. Otherwise, a bogus rtentry will be
left and later rt_check() can recurse on its lock. [1]
- Remove comment about protocol cloning.
- Fix two places where rtentry mutex was recursed on, because
accessed via two different pointers, that were actually pointing
to the same rtentry in some cases. [1]
- Return EADDRINUSE instead of bogus EDQUOT, in case when gateway
uses the same route. [2]
Reported & tested by: ps, Andrej Zverev <az inec.ru> [1]
PR: kern/64090 [2]
Approved by: re (scottl)
> Fix an alignment panic my preserving the 2byte padding (ETHER_ALIGN) on our
> copied mbuf, which keeps the IP header 32-bit aligned. This copied mbuf is
> reinjected back into ether_input and off to the IP routines.
>
> Reported and tested by: Peter van Dijk
Approved by: re (scottl), mlaier (mentor)
Pass 'curthread' into VFS_STATFS() from acctwatch(), rather than passing
NULL. The NFS client expects that a thread will always be present for a
VOP so that it can check for signal conditions, and will dereference a
NULL pointer if one isn't present.
Approved by: re (scottl)
HEAD to RELENG_6:
Add discussion of Giant, the MPSAFE flag, and NDHASGIANT() to namei(9).
Add a VFS_LOCK_GIANT(9)/VFS_UNLOCK_GIANT(9) man page.
Discussed with: jeff
Approved by: re (hrs)
Add a new rc.conf entry, kerberos5_server_flags, which allows the
administrator to specify additional start-up flags to the Kerberos
5 Authentication Server.
Approved by: re (scottl)
slots to probe. Problems have been reported in this area, lets hope
this bandaid helps.
!! Owners of EISA-equipped Alpha machines are requested to at least
!! boot-test a 6-BETA build and report back to the Alpha list. Thanks!
Approved by: re (scottl)
Suggested by: ticso
MFC rev 1.25
revision 1.25
date: 2005/09/18 19:23:35; author: cognet; state: Exp; lines: +2 -4
Slightly change the API for the SNPSTTY ioctl so that the userland now
provides a file descriptor instead of a dev_t.
Approved by: re
revision 1.27
date: 2005/09/19 13:48:45; author: ru; state: Exp; lines: +8 -5
Restore the ability to detach from a tty via SIOCSTTY and document
recent changes in a manpage.
Approved by: re
- Sort the list of ethernet devices by driver-name.
- Sort the list of disk controllers by driver-name. The notable exception is
ata(4), which should stay on top.
- Add esp(4).
Approved by: re (hrs)
revision 1.32
date: 2005/09/18 19:24:05; author: cognet; state: Exp; lines: +8 -2
Open the tty device and pass the fd for SNPSTTY.
revision 1.33
date: 2005/09/19 13:48:45; author: ru; state: Exp; lines: +3 -3
Restore the ability to detach from a tty via SIOCSTTY and document
recent changes in a manpage.
revision 1.34
date: 2005/09/21 14:30:14; author: cognet; state: Exp; lines: +8 -8
Close the tty file descriptor once we're done with it.
Use O_NONBLOCK when opening the tty device.
Approved by: re
revision 1.101
date: 2005/09/18 19:23:35; author: cognet; state: Exp; lines: +14 -5
Slightly change the API for the SNPSTTY ioctl so that the userland now
provides a file descriptor instead of a dev_t.
revision 1.102
date: 2005/09/19 13:48:45; author: ru; state: Exp; lines: +5 -5
Restore the ability to detach from a tty via SIOCSTTY and document
recent changes in a manpage.
Approved by: re
Harden the hotplug support for SATA devices.
This also fixes a few races that was present in the timeout/detach code.
Fix support for the VIA 6421 controller.
Fixes the losage of some ATAPI device that reported failed probing.
Fix problem finding the still working disk in a broken mirror on VIA.
Approved by: re@ (scottl)
Use sysctl -q when querying for kern.bootp_cookie in order to avoid
printing boot-time errors that don't reflect true error conditions.
Approved by: re (kensmith)
Add "-q" argument to sysctl(8), which suppresses a limited set of
warnings/ errors generated. In particular, it suppresses "unknown oid"
when attempting to get or set a sysctl not present in the kernel.
Approved by: re (kensmith)
% When bus_alloc_resource_any() fails, dc_detach() is called and it
% attempts to deallocate busdma tags and resources that haven't been
% allocated yet, causing a panic every time a dc interface fails to
% attach. Fix by checking that we really have something to dealloc
% before calling bus_dma*() functions.
%
% Approved by: jhb
% MFC after: 1 week
Approved by: re (kensmith)
In mountd_precmd(), use rc_args, not mountd_args to
override the value of mountd_args. This fixes the problem
where mountd_args was not properly being set if
weak_mountd_authentifcation="YES" was set in rc.conf.
PR: conf/86260
Submitted by: Thierry Herbelot <thierry at herbelot dot com>
Approved by: re (kensmith)
Assert that (vp) is locked in fifo_close(), since we rely on the
exclusive vnode lock to synchronize the reference counts on struct
fifoinfo.
Approved by: re (scottl)
Re-comment sbcompress() to explain what it is it does; it took me
quite a bit of reading to figure it out, and I want to avoid figuring
it out again.
Convert an if (foo) else printf("this is almost a panic") into a
KASSERT.
Approved by: re (scottl)
The socket pointers in fifoinfo are not permitted to be NULL, so
don't check if they are, it just confuses the fifo code more.
Approved by: re (kensmith)
Test the new M_VLANTAG packet flag before calling
m_tag_locate(). This adds little overhead of a simple
bitwise operation in case hardware VLAN acceleration
is on, yet saves the more expensive function call if
the acceleration is off.
Reviewed by: ru, glebius
Approved by: re (kensmith)
When message can't fit into socket receive buffer return ENOBUFS
to userland program instead of letting it wait until end of days.
PR: kern/85907
Approved by: re (kensmith)
Don't consider being unable to open the bounds file worthy of printing
at LOG_WARNING by default; instead, consider it something to be printed
to the tty when 'verbose' mode is set. This avoids printing out extra
lines at every boot on a system with crash dumps enabled, but that has
not yet had to generate a crashdump.
Approved by: re (kensmith)
Use kenv -q to extract dumpdev rather than kenv, in order to avoid
spamming the console in the event that a loader tunable 'dumpdev'
isn't defined, which is not a relevant failure to report.
Approved by: re (kensmith)
Push warning in net_add_domain() down under DIAGNOSTIC. At the moment, the
only loadable domain is netgraph and it has no problems to be loaded
at runtime, since it doesn't use if_afdata[AF_NETGRAPH], yet.
Approved by: re (scottl)
The bsdtar_warnc() reporting function requires the program name to be
set up before it is called, so move the progname initialization before
the first possible call to bsdtar_warnc().
Thanks to: Stanislav Sedov
PR: bin/83366
Approved by: re (scottl)
When (re)allocating space for an array of pointers to char, use
sizeof(*list), not sizeof(**list). (i.e., sizeof(pointer) rather than
sizeof(char)).
Approved by: re (scottl)
Fix race condition that caused activation of an event to
be ignored immediately after it was deactivated.
Submitted by: Stephan Uphoff, Yahoo
Approved by: re
>Make the exploring of all luns supported by an HBA more of a
>tunable (until we get REPORT LUNS in place).
>
>If we're probing luns, and each probe succeeds, we keep going past
>lun 7 if we're a SCSI3 or better device (until we fail to probe).
>
>If we're probing luns, and a probe fails, we only keep going if
>we're quirked *for* it (CAM_QUIRK_HILUNS), and if we're not quirked
>*against* it (CAM_QUIRK_NOHILUNS), or we're a SCSI3 or better device
>and the tunable (kern.cam.cam_srch_hi) is set non-zero.
Approved by: re (scottl)
Handle a race condition where NULLFS vnode can be cleaned while threads
can still be asleep waiting for lowervp lock.
Tested by: kkenn
Discussed with: ssouhlal, jeffr
(this is an early MFC for inclusion in the upcoming 6.0-BETA5)
Approved by: re (scottl)
Use vput() instead of vrele() in null_reclaim() since the lower vnode
is locked.
MFC 1.89 (by kan):
Handle a race condition where NULLFS vnode can be cleaned while threads
can still be asleep waiting for lowervp lock.
Tested by: kkenn
Discussed with: ssouhlal, jeffr
(rev. 1.89 is an early MFC for inclusion in the upcoming 6.0-BETA5)
Approved by: re (scottl)
Log:
Handle circular dependencies properly (via errx(3)) rather than dumping
core. This bug was made visible by a recent change to the audio/timidity++
port, which now has itself as a run dependency.
Approved by: re (scottl)
Stop leaking a lock. This used to cause a propagate_priority() page fault
when setting syncdev and syncpeer.
Reported by: Dominic Marks
Approved by: re (scottl)
- Determine where the runtime loader got mapped to when a dynamically
linked process was exec()'ed, and map samples in that address range
into the appropriate buckets in the runtime loader's profile.
- Fix a bug that caused generated gmon.out profiles to be out of
whack. Use saturating arithmetic when incrementing a bucket.
- Improve a few comments.
Approved by: re (scottl)
o New APIs to access CIS, attribute memory and pccard registers
o Lock ed driver
o Support more cards in ed, ep, sn, xe
o Use new APIs to get MAC address right more often.
Approved by: re (scottl)
Ignore mutex asserts when we're dumping as well. This allows me
to panic a system from DDB when INVARIANTS is compiled into the
kernel on a scsi system.
Approved by: re (scottl)
Remove a KASSERT in the sack path that fails because of a interaction
between sack and a bug in the "bad retransmit recovery" logic. This is
a workaround, the underlying bug will be fixed later.
Approved by: re (scottl)
For FreeBSD 4 binaries, when trying to read from a device that does
not exsist, do not have ioctl return an error, but instead set -1
in the data returned to the user. This allows the HP bios flash
utilities to work without requiring changes to their code.
Approved by: re (scottl)
Trim down now (believed to be) unused fifo_ioctl() and
fifo_kqfilter() VOP implementations, since they in theory are used
only on open file descriptors, in which case the ioctls are via
fifo_ioctl_f() and kqueue requests are via fifo_kqfilter_f().
Generate warnings if they are entered for now. These printf()
calls should become panic() calls.
Annotate and re-implement fifo_ioctl_f(): don't arbitrarily
forward ioctls to the socket layer, only forward the ones we
explicitly support for fifos. In the case of FIONREAD, don't
forward the request to the write socket on a read-write fifo, or
the read result is overwritten. Annotate a nasty case for the
undefined POSIX O_RDWR on fifos, in which failure of the second
ioctl will result in the socket pair being in an inconsistent
state.
Assert copyright as I find myself rewriting non-trivial parts of
fifofs.
Approved by: re (scottl)
Annotate two issues:
1) fifo_kqfilter() is not actually ever used, it likely should be GC'd.
2) fifo_kqfilter_f() doesn't implement EVFILT_VNODE, so detecting events
on the underlying vnode for a fifo no longer works (it did in 4.x).
Likely, fifo_kqfilter_f() should forward the request to the VFS using
fp->f_vnode, which would work once fifo_kqfilter() was detached from
the vnode operation vector (removing the fifo override).
Discussed with: phk
Approved by: re (scottl)
As a result of kqueue locking work, socket buffer locks will always
be held when entering a kqueue filter for fifos via a socket buffer
event: as such, assert the lock unconditionally rather than acquiring
it conditionally.
Approved by: re (scottl)
Introduce no-op nosup fifo kqueue filter and detach routine, which are
used when a read filter is requested on a write-only fifo descriptor, or
a write filter is requested on a read-only fifo descriptor. This
permits the filters to be registered, but never raises the event, which
causes kqueue behavior for fifos to more closely match similar semantics
for poll and select, which permit testing for the condition even though
the condition will never be raised, and is consistent with POSIX's notion
that a fifo has identical semantics to a one-way IPC channel created
using pipe() on most operating systems.
The fifo regression test suite can now run to completion on HEAD without
errors.
Approved by: re (kensmith)
In netkqfilter(), return EINVAL instead of 1 (EPERM) when a filter type
is requested on a network interface file descriptor that is
non-applicable.
Approved by: re (kensmith)
When a request is made to register a filter on a fifo that doesn't
apply to the fifo (i.e., not EVFILT_READ or EVFILT_WRITE), reject
it as EINVAL, not by returning 1 (EPERM).
Approved by: re (kensmith)
Remove DFLAG_SEEKABLE from fifo file descriptors: fifos are not seekable
according to POSIX, not to mention the fact that it doesn't make sense
(and hence isn't really implemented). This causes the fifo_misc
regression test to succeed.
Approved by: re (scottl)
Only poll the fifo for read events if the fifo is attached to a readable
file descriptor. Otherwise, the read end of a fifo might return that it
is writable (which it isn't).
Only poll the fifo for write events if the fifo attached to a writable
file descriptor. Otherwise, the write end of a fifo might return that
it is readable (which it isn't).
In the event that a file is FREAD|FWRITE (which is allowed by POSIX, but
has undefined behavior), we poll for both.
Approved by: re (kensmith)
After going to some trouble to identify only the write-related events
to poll the write socket for, the fifo polling code proceeded to poll
for the complete set of events. Use 'levents' instead of 'events' as
the argument to poll, and only poll the write socket if there is
interest in write events.
Approved by: re (kensmith)
Add an assertion that fifo_open() doesn't race against other threads
while sleeping to allocate fifo state: due to using the vnode lock to
serialize access to a fifo during open, it shouldn't happen (tm).
Approved by: re (kensmith)
Rather than reaching into the internals of the UNIX domain socket code
by calling uipc_connect2() to connect two socket endpoints to create a
fifo, call soconnect2().
Approved by: re (kensmith)
``Process one NMI interrupt per handler invocation as the processor
buffers pending NMIs from multiple interrupting PMCs and delivers
them serially.''
Approved by: re (kensmith)
Even if there are no valid keys in metadata, but provider is attached
we can still use setkey subcommand.
Found by: regression tests
Approved by: re (scottl)
When bge_stop() is called from bge_detach(), mii is already NULL, so check
before trying to use it.
This fix allows to 'kldunload if_bge' without panicing.
Reviewed by: bz
Approved by: re (scottl)
Add gem(4) to the list of devices supporting VLAN-sized frames natively
(since sys/dev/gem/if_gem.c rev. 1.34, MFC'ed in rev. 1.29.2.4).
Approved by: re (scottl)
- Allow for VLAN-sized frames and set IFCAP_VLAN_MTU.
- On resume all registers have to be initialized again like after
power-on so reset sc_inited in gem_suspend() in order get all of
the registers set next time gem_init_regs() is called.
- On at least some ERI and GEM revisions GEM_MAC_RX_OVERFLOW happen
often due to a silicon bug and re-initializing is all we can do
about these errors so make handling them non-verbose.
- Remove a superfluous memset(3) call in gem_meminit(), all elements
are initialized to 0 anyway.
Approved by: re (scottl)
When padding with zero, do pad after prefixes rather than padding
before prefixes.
Use cases:
printf("%05d", -42); --> "00-42" (should be "-0042")
printf("%#05x", 12); --> "000xc" (should be "0x00c")
Submitted by: Oliver Fromme
PR: kern/85520
Approved by: re (kensmith)
nd6.c, r1.55; nd6_nbr.c, r1.33
> Add support for multicast to the bridge and allow inet6 addresses to be
> assigned to the interface.
>
> IPv6 auto-configuration is disabled. An IPv6 link-local address has a
> link-local scope within one link, the spec is unclear for the bridge case and
> it may cause scope violation.
>
> An address can be assigned in the usual way;
> ifconfig bridge0 inet6 xxxx:...
>
> Tested by: bmah
> Reviewed by: ume (netinet6)
> Approved by: mlaier (mentor)
Approved by: re (kensmith), mlaier (mentor)
- Do not hold route entry lock, when calling arprequest(). One such
call was introduced by me in 1.139, the other one was present before.
- Do all manipulations with rtentry and la before dropping the lock.
- Copy interface address from route into local variable before dropping
the lock. Supply this copy as argument to arprequest().
(LOR Ids in original commit message.)
Approved by: re (scottl)
Comment out ofw_console 'screen' entry and zs tty entries.
The OpenFirmware console isn't used on real systems anymore and
I never get to multi-user mode in psim. There are problems with
zs that need to be resolved before these lines can be enabled.
This eliminates disconcerting warnings on boot.
Approved by: re (Ken Smith)
Fix boot-time hang/panic on G3 systems when modifying IBAT0 in
pmap_bootstrap by using the sync;isync big hammer to make sure
all prior operations have completed.
Reported by: Nathan Whitehorn <nathan at uchicago edu>
Approved by: re (Ken Smith)
Fix an item leak, that happens when some node calls ng_callout() two
times consequently, without checking whether callout has been serviced
or not. (ng_pptpgre and ng_ppp were catched in this behavior).
- In ng_callout() save old item before calling callout_reset(). If the
latter has returned 1, then free this item.
- In ng_uncallout() clear c->c_arg.
Problem reported by: Alexandre Kardanev
Approved by: re (kensmith)
Make callout_reset() return a non-zero value if a pending callout
was rescheduled. If there was no pending callout, then return 0.
Reviewed by: iedowse, cperciva
Approved by: re (kensmith)
When a carp(4) interface is being destroyed and is in a promiscous mode,
first interface is detached from parent and then bpfdetach() is called.
If the interface was the last carp(4) interface attached to parent, then
the mutex on parent is destroyed. When bpfdetach() calls if_setflags()
we panic on destroyed mutex.
To prevent the above scenario, clear pointer to parent, when we detach
ourselves from parent.
Approved by: re (kensmith)
pf_ioctl.c Revision 1.153 Sun Aug 7 11:37:33 2005 UTC by dhartmei
| verify ticket in DIOCADDADDR, from Boris Polevoy, ok deraadt@
pf_ioctl.c Revision 1.158 Mon Sep 5 14:51:08 2005 UTC by dhartmei
| in DIOCCHANGERULE, properly initialize table, if used in NAT rule.
| from Boris Polevoy <vapcom at mail dot ru>, ok mcbride@
pf.c Revision 1.502 Mon Aug 22 11:54:25 2005 UTC by dhartmei
| when nat'ing icmp 'connections', replace icmp id with proxy values
| (similar to proxy ports for tcp/udp). not all clients use
| per-invokation random ids, this allows multiple concurrent
| connections from such clients.
| thanks for testing to Rod Whitworth, "looks ok" markus@
pf.c Revision 1.501 Mon Aug 22 09:48:05 2005 UTC by dhartmei
| fix rdr to bitmask replacement address pool. patch from Max Laier,
| reported by Boris Polevoy, tested by Jean Debogue, ok henning@
Approved by: re (scottl)
The number of raid controllers that violate the WHQL seems to be
growing in number and not isolated to old versions as previously
thought. Though the numbers of these seen in the wild is still
relatively small, they hang the system when parts of their devices are
powered down. The one area that these parts appear often are in the
higher end servers. As such, be conservative about powering down
devices that have no driver attached by default. Until a better
approach is proven in current, this is the prudent choice.
Laptop users wishing the benefits of powering down devices with no
drivers will now need to set hw.pci.do_powerstate=1 in their
/boot/loader.conf file. Some users will have devices that will
prevent this setting (hence the need to make it default 0).
Approved by: re@ (scottl)
src/sys/kern/kern_shutdown.c 1.175
src/sys/sys/buf.h 1.189
Modified files:
sys/gnu/fs/ext2fs fs.h
sys/kern kern_shutdown.c
sys/sys buf.h
Log:
Add a new struct buf flag bit, B_PERSISTENT, and use it to tag
struct bufs that are persistently held by ext2fs. Ignore any buffers
with this flag in the code in boot() that counts "busy" and dirty
buffers and attempts to sync the dirty buffers, which is done before
attempting to unmount all the file systems during shutdown.
This fixes the problem caused by any ext2fs file systems that are
mounted at system shutdown time, which caused boot() to give up on
a non-zero number of buffers and skip the call to vfs_unmountall().
This left all the mounted file systems in a dirty state and caused
them to all require cleanup by fsck on reboot.
Move the two separate copies of the "busy" buffer test in boot()
to a separate function.
Nuke the useless spl() stuff in the ext2fs ULCK_BUF() macro.
Bring the PRINT_BUF_FLAGS definition in sys/buf.h up to date with
this and previous flag changes.
PR: kern/56675, kern/85163
Tested by: "Matthias Andree" matthias.andree at gmx.de
Reviewed by: bde
MFC after: 3 days
PR: kern/56675, kern/85163
Tested by: "Hanspeter Roth" hampi at rootshell.be
Tested by: "Matthias Andree" matthias.andree at gmx.de
Reviewed by: bde
Approved by: re (scottl)
Reflect a recent change in /etc/rc.subr that made ``-M''
appear in tmpmfs and varmfs default flags explicitly.
Explain why -M is good for these file systems (it maximizes
performance and makes the system more stable at low memory
conditions by reducing the chance of thrashing.)
Bump .Dd accordingly.
Approved by: re (hrs)
etc/network.subr: 1.165-1.167
- kill removable_interfaces
- add NOAUTO keyword
- fix quoted entries in ifconfig_<ifn> variables
- always up the interface
- if ifconfig_<ifn> is defined, but empty, don't set it to
ifconfig_DEFAULT
- always configure lo0 first if it exists
etc/pccard_ether: 1.46
- kill removable_interfaces
- add NOAUTO keyword
etc/rc.d/netif: 1.15-1.17
- block Ctrl-C in dhclient
- minor cleanup of the interface list generation code
Approved by: re (scottl)
Requested by: many (death to removable_interfaces!)
sbin/dhclient/*.c:
- add __FBSDID
sbin/dhclient/conflex.c: 1.3-1.4
- fix a minor buffer overflow in config parsing
- actually support backslash escaping in config files
bin/dhclient/dhclient-script: 1.6-1.10
- don't create or remove routes to our address through 127.0.0.1
- improved detection of the interface of the default route
- support quotes in the medium string
- clear interface state more effectively on failure
- don't update resolv.conf when unchanged
bin/dhclient/dhclient.c: 1.10-1.11
- validate domain-name (used as resolv.conf search string)
- handle superseded subnet-mask correctly
Approved by: re (scottl)
- in ng_ksocket_incoming2() clear m_nextpkt on all mbufs
read from socket.
- restore rev. 1.54 change in ng_ksocket_incoming().
PR: kern/84952
PR: kern/82413
In collaboration with: rwatson
Approved by: re (scottl)
Raise one more bit in READER_MASK. I believe that before this change
it was possible to have 1 reader and 1 writer thread working on
a node simultaneously.
Reviewed by: julian
Approved by: re (scottl)
Use non-debug macros inside debugging functions, to prevent
important information from being rewritten.
In INVARIANTS case also check that nodes do not pass queues of mbufs
each other.
Approved by: re (scottl)
scmouse.c, 1.39: In set_mouse_pos(), try to avoid division by zero errors.
scvidctl.c, 1.36:
In sc_set_text_mode(), reset fontwidth if it is <= 0.
Eliminates division by zero errors in syscons driver.
Approved by: re (scottl)
Don't free a struct inodedep if another process is allocating saved
inode memory for the same struct inodedep in
initiate_write_inodeblock_ufs[12]().
Handle disappearing dependencies in softdep_disk_io_initiation().
Approved by: re (scottl)
Makefile: 1.7
add.c: 1.12, 1.23
create.c: 1.11
destroy.c: 1.6
gpt.8: 1.14, 1.15
gpt.c: 1.11, 1.12, 1.13
gpt.h: 1.8, 1.9, 1.10
label.c: 1.1
map.c: 1.6
map.h: 1.6
migrate.c: 1.14, 1.15, 1.16
recover.c: 1.8
remove.c: 1.5, 1.6, 1.7, 1.8
show.c: 1.12, 1.13
o New -l and -u options to the show command,
o New label command to support GPT labels,
o The remove command doesn't print the total partitions removed,
as it prints each partition it removes by name already,
o Added ellipsis to most usage messages.
PR: ia64/83124
Approved by: re (scottl)
o ic_curchan
o beacon/listen interval split
o split tx+rx crypto key and h/w key index -> node mapping support
Also for ath:
o correct duration calculation when protection is enabled
Also for wi:
o handle all-zero mac address properly
o fix media status handling so devd recognizes cards on insert
Also for ipw/iwi:
o always include statistics sysctls (was only when compiled w/ debugging)
o honor manual roaming setting
Also for ral/ural:
o fix basic rate set
o fix IFS parameters
o honor operating mode when selecting ack rate
o honor manual roaming setting
Approved by: re (scottl)
o add ic_curchan to resolve issues with what the "current channel" is
o split beacon and listen interval
o fixup mac acl support so you can query state
o split h/w tx+rx key indices in crypto state
o add optional h/w key index -> node mapping
o change default key index allocator to DTRT for legacy parts
that are WPA capable
o define typedef for a h/w key index
o fix race on node refcnt handling with sending probe response frames
o isolate scanning-related input handling to reduce diffs against
future scanning code
o sanity check beacon interval in recv'd management frames and
discard frames with out-of-range data
o fix refcnt race sending null data frames
o lock ioctl to get sta info
o fix misc races in ap mode sta state teardown
Approved by: re (scottl)
Fix a typo in vop_rename_pre() where we ended up using vholdl()
instead of vhold(), even though the vnode interlock is unlocked.
Approved by: re (scottl)
- Add md_mtx lock to protect ID number and list of devices.
- Always check mdnew() return value, as even in !autounit case
kthread_create() can fail.
Those two changes fix serval panics provoked by simple stress test.
Tested by: Kris The BugMagnet
Approved by: re (scottl)
In case of mac_check_vnode_rename_from() or vn_start_write() failure,
vn_finished_write() should not be called.
Reviewed by: ssouhlal
Approved by: re (scottl)
- Special-case NMI handling on the AMD64.
On entry or exit from the kernel the 'alltraps' and 'doreti' the code
used by normal traps disables interrupts to protect the critical sections
where it is setting up %gs.
This protection is insufficient in the presence of NMIs since NMIs
can be taken even when the processor has disabled normal interrupts.
Thus the NMI handler needs to actually read MSR_GBASE on entry to
the kernel to determine whether a swap of %gs using 'swapgs' is
needed. However, reads of MSRs are expensive and integrating this
check into the 'alltraps'/'doreti' path would penalize normal
interrupts.
- Teach DDB about the 'nmi_calltrap' symbol.
Reviewed by: bde, peter (an older version) and ups
Approved by: re (scottl)
Fix dangling callout problem in the Bluetooth L2CAP code that leads to
panic. The panic happens when outgoing L2CAP connection descriptor is
deleted with the L2CAP command(s) pending in the queue. In this case when
the last L2CAP command is deleted (due to cleanup) and reference counter
for the L2CAP connection goes down to zero the auto disconnect timeout
is incorrectly set. pjd gets credit for tracking this down and committing
bandaid.
Reported by: Jonatan B <onatan at gmail dot com>
Approved by: re (scottl)
vfs_subr.c 1.642 fixes a small race condition in vlrureclaim() and depends
on 1.636.
Modified files:
sys/kern vfs_subr.c
Log:
- Allow vnlru to drop giant if the filesystem does not require it. The
vnlru proc is extremely inefficient, potentially iteration over tens of
thousands of vnodes without blocking. Droping Giant allows other threads
to preempt us although we should revisit the algorithm to fix the runtime
problems especially since this may hold up all vnode allocations.
- Remove the LK_NOWAIT from the VOP_LOCK in vlrureclaim. This provides
a natural blocking point to help alleviate the situation described above
although it may not technically be desirable.
- yield after we make a pass on all mount points to prevent us from
blocking other threads which require Giant.
MFC after: 2 weeks
Revision Changes Path
1.636 +11 -2 src/sys/kern/vfs_subr.c
Modified files:
sys/kern vfs_subr.c
Log:
Back out the removal of LK_NOWAIT from the VOP_LOCK() call in
vlrureclaim() in vfs_subr.c 1.636 because waiting for the vnode
lock aggravates an existing race condition. It is also undesirable
according to the commit log for 1.631.
Fix the tiny race condition that remains by rechecking the vnode
state after grabbing the vnode lock and grabbing the vnode interlock.
Fix the problem of other threads being starved (which 1.636 attempted
to fix by removing LK_NOWAIT) by calling uio_yield() periodically
in vlrureclaim(). This should be more deterministic than hoping
that VOP_LOCK() without LK_NOWAIT will block, which may not happen
in this loop.
Reviewed by: kan
MFC after: 5 days
Revision Changes Path
1.642 +37 -7 src/sys/kern/vfs_subr.c
Approved by: re (scottl)
Prevent division by zero errors in sc_mouse_move()
by explicitly setting sc->font_width, in the same
places where sc->font_size is set, instead of
relying on the default initialized value of 0 for sc->font_width.
PR: kern/84836
Reported by: Andrey V. Elsukov <bu7cher at yandex dot ru>
Approved by: re (scottl)
- Correctly parse output, when logging amount is limited in the
rule itself, not in verbose_limit sysctl. [1]
- Do check rules, even if verbose_limit is set 0. Rules may have
their own log limits.
PR: conf/77929
Submitted by: Andriy Gapon [1]
Reviewed by: matteo
Approved by: re (scottl)
Rewrite linux_ifconf() to be more like ifconf() in net/if.c
so that we do not call uiomove() while IFNET_RLOCK() is held.
This eliminates the witness warning:
Calling uiomove() with the following non-sleepable locks held:
exclusive sleep mutex ifnet r = 0 (0xc096dd60) locked @
/usr/src/sys/modules/linux/../../compat/linux/linux_ioctl.c:2170
Approved by: re (scottl)
Add __BEGIN_DECLS/__END_DECLS so that this header can be included in C++
programs. Also, add include guards.
PR: bin/44277
Submitted by: Alex Zepeda <freebsd at blarf dot homeip dot net>
Approved by: re (scottl)
FDOPT_NORETRY is an option, and must be compared with fd->options,
not fd->flags.
PR: kern/85481
Submitted by: Lev Levinson <llevinson at inbox dot ru>
Approved by: re (ken)
- Document the fact that the real length of listen queue is 1.5 more
than the value of backlog argument.
- Document the fact that a subsequent listen(2) calls on the listening
socket change the backlog argument.
- Note that current listen queue lengths can be queried using netstat(1).
Submitted by: Igor Sysoev <is rambler-co.ru>
Wording by: gnn
Approved by: re (kensmith)
Update man page to reflect the fact that VOP_LISTEXTATTR
does not return a list of ASCII NUL terminated strings.
Instead, a list of attribute names is returned, where each
list entry consists of one byte for the name length, followed
by the name, without a terminating ASCII NUL.
This in similar to change 1.17 to extattr_get_file.2
Reviewed by: rwatson, ru
Approved by: re (hrs)
> Fix a panic in softclock() if the interface is destroyed with a bpf consumer
> attached.
>
> This is caused by bpf_detachd clearing IFF_PROMISC on the interface which does
> a SIOCSIFFLAGS ioctl. The problem here is that while the interface has been
> stopped, IFF_UP has not been cleared so IFF_UP != IFF_DRV_RUNNING, this causes
> the ioctl function to init() the interface which resets the callouts.
>
> The destroy then completes and frees the softc but softclock will panic on a
> dead callout pointer.
>
> Ensure ifp->if_flags matches reality by clearing IFF_UP when we destroy.
Approved by: re (kensmith), mlaier (mentor)
> Mark the callouts as MPSAFE as if_bridge has been giant-free since day 1.
>
> Use the SMP friendly callout_init_mtx() while we are here.
>
Approved by: re (kensmith), mlaier (mentor)
Don't loop back packets that have been routed by pf. This fixes an
endless loop where the same packet is sent over and over again.
Obtained from: OpenBSD
Reported by: Sergey Lapin
Tested by: Sergey Lapin
Approved by: re (scottl)
Do not keep parent directory locked while calling VFS_ROOT to
traverse mount points in lookup(). The lock can be dropped safely
around VFS_ROOT because LOCKPARENT semantics with child and parent
vnodes coming from different FSes does not really have any meaningful
use and we do not really care about parent state after we relock it.
This prevents easily triggered deadlock on systems using automounter
daemon.
Approved by: re (scottl)
sys/geom/eli/g_eli.h 1.3-4
sys/geom/eli/g_eli_ctl.c 1.2
sbin/geom/class/eli/geli.8 1.4-6
sbin/geom/class/eli/geom_eli.c 1.3
Sync with HEAD:
- We don't need to clear allocated memory. This will speed-up things a bit.
- Even if crypto_dispatch() return an error, request is not canceled and
our callback will still be called, just to tell us that requested
failed...
- Always run dedicated kernel thread (even when we have hardware support).
There is no performance impact, but allows to allocate memory with
M_WAITOK flag.
As a side effect this simplify code a bit.
- Allow to change number of iterations for PKCS#5v2. It can only be used
when there is only one key set.
- Add a __packed keyword to g_eli_metadata struct definition, so
sizeof(struct g_eli_metadata) will return the exact number of bytes needed
for storing it on the disk.
Without this change GELI was unusable on amd64 (and probably other 64-bit
archs), because sizeof(struct g_eli_metadata) was greater than 512 bytes
and geli(8) was failing on assertion.
Approved by: re (scottl)
sys/geom/label/g_label_iso9660.c 1.2
sys/geom/label/g_label_reiserfs.c 1.2
Verify if we can actually read the data at given offset.
Approved by: re (scottl)
sys/opencrypto/xform.c 1.6
Check key size for rijndael, as invalid key size can lead to kernel panic.
I checked other algorithms against this bug and it seems they aren't
affected.
Reported by: Mike Tancsa <[email protected]>
PR: i386/84860
Approved by: re (scottl)
date: 2005/07/25 22:21:11; author: mux; state: Exp; lines: +0 -1
Remove an erroneous m_freem() call. If m_defrag() returns a non-NULL
pointer, it has already freed the original mbuf chain, so we shouldn't
do it again.
Approved by: re (scottl)
Make sure ng_fec_init() uses the same calling convention as the rest of
the code, i.e. ng_fec_init() is called with the ifp->if_softc pointer and
NOT with the ifp pointer.
PR: kern/85239
Reviewed by: brooks
Approved by: re (scottl)
When we have a published ARP entry for some IP address, do reply on
ARP requests only on the network where this IP address belong, to.
Before this change we did replied on all interfaces. This could
lead to an IP address conflict with host we are doing ARP proxy
for.
PR: kern/75634
Reviewed by: andre
Approved by: re (scottl)
Backout revision 1.54, because it exposes a worse problem, than
it fixes. I believe the problem lives somewhere outside ng_ksocket,
but until it is found, let the node be working.
PR: kern/84952
PR: kern/82413
Approved by: re (scottl)
In order to support CARP interfaces kernel was taught to handle more
than one interface in one subnet. However, some userland apps rely on
the believe that this configuration is impossible.
Add a sysctl switch net.inet.ip.same_prefix_carp_only. If the switch
is on, then kernel will refuse to add an additional interface to
already connected subnet unless the interface is CARP. Default
value is off.
PR: bin/82306
In collaboration with: mlaier
Approved by: re (scottl)
Set the mountpoint path in the superblock (fs_fsmnt) at mount-time
so that it appears in the various messages (not cleanly unmounted,
filesystem full, etc). This has been broken since rev 1.261.
Approved by: re (scottl)
Stop hard-coding an -M flag to mdmfs(8) in /etc/rc.subr.
Now this flag can be set, or not set, for memory-backed
file systems on individual basis, as illustrated by the
rc.conf(5) variables tmpmfs_flags and varmfs_flags. The
flag is set for those FS'en by default, in /etc/defaults/rc.conf,
in order to stay compatible with the old rc.subr behaviour.
Approved by: re (scottl)
De-spl parts of the routing socket code now generally protected
through locking; leave some spl references around code where there
are open questions about global variable references. Also, add
an XXX regarding locking in sysctl.
Approved by: re (scottl)
rev. 1.6:
- Document the led(4) interface for the Thinklight
- Bump .Dd
rev. 1.5:
- Clarify how events are used and how the different event sysctl correlate
- Document how an event looks like that is received by devd(8) from
acpi_ibm(4)
- Document the event codes as they occur on a T41p
- Add a note about sysctl.conf and an Xref to it
- Add an example section providing an example script and an entry for
devd.conf. This is an adapted version of the one in acpi_fujitsu(4).
- s/Fn-F4/Fn+F4/ for consistency sake
- Add a button description where refering to a T41p, remove it otherwise,
since it might vary from model to model
- Bump .Dd
Approved by: re (hrs)
- Wrap the handler and associated code for collecting completed RX
descriptors that are still marked owned in #ifdef GEM_RINT_TIMEOUT
instead of #if 0 for convenience.
- Remove stale code and comment about relying on the preset XIF config.
- In case of a watchdog timeout call the init function instead of just
the start function so the chip is properly reset.
Merge from hme(4):
- Convert to use bus_dmamap_load_mbuf_sg() for loading RX buffers.
- Protect from a duplicate mbuf free panic in case the DMA engine hangs.
Approved by: re (scottl)
sys/dev/uart/uart_cpu_sparc64.c 1.21
- Change the code that determines whether to use a serial console and
which serial device to use in that case respectively to not rely on
the OFW names of the input/output and stdin/stdout devices. While at
it save on some variables and for sys/boot/sparc64/loader/metadata.c
move the code in question to a new function md_bootserial() so it can
be kept in sync with uart_cpu_getdev_console() more easily.
- Adjust the size of some buffers.
- Remove the package handle of the '/options' node from the argument
list of uart_cpu_getdev_dbgport().
Approved by: re (scottl)
- Add COMPATIBILITY and HISTORY sections. Fix an -mdoc error.
Cross-reference pmclog(3).
- Document two new diagnostic messages in hwpmc(4).
- Document the diagnostic message printed at startup time. Keep the
list of diagnostic messages sorted.
- Document the recently introduced EOPNOTSUPP error return. Repair
sort ordering for the list of error descriptions.
Approved by: re (hrs)
> The mtu check in bridge_enqueue is bogus as the maximum Ethernet frame is
> actually 1514, so comparing the mbuf length which includes the Ethernet
> header
> to the interface MTU is wrong.
>
> The check was a little over the top so just remove it.
Approved by: re (scottl), mlaier (mentor)
[ hwpmc_mod.c:1.14,1.15 ]
- Print PMC capabilities at module load time.
- Return EOPNOTSUPP instead of EINVAL if a PMC allocation request
specifies a PMC capability (e.g., sampling) that is not supported
by hardware. Return EINVAL early if the PMC class passed in is
not recognized.
[ hwpmc_x86.c:1.3 ]
- On x86 processors, turn off 'INTERRUPT' capabilities on PMCs
if the CPU does not have its local APIC enabled.
Approved by: re (scottl)
* Solve "No PHY found" problem for more Yukon Lite variants.
* Catch a bus attach error.
* Improve locking.
(missing in original commit message but was not worth a forced commit):
* put interrupt moderation messages under bootverbose
Approved by: re (kensmith)
% Add a small paragraph that describes how the current environment
% settings can be displayed, near the end of the DESCRIPTION section,
% immediately after the paragraph that describes how they can be set.
%
% Add a reference to printenv(1) too (and the ``printenv'' csh builtin).
%
% Submitted by: Gary W. Swearingen <[email protected]>
% PR: docs/85008
Approved by: re (hrs)
Add support for working around controllers that cannot do DMA in 48bit.
The workaround use PIO mode above ~137GB to allow using the disk.
Add the Acer chips with rev < 0xc4 as first candidate.
Add support for the Promise PDC4071[89] chips on the Fasttrak TX4300.
Docs kindly provided by Promise.
Apply fix for "pr82261 DMA-support on Sparc64 broken"
Use the bio field instead of the driver field as intended.
Dont set default mode to ATA_DMA_MAX on devices not capable of DMA.
Approved by: re@ (scottl)
Fix multiple typos in the mutex names. This fixes false positive (and pretty
strange looking too) LORs I have seen on my system. Pointy hat to goes to me.
Approved by: re (scottl)
For each interface flag, indicate whether or not it is owned by the
device driver, owned by the network stack, or initialized by the device
driver before attach and read-only from then on.
Not all device drivers and network stack components currently follow
these rules, especially with respect to IFF_UP, and a few exceptions
with IFF_ALLMULTI.
Approved by: re (scottl)
to RELENG_6:
Rename IFF_RUNNING to IFF_DRV_RUNNING, IFF_OACTIVE to IFF_DRV_OACTIVE,
and move both flags from ifnet.if_flags to ifnet.if_drv_flags, making
and documenting the locking of these flags the responsibility of the
device driver, not the network stack. The flags for these two fields
will be mutually exclusive so that they can be exposed to user space as
though they were stored in the same variable.
Provide #defines to provide the old names #ifndef _KERNEL, so that user
applications (such as ifconfig) can use the old flag names. Using the
old names in a device driver will result in a compile error in order to
help device driver writers adopt the new model.
When exposing the interface flags to user space, via interface ioctls
or routing sockets, or the two fields together. Since the driver flags
cannot currently be set for user space, no new logic is currently
required to handle this case.
Add some assertions that general purpose network stack routines, such
as if_setflags(), are not improperly used on driver-owned flags.
With this change, a large number of very minor network stack races are
closed, subject to correct device driver locking. Most were likely
never triggered.
Driver sweep to follow; many thanks to pjd and bz for the line-by-line
review they gave this patch.
Reviewed by: pjd, bz
Approved by: re (scottl)
- Remove NTP servers which do not resolve in DNS.
- Use pool.ntp.org servers where possible, thanks to
Chuck Swiger <cswiger at mac dot com> .
- Update list of Swedish NTP servers, thanks to
Fredrik Lindberg <fli+freebsd-current at shapeshifter dot se> .
PR: bin/75479
Approved by: re (scottl)
Lock down netnatm and mark as MPSAFE:
- Introduce a subsystem mutex, natm_mtx, manipulated with accessor macros
NATM_LOCK_INIT(), NATM_LOCK(), NATM_UNLOCK(), NATM_LOCK_ASSERT(). It
protects the consistency of pcb-related data structures. Finer grained
locking is possible, but should be done in the context of specific
measurements (as very little work is done in netnatm -- most is in the
ATM device driver or socket layer, so there's probably not much
contention).
- Remove GIANT_REQUIRED, mark as NETISR_MPSAFE, remove
NET_NEEDS_GIANT("netnatm").
- Conditionally acquire Giant when entering network interfaces for
ifp->if_ioctl() using IFF_LOCKGIANT(ifp)/IFF_UNLOCKGIANT(ifp) in order
to coexist with non-MPSAFE atm ifnet drivers..
- De-spl.
Reviewed by: harti, bms (various versions)
Approved by: re (hrs)
ip_input.c:1.303, ip_output.c:1.243 from HEAD to RELENG_6:
Introduce in_multi_mtx, which will protect IPv4-layer multicast address
lists, as well as accessor macros. For now, this is a recursive mutex
due code sequences where IPv4 multicast calls into IGMP calls into
ip_output(), which then tests for a multicast forwarding case.
For support macros in in_var.h to check multicast address lists, assert
that in_multi_mtx is held.
Acquire in_multi_mtx around iteration over the IPv4 multicast address
lists, such as in ip_input() and ip_output().
Acquire in_multi_mtx when manipulating the IPv4 layer multicast
addresses, as well as over the manipulation of ifnet multicast address
lists in order to keep the two layers in sync.
Lock down accesses to IPv4 multicast addresses in IGMP, or assert the
lock when performing IGMP join/leave events.
Eliminate spl's associated with IPv4 multicast addresses, portions of
IGMP that weren't previously expunged by IGMP locking.
Add in_multi_mtx, igmp_mtx, and if_addr_mtx lock order to hard-coded
lock order in WITNESS, in that order.
Problem reported by: Ed Maste <emaste at phaedrus dot sandvine dot ca>
Approved by: re (scottl)
Modify network protocol consumers of the ifnet multicast address lists
to lock if_addr_mtx.
Problem reported by: Ed Maste <emaste at phaedrus dot sandvine dot ca>
Approved by: re (scottl)
if_iso88025subr.c:1.68 from HEAD to RELENG_6:
When allocating link layer ifnet address list entries in
ifp->if_resolvemulti(), do so with M_NOWAIT rather than M_WAITOK, so
that a mutex can be held over the call. In the FDDI code, add a
missing M_ZERO. Consumers are already aware that if_resolvemulti()
can fail.
Approved by: re (scottl)
- Rename ifmaof_ifpforaddr() to if_findmulti(); assert if_addr_mtx.
Staticize.
Problem reported by: Ed Maste <emaste at phaedrus dot sandvine dot ca>
Approved by: re (scottl)
correct nits in the addition of if_addr_mtx:
if.c:1.240:
Initialize the if_addr mutex in if_alloc() rather than waiting until
if_attach(). This allows ethernet drivers to use it in their routines
to program their MAC filters before ether_ifattach() is called (de(4) is
one such driver). Also, the if_addr mutex is destroyed in if_free()
rather than if_detach(), so there was another potential bug in that a
driver that failed during attach and called if_free() without having
called ether_ifattach() would have tried to destroy an uninitialized
mutex.
Reported by: Holm Tiffe holm at freibergnet dot de
Discussed with: rwatson
if.c:1.241:
destroy lock _before_ free'ing the structure it resides in
if.c:1.242:
- Move IF_ADDR_LOCK_DESTROY(ifp) from if_free to if_free_type.
- Add a note that additions should be made to if_free_type and not
if_free to help avoid this in the future.
This apparently fixes a use after free in if_bridge and may fix bugs
in other direct if_free_type consumers.
Reported by: thompsa
Approved by: re (hrs)
Protect link layer network interface multicast address list manipulation
using ifp->if_addr_mtx:
- Initialize if_addr_mtx when ifnet is initialized.
- Destroy if_addr_mtx when ifnet is torn down.
- Rename ifmaof_ifpforaddr() to if_findmulti(); assert if_addr_mtx.
Staticize.
- Extract ifmultiaddr allocation and initialization into if_allocmulti();
accept a 'mflags' argument to indicate whether or not sleeping is
permitted. This centralizes error handling and address duplication.
- Extract ifmultiaddr tear-down and deallocation in if_freemulti().
- Re-structure if_addmulti() to hold if_addr_mtx around manipulation of
the ifnet multicast address list and reference count manipulation.
Make use of non-sleeping allocations. Annotate the fact that we only
generate routing socket events for explicit address addition, not
implicit link layer address addition.
- Re-structure if_delmulti() to hold if_addr_mtx around manipulation of
the ifnet multicast address list and reference count manipulation.
Annotate the lack of a routing socket event for implicit link layer
address removal.
- De-spl all and sundry.
Problem reported by: Ed Maste <emaste at phaedrus dot sandvine dot ca>
Approved by: re (hrs)
- Introduce a helper function if_setflag() containing the code common
to ifpromisc() and if_allmulti() instead of duplicating the code poorly,
with different bugs.
- Call ifp->if_ioctl() in a consistent way: always use more compatible C
syntax and check whether ifp->if_ioctl is not NULL prior to the call.
Discussed with: yar
Approved by: re (scottl)
Silence "busy" warnings when unmounting devfs at system shutdown. This
is a workaround for non-symetric teardown of the file systems at
shutdown with respect to the mount order at boot. The proper long term
fix is to properly detach devfs from the root mount before unmounting
each, and should be implemented, but since the problem is non-harmful,
this temporary band-aid will prevent false positive bug reports and
unnecessary error output for 6.0-RELEASE.
Tested by: pav, pjd
Approved by: re (scottl)
Add helper function ip_findmoptions(), which accepts an inpcb, and attempts
to atomically return either an existing set of IP multicast options for the
PCB, or a newlly allocated set with default values. The inpcb is returned
locked. This function may sleep.
Call ip_moptions() to acquire a reference to a PCB's socket options, and
perform the update of the options while holding the PCB lock. Release the
lock before returning.
Remove garbage collection of multicast options when values return to the
default, as this complicates locking substantially. Most applications
allocate a socket either to be multicast, or not, and don't tend to keep
around sockets that have previously been used for multicast, then used for
unicast.
This closes a number of race conditions involving multiple threads or
processes modifying the IP multicast state of a socket simultaenously.
Approved by: re (scottl)
The "Mbuf" zone was renamed "mbuf" to improve consistency, but the code
example in libmemstat.3 was not updated to take this rename into account.
Update the example.
PR: 84946
Submitted by: Wojciech A. Koszek <dunstan at freebsd dot czest dot pl>
Approved by: re (scottl)
Allocate one of the spare ifnet integer fields to hold if_drv_flags,
which in the future will hold IFF_OACTIVE and IFF_RUNNING, and have
its access synchronized by the device driver rather than the
protocol stack. This will avoid potential races in the management
of flags in if_flags.
Discussed with: various (scottl, jhb, ...)
Approved by: re (kensmith)
Remove no-op spl references in in_pcb.c, since in_pcb locking has been
basically complete for several years now. Update one spl comment to
reference the locking strategy.
Approved by: re (kensmith)
to RELENG_6:
Remove no-op spl's and most comment references to spls, as TCP locking
is believed to be basically done (modulo any remaining bugs).
Approved by: re (kensmith)
Improve canonicalization of copyrights. Order copyrights by order of
assertion (jeff, bmilekic, rwatson).
Suggested ages ago by: bde
Approved by: re (kensmith)
Hook up libmemstat(3) to the library list in mdoc.local. This will cause
the library description (specifically, -lmemstat) to render properly in
the libmemstat.3 man page.
Submitted by: ru
Approved by: re (kensmith)
rev. 1.108, 1.109 src/sys/netinet/ip_fw2.c
rev. 1.101 src/sys/netinet/ip_fw.h
rev. 1.77 src/sbin/ipfw/ipfw2.c
rev. 1.176 src/sbin/ipfw/ipfw.8
* Add dynamic sysctl for net.inet6.ip6.fw.
* Correct handling of IPv6 Extension Headers.
* Add unreach6 code.
* Add logging for IPv6.
* Fix build without INET6 and IPFIREWALL compiled into kernel.[1]
Submitted by: sysctl handling derived from patch from ume needed for ip6fw
Obtained from: is_icmp6_query and send_reject6 derived from similar
functions of netinet6,ip6fw
Reviewed by: ume, gnn; silence on ipfw@
Spotted and tested by: Michal Mertl <mime at traveller.cz>[1]
Approved by: re (kensmith)
Make the procfs module buildable again in the MODULES_WITH_WORLD case.
This means defining a target for default opt_compat.h, but only if we
are not building the modules along with the kernel.
Approved by: re (kensmith)
calls before an if_attach.
Partial MFC of 1.243. The change it was a response to has not been
MFCd, but the comment is relevent without it.
Approved by: re (kensmith)
Take this opportunity to note that glebius indicated
that the initial work in this area was done by
Igor Sysoev <is rambler-co.ru>
Approved by: re (kensmith)
Clarify how the 'channel' argument should look like and add an
example on how to obtain information on devices on an ata channel.
Approved by: re (hrs)
Add a new switch -h for interface stats mode, which prints all interface
statistics in human readable form.
In collaboration with: vsevolod
Reviewed by: cperciva
Approved by: re (kensmith)
Axe ppp_for_tty(). Use tty->t_lsc pointer to store sc. This
also eliminates recursive use of ppp_softc_list_mtx.
PR: kern/84686
Reviewed by: phk
Approved by: re (kensmith)
Fix bogus check. It was possible to panic the kernel by giving 0 length.
This is actually a local DoS, as every user can use /dev/crypto if there
is crypto hardware in the system and cryptodev.ko is loaded (or compiled
into the kernel).
Reported by: Mike Tancsa <[email protected]>
Security: Local DoS on systems with crypto HW and with /dev/crypto available
Approved by: re (kensmith)
Not sure why, but SYSCTL_OUT() can sometimes keep returning ENOMEM
in sysctl_jail_list(). Because of this, jls(8) could enter into
an endless loop. The strange thing is, that we can call jls(8) while
the other one is in loop and it will succeed - SYSCTL_OUT() will
not return ENOMEM there.
Approved by: re (kensmith)
Implement a new feature for ping(8) - sweeping pings. In a sweeping
ping ICMP payload of packets being sent is increased with given step.
Sweeping pings are useful for testing problematic channels, MTU
issues or traffic policing functions in networks.
PR: bin/82625
Submitted by: Chris Hellberg <chellberg juniper.net> (with some cleanups)
Approved by: re (kensmith)
date: 2005/08/18 22:30:52; author: csjp; state: Exp; lines: +4 -2
Add missing braces around bpf_filter which were missed when I
merged the bpfstat code.
Approved by: re (kensmith)
MFC revision 1.167
date: 2005/08/08 21:06:42; author: csjp; state: Exp; lines: +2 -0
Drop in a WITNESS_WARN into SYSCTL_IN to make sure that we are
not holding any non-sleep-able-locks locks when copyin is called.
This gets executed un-conditionally since we have no function
to wire the buffer in this direction.
MFC revision 1.166
date: 2005/08/08 18:54:35; author: csjp; state: Exp; lines: +6 -1
Check to see if we wired the user-supplied buffers in SYSCTL_OUT, if
the buffer has not been wired and we are holding any non-sleep-able locks,
drop a witness warning. If the buffer has not been wired, it is possible
that the writing of the data can sleep, especially if the page is not in
memory. This can result in a number of different locking issues, including
dead locks.
Approved by: re (kensmith)
BRANCH_OVERRIDE environment variable (which, if set, overrides the
BRANCH specified here). These make my FreeBSD Update build code
simpler by making it easier to recognize when two kernels are identical
modulo version numbers.
Approved by: re (kensmith)
> Ensure that we are holding the lock when initialising the bridge interface. We
> could initialise while unlocked if the bridge is not up when setting the inet
> address, ether_ioctl() would call bridge_init.
>
> Change it so bridge_init is always called unlocked and then locks before
> calling bstp_initialization().
Approved by: re (kensmith), mlaier (mentor)
Teach vmstat -m and vmstat -z to use libmemstat(3). Certain
statistics from -z are now a bit different due to changes in the
way statistics are now measured. Reproduce with some amount of
accuracy the slightly obscure layouts adopted by the two kernel
sysctls. In the future, we might want to normalize them.
GC dosysctl(), which is now no longer used.
Merge vmstat.c:1.88 from HEAD to RELENG_6:
Minor syntax tweaks:
- Remove some extra blank lines.
- Remove comments that don't contribute to understanding.
- Remove additional blank lines in output added to maximize
compatibility with older vmstat output, but that is actually
somewhat gratuitous.
Submitted by: bde
Approved by: re (kensmith)
In multicast routines:
Compare pointers with NULL rather than treating them as booleans.
Compare pointers with NULL rather than 0 to make it more clear
they are pointers.
Assign pointers value of NULL rather than 0 to make it more clear
they are pointers.
Approved by: re (kensmith)
Rename equal() macro to sa_equal(), which matches the definitions
of sa_equal() in other files, and makes it more clear what equal()
is comparing.
Approved by: re (kensmith)
>restore the ability to mount cd9660 filesystems as root by inverting
>some of the options test, specifically the joliet and rockridge tests.
> ...
Approved by: re (Ken Smith)
To prevent a race between RTM_DELETE message and
arptimer() deleting stale entry, we need to lock
rtentry before unlocking radix head.
Approved by: re (kensmith)
o Make rt_check() function more strict:
- rt0 passed to rt_check() must not be NULL, assert this.
- rt returned by rt_check() must be valid locked rtentry,
if no error occured.
o Modify callers, so that they never pass NULL rt0
to rt_check().
o Modify callers, so that they unlock rtentry.
Revisions merged:
net/if_atmsubr.c - 1.39, 1.41
net/if_fwsubr.c - 1.13, 1.15
net/if_iso88025subr.c - 1.69, 1.71
net/route.c - 1.110, 1.111
netinet6/nd6.c - 1.51-1.53
netinet/if_ether.c intentionally not touched by this merge.
Approved by: re (kensmith)
This should keep 'ugidfw list' to stop complaining about "Data error in
security.mac.bsdextended.rules.N: Unknown error: 0" if there is a "hole"
within the rule set.
Approved by: re (hrs)
space in /, /var, and /tmp, and if the device is large enough, provide
extra space to /var sufficient to store a crash dump.
Approved by: re (kensmith)
> Log:
> The /stand directory now disappears out from under sysinstall while
> it is running during installations. The vsystem() function does get
> used after this happens (e.g. if you manually configure the network
> interface and ask it to enable the interface) so it needs to be a
> little smarter about whether it uses /stand/sh or /bin/sh.
Approved by: re (hrs)
- add missing ether_poll_deregister
- add per-device polling
- move the setting of if_capenable further down so that the
VLAN caps are honored as well
Approved by: re (kensmith), ru
etc/defaults/rc.conf 1.255,1.256,1.257
- Remove gbde_swap_enable variable (it has no effect).
- Add geli_swap_flags variable which holds flags used by geli(8) when
configuring GELI-encrypted swap partitions.
- Add variables used by rc.d/geli and rc.d/geli2 scripts.
Approved by: re (kensmith)
Add scripts for GELI device configuration on boot.
rc.d/geli - configures encryption (ask for passphrases, etc.);
rc.d/geli2 - is called after file systems are mounted and mark devices for
detach on last close.
Approved by: re (kensmith)
Add if_addr_mtx to struct ifnet, a mutex to protect ifnet-related address
lists. Add accessor macros.
This changes the size of struct ifnet, but ideally, all ifnet consumers
are now using if_alloc() to allocate these structures rather than
embedding them into device driver softc's, so this won't modify the
network device driver ABI.
Approved by: re (hrs)
When keys were configured without passphrase, number of iterations in
metadata is equal to -1. if we then wanted to attach provider (or change
keys) and forget about '-p' flag it failed on assertion (quite ok, without
assertion it could call PKCS#5v2 with 4294967295 iterations).
Instead of failing on assertion, remind about '-p' flag.
Approved by: re (kensmith)
sys/geom/eli/g_eli.c 1.4,1.5
- GELI doesn't need cryptodev.
- Because code paths for I/O requests are quite complex, add comments above
the functions which participate in I/O paths.
Approved by: re (kensmith)
Unfortunately dlerror(3) returns string, so there is no clean way to
ignore "no such file" errors only, which I wanted to do.
Because of this I ignored all other errors on dlopen(3) failure as well,
which isn't good.
Fix this situation by calling access(2) on library file first and ignore
only ENOENT error. This allows to report all the rest of dlopen(3) errors.
Approved by: re (kensmith)
Skip jails which are already running and inform why.
We're checking for /var/run/jail_<name>.id file and if it exists, we don't
start the jail. It should be also safe in case of reboot(8), because
rc.d/cleanvar script is going to remove /var/run/jail_* files.
It helps to avoid potential mess when the same jail is started twice,
because of an administrator mistake (been there, done that).
Approved by: re (kensmith)
- Add code for Ext2FS and ReiserFS labels recognition.
- Avoid creating directories in devfs by changing all '/' in labels to '_'.
Submitted by: Stanislav Sedov <[email protected]>
PR: kern/84638
Approved by: re (kensmith)
o Remove the obscure tid command, because it does what the thread
command does, but worse.
o Move the PID to the extra thread info, where it makes sense and
where it doesn't confuse users. The extra thread info holds some
process information, to which the PID belongs.
o Implement the to_find_new_threads target method by having it call
the target beneath us if we're not using KVM. This makes sure that
new threads are found when using the remote target.
o Fix various core dump scenarios:
- Implement the to_files_info target method. Previously the
'info target' command would cause a NULL pointer dereference.
- Don't assume there's a current thread. We're not initialized
in all cases. This prevents a NULL pointer dereference.
- When we're not ussing KVM, have the to_xfer_memory target
method call the target beneath us. This avoids calling into
KVM with a NULL pointer.
Approved by: re (kensmith)
o As mentioned in the previous commit: make the KVM error buffer
static.
o Register a function with atexit(3) to close the KVM object if
we have one open.
o Show the unread portion of the kernel's message buffer before
presenting the prompt. It's bound to provide some useful info.
o Don't call kgdb_target() twice. It results in having all threads
listed twice.
Approved by: re (hrs)
sys/sys/pmckern.h:1.5 }
Fail the module loading process if the currently executing kernel
was not compiled with 'options HWPMC_HOOKS' or if the compiled-in
version numbers of the kernel and module are not in sync.
Approved by: re (kensmith)
vm_pager_init() is run before required nswbuf variable has been set
to correct value. This caused system to run with single pbuf available
for vnode_pager. Handle both cluster_pbuf_freecnt and vnode_pbuf_freecnt
variableis in the same way.
Approved by: re (kensmith)
Add NATM_LOCK() and NATM_UNLOCK() in places where npcb_add() and
npcb_free() are called, in order to eliminate witness panics.
This was overlooked in removal of GIANT from ATM.
Approved by: re (hrs)
Remove FreeBSD 2.2 protocol usrreq compatibility code.
Remove minor #ifdefs for early NetBSD and OpenBSD compatibility.
Remove spl-related definitions.
Approved by: re (hrs)
natm_proto.c:1.16 from HEAD to RELENG_6:
Lock down netnatm and mark as MPSAFE:
- Introduce a subsystem mutex, natm_mtx, manipulated with accessor macros
NATM_LOCK_INIT(), NATM_LOCK(), NATM_UNLOCK(), NATM_LOCK_ASSERT(). It
protects the consistency of pcb-related data structures. Finer grained
locking is possible, but should be done in the context of specific
measurements (as very little work is done in netnatm -- most is in the
ATM device driver or socket layer, so there's probably not much
contention).
- Remove GIANT_REQUIRED, mark as NETISR_MPSAFE, remove
NET_NEEDS_GIANT("netnatm").
- Conditionally acquire Giant when entering network interfaces for
ifp->if_ioctl() using IFF_LOCKGIANT(ifp)/IFF_UNLOCKGIANT(ifp) in order
to coexist with non-MPSAFE atm ifnet drivers..
- De-spl.
Reviewed by: harti, bms (various versions)
Approved by: re (hrs)
Insert a series of place-holder function pointers in mac_policy.h for
entry points that will be inserted over the life-time of the 6.x branch,
including for:
- New struct file labeling (void * already added to struct file), events,
access control checks.
- Additional struct mount access control checks, internalization/
externalization.
- mac_check_cap()
- System call enter/exit check and event.
- Socket and vnode ioctl entry points.
Approved by: re (hrs)
Don't perform a nested include of opt_vmpage.h if LIBMEMSTAT is defined,
as opt_vmpage.h will not be available to user space library builds. A
similar existing check is present for KLD_MODULE for similar reasons.
Approved by: re (hrs)
Wrap inlines in uma_int.h in #ifdef _KERNEL so that uma_int.h can be
used from memstat_uma.c for the purposes of kvm access without lots
of additional unsafe includes.
Approved by: re (hrs)
Holding a vnode doesn't prevent v_mount from disappearing (when the
vnode is inactivated), possibly leading to a NULL dereference when
checking if the mount wants knotes to be activated in the VOP hooks.
So, we add a new vnode flag VV_NOKNOTE that is only set in getnewvnode(),
if necessary, and check it when activating knotes.
Since the flags are not erased when a vnode is being held, we can safely
read them.
Approved by: re (kensmith)
HEAD to RELENG_6: changes to introduce a credentialed version of the
clone event handler, and then changes to merge the regular and
credentialed versions into a single interface (along with updates to
existing consumers). With this merge, 6.x and 7.x are in sync.
First batch merges devfs_devs.c:1.37, devfs_vnops.c:1.115,
kern_conf.c:1.187, tty_pty.c:1.138, mac_vfs.c:1.109, mac_biba.c:1.36,
mac_lomac.c:1.36, mac_mls.c:1.73, mac_stub.c:1.53, mac_test.c:1.61,
conf.h:1.223, mac.h:1.68, mac_policy.h:1.67 from HEAD to RELENG_6:
When devfs cloning takes place, provide access to the credential of the
process that caused the clone event to take place for the device driver
creating the device. This allows cloned device drivers to adapt the
device node based on security aspects of the process, such as the uid,
gid, and MAC label.
- Add a cred reference to struct cdev, so that when a device node is
instantiated as a vnode, the cloning credential can be exposed to
MAC.
- Add make_dev_cred(), a version of make_dev() that additionally
accepts the credential to stick in the struct cdev. Implement it and
make_dev() in terms of a back-end make_dev_credv().
- Add a new event handler, dev_clone_cred, which can be registered to
receive the credential instead of dev_clone, if desired.
- Modify the MAC entry point mac_create_devfs_device() to accept an
optional credential pointer (may be NULL), so that MAC policies can
inspect and act on the label or other elements of the credential
when initializing the skeleton device protections.
- Modify tty_pty.c to register clone_dev_cred and invoke make_dev_cred(),
so that the pty clone credential is exposed to the MAC Framework.
While currently primarily focussed on MAC policies, this change is also
a prerequisite for changes to allow ptys to be instantiated with the UID
of the process looking up the pty. This requires further changes to the
pty driver -- in particular, to immediately recycle pty nodes on last
close so that the credential-related state can be recreated on next
lookup.
Submitted by: Andrew Reisse <[email protected]>
Obtained from: TrustedBSD Project
Sponsored by: SPAWAR, SPARTA
Second batch merges scsi_target.c:1.68, coda_fbsd.c:1.43,
firewirereg.h:1.38, fwdev.c:1.47, nmdm.c:1.36, snp.c:1.100, dsp.c:1.82,
mixer.c:1.45, vkbd.c:1.9, devfs_vnops.c:1.117, tty_pty.c:1.139,
tty_tty.c:1.57, bpf.c:1.156, if_tap.c:1.56, if_tun.c:1.153,
smb_dev.c:1.28, conf.h:1.224 from HEAD to RELENG_6:
Merge the dev_clone and dev_clone_cred event handlers into a single
event handler, dev_clone, which accepts a credential argument.
Implementors of the event can ignore it if they're not interested,
and most do. This avoids having multiple event handler types and
fall-back/precedence logic in devfs.
This changes the kernel API for /dev cloning, and may affect third
party packages containg cloning kernel modules.
Requested by: phk
These changes modifies the kernel device driver API for device cloning,
and might require minor modifications to third party device drivers that
make use of devfs cloning. It will not be merged to RELENG_5.
Approved by: re (scottl)
> Use m_copypacket() which is an optimization of the common case
> m_copym(m, 0, M_COPYALL, how).
>
> This is required for strict alignment architectures where we align the
> IP header in the input path but m_copym() will create an unaligned copy
> in bridge_broadcast(). m_copypacket() preserves alignment of the first
> mbuf.
>
> Noticed by: Petri Simolin
> Approved by: mlaier (mentor)
Approved by: re (kensmith), mlaier (mentor)
Don't lock when holding led_mtx, instead use AcpiOsQueueForExecution to defer
the locking.
Idea taken from: acpi_asus(4)
Approved by: philip
Reported by: avatar
Gordon Bergling <[email protected]>
Approved by: re (kensmith)
Add support for IPv6 over GRE [1]. PR kern/80340 includes the
FreeBSD specific ip_newid() changes NetBSD does not have.
Correct handling of non AF_INET packets passed to bpf [2].
PR: kern/80340[1], NetBSD PRs 29150[1], 30844[2]
Obtained from: NetBSD ip_gre.c rev. 1.34,1.35, if_gre.c rev. 1.56
Submitted by: Gert Doering <gert at greenie.muc.de>[2]
Approved by: re (kensmith)
Delay freeing disk space for file system blocks until all
dirty buffers are safely released. This fixes softdep
problems on truncation (deletion) of files with dirty
buffers.
Approved by: re (kensmith)
trap.c r1.55
trap_subr.S r1.15
Temporary band-aid to fix hang when a process exec's Altivec
instructions.
trap_subr.S: declare a stub for the a-unavailable trap
that does an absolute jump to the vector-assist trap.
This is due to the fact that the vec-unavail trap
doesn't start at a 256-byte boundary, so the trick of
masking the bottom 8 bits of the link register to identify
the interrupt doesn't work, so let the vec-assist
case handle Altivec-disabled for the time being.
Note that this will be fixed in the future with a much
smaller vector code-stub (< 16 bytes) that will allow
use of strange vector offsets that are also present in
4xx processors, and also allow smaller differences in
vector codepaths on the G5.
trap.c: Treat altivec-unavailable/assist process traps as SIGILL.
Not quite correct, since altivec-assist should really
be a panic,
but it is fine for the moment due to the above measure.
machdep.c Install the stub code for the altivec-unavailable trap, and
the standard trap code at the altivec-assist.
Approved by: re (Ken Smith)
Correct the description of the TAPE environment variable.
Based on:
PR: docs/84200
Submitted by: Gary W. Swearingen <garys at opusnet dot com>
Approved by: re (hrs)
Remove stale struct ata_channel declaration
Add support for the ITE IT8211F controller
Dont limit all transfers to DEV_BSIZE (stale dbug code)
Hide the loaded/unloaded message behind bootverbose
Approved by: re@
The check for invalid characters introduced in 1.9 incorrectly
flags NIS entries as invalid.
Submitted by: Bob Willcox <[email protected]>
PR: bin/82325 (but I used the patch from Bob).
Approved by: re (kensmith)
date: 2005/07/30 20:00:13; author: csjp; state: Exp; lines: +16 -4
Introduce kdevtoname, which when given the kernel address of a
cdev structure, returns the device name associated with it through
the __si_namebuf member. This un-breaks the processing of devices.
Approved by: re (kensmith)
In adjustrunqueue(), add code to handle thread migrating case for
ULE scheduler. In original code, local run queue of threaded ksegrp
is corrupted if adjustrunqueue() is called while thread is migrating.
Approved by: re (kensmith)
Tested by: delphij
Prevent a race condition. As pf_send_tcp() - called for expired synproxy
states - has to drop the lock when calling back to ip_output(), the state
purge timeout might run and gc the state. This results in a rb-tree
inconsistency. With this change we flag expiring states while holding the
lock and back off if the flag is already set.
Reported by: glebius
Approved by: re (kensmith)
Wireless suport fixups: add a bunch of stuff that's been in the
code but not documented (e.g. wme, mac acl) and correct some
information, etc.
Approved by: re (kensmith)
> We check that all the member interfaces have the same MTU on attach to the
> bridge but the interface can still be changed afterwards.
>
> This falls under the 'dont do that' category but log an warning when INVARIANTS
> is defined.
>
> Approved by: mlaier (mentor)
>
> Revision Changes Path
> 1.14 +8 -0 src/sys/net/if_bridge.c
Approved by: re (kensmith), mlaier (mentor)
Don't try to compile geli(8) when NO_CRYPT knob if defined.
Reported by: Alexander Polakov
Committed to HEAD by: ru
Approved by: re (kensmith (implicit))
g_raid3.h 1.12
Use root_mount KPI for RAID3 to delay root file system mount.
Actually, one cannot setup root file system on RAID3 device, but when
other file system exist in /etc/fstab which are placed on RAID3 device,
boot process will be interrupted when these devices are missing.
Approved by: re (kensmith)
Change /home symbolic link, so it will point to usr/home instead of /usr/home.
Previous symlink was confusing:
# cd /jails/virtual_system_1/home
# realpath .
/usr/home
...and slower.
OK'ed by: rwatson, phk
Approved by: re (kensmith)
Reorganize an_detach() a bit. Make sure ether_ifdetach() and if_free()
are called outside of AN_LOCK()/AN_UNLOCK. This fixes the following
WITNESS warning (produced when an(4) PCMCIA card is detached).
taskqueue_drain with the following non-sleepable locks held:
exclusive sleep mutex an0 (network driver) r = 0 (0xc59af168) locked @ /usr/src/
sys/dev/an/if_an.c:2836
Do not lock an to check gone flag. Only need to hold the lock to set
the gone flag.
Reviewed by: imp
Approved by: re (kemsmith)
memstat_uma.c:1.9 from HEAD to RELENG_6:
Correct two libmemstat(3) bugs:
- Move memory_type_list flushing logic from memstat_mtl_free() to
_memstat_mtl_empty(), a libmemstat-internal function that can
be called from other parts of the library. Invoke
_memstat_mtl_empty() from memstat_mtl_free(), which also frees
the containing list structure.
Invoke _memstat_mtl_empty() instead of memstat_mtl_free() in
various error cases in memstat_malloc.c and memstat_uma.c, which
previously resulted in the list being freed prematurely.
- Reverse the order of updating the mt_kegfree and mt_free fields
of the memory_type in memstat_uma.c, otherwise keg free items
won't be counted properly for non-secondary zones.
Merged to RELENG_6 earlier than the proposed MFC after date so that it
can make BETA2.
Approved by: re (kensmith)
date: 2005/07/30 15:53:40; author: csjp; state: Exp; lines: +2 -1
Add missing parenthesis around error handling code upon attaching
mlx devices. This fixes an issue where mlx device drives fail to be
detected at system boot.
Approved by: re@ (scottl)
date: 2005/07/29 22:40:06; author: mux; state: Exp; lines: +1 -0
Add a new PCI id for fxp(4) cards found on ICH7-based systems.
Submitted by: Martin Nilsson <[email protected]>
Approved by: re@ (kensmith)
Fix the way how "InUse" column in 'vmstat -m' output works:
- increase number of allocations count only on successfull malloc(9),
so it doesn't confuse people;
- because we need to check if 'size > 0', hide 'mtsp->mts_memalloced += size;'
under the check as well, as for size=0 it is of course a no-op;
- avoid critical_enter()/critical_exit() in case of failure in
malloc_type_allocated() as there will be nothing to do.
OK'ed by: rwatson
Approved by: re (kensmith)
- Don't complain when debouncing dhclient startup.
- Fix buffer handling in reveive_packet(). This fixes infinite cpu
eating loops and probably some crashes.
- Spell if_defaultroute route correctly in dhclient-script so we
are allowed to change the default route.
- Document dhclient -b.
- Treat reassociation like association.
- Do not force server-name to be a valid domain name.
- Handle servers that send NUL-terminated host-name options.
Approved by: re (scottl)
o numerous net80211 fixes including fixes for internal bridging,
frag threshold ioctl, rts threshold bounds checking, min wep
length check, reject assoc requests w/ wpa/rsn ie when wpa
is not configured
o misc api changes to reduce differences against forthcoming changes
o add stats for future use and reserve space
o probe inactive neighbors in adhoc mode before timing them out
o debug msg fixups (diff reduction against forthcoming code)
o driver mods to track api changes
Also for ath driver:
o fix diversity handling
o use any fixed antenna setting when sending beacons in adhoc mode
Approved by: re (kensmith)
> devfs is not yet fully MPSAFE - for example, multiple concurrent devfs(8)
> processes can cause a panic when operating on rulesets.
Approved by: re (scottl)
date: 2005/07/27 07:55:12; author: krion; state: Exp; lines: +12 -2
Add -o/-O options to pkg_version:
-o Show the origin recorded on package generation instead of the
package name.
-O Only list packages whose registered origin is origin.
Approved by: re (kensmith)
date: 2005/07/24 17:55:57; author: mux; state: Exp; lines: +1 -2
Add back ed(4) in amd64 GENERIC. It now works nicely and since those
chips are commonly found, it makes sense to have it in GENERIC. This
is a candidate for a RELENG_6 MFC.
Approved by; peter
Requested by: pav
Tested by: pav
Approved by: re@ (kensmith)
Allow PLAY_MSF, PLAY_TRACK, PLAY_TRACK_REL, PAUSE, PLAY_12 commands to pass
through umass(4), in order to make cdcontrol(1) to issue commands to a USB
CD driver.
The command IDs were obtained from the CAM subsystem. This was tested
on half dozen of USB CD drivers from different vendors.
Suggested by: "intron" <intron at intron dot ac>
PR: usb/83439
Reviewed by: sanpei
Approved by: re (kensmith)
Modify "netstat -mb" to use libmemstat(3) when acting on a live system,
with a number of positive benefits:
- Start using UMA(9) statistics for mbufs and clusters, which avoids
using the mbuf allocator statistics which suffer from races under
load on SMP. This should eliminate "negative" mbuf counts in
netstat -mb.
- We are now able to track cached (free) mbufs and clusters and count
it towards memory allocated by the network stack.
- We are now also able to track memory allocated to mbuf tags since
libmemstat(3) can also query malloc(9). We don't print this except
as part of the total (for now - #if 0).
- We are now able to track mbuf/cluster/packet allocation failures,
although they are not currently printed (#if 0).
- Don't print out sfbuf statistics when running on a kernel core, as
currently that code is able only to query sysctl for statistics.
mbuf.c:1.44:
Since libmemstat(3) now supports its own error management mechanism,
use that instead of trying to use errno, in order to produce a
sensible error message.
Approved by: re (kensmith)
If a retrieved UMA zone is a secondary zone, don't report keg free
items, as they actually belong to the primary zone, and maye otherwise
be reported more than once.
Approved by: re (kensmith)
Rename UMA_MAX_NAME to UTH_MAX_NAME, since it's a maximum in the
monitoring API, which might or might not be the same as the internal
maximum (currently none).
Export flag information on UMA zones -- in particular, whether or
not this is a secondary zone, and so the keg free count should be
considered in that light.
Approved by: re (kensmith)
Use an interrupt gate for the NMI handler and prevent too-early
enabling of interrupts inside of trap().
Revert rev 1.113 of "sys/i386/i386/exception.s" as it is no longer
needed.
Approved by: re (kensmith)
> Clear the PROMISC flag from the vlan interface when we remove a member. We
> checked for IFT_L2VLAN in bridge_ioctl_add() but not bridge_delete_member().
>
> Approved by: mlaier (mentor)
>
> Revision Changes Path
> 1.13 +1 -0 src/sys/net/if_bridge.c
Approved by: re (kensmith), mlaier (mentor)
1) An unquoted space is always a separator, even when not "in_arg".
2) When a new destination buffer must be allocated during variable
substitution, only copy data from the active buffer to the new
one when we *are* "in_arg".
3) Fix minor memory leak when expanding ${variable}s
Approved by: re(kensmith)
Add support for AVM BlueFRITZ! USB Bluetooth Adapter v2.0. It appears that
there are at least two versions of the adapter. Version 1 (product ID 0x2200)
of the adapter does not work with ng_ubt(4) and require special driver and
firmware. Version 2 (product ID 0x3800) seems to work just fine, except it
does not have bDeviceClass, bDeviceSubClass and bDeviceProtocol set to required
(by specification) values. This change forces ng_ubt(4) to attach to the
version 2 adapter.
Ignore AVM BlueFRITZ! USB Bluetooth Adapter v1.0 (product ID 0x2200).
It does not work with ng_ubt(4) and require special driver and firmware.
Submitted by: Rainer Goellner < rainer at jabbe dot de >
Approved by: re (kensmith)
Obtained from: Marcel Holtmann < marcel at holtmann dot org >
Remove duplicate initialization of mpo_create_stub pointer.
PR: 83779
Submitted by: Wojciech A. Koszek <dunstan at freebsd dot czest dot pl>
Approved by: re (kensmith)
RELENG_6:
Define four constants, MBUF_{,MEM,CLUSTER,PACKET,TAG}_MEM_NAME, which
are string names for their respective UMA zones and malloc types, and
are passed into uma_zcreate() and MALLOC_DEFINE(). Export them
outside of _KERNEL in mbuf.h so that netstat can reference them.
Change the names to improve consistency, with each zone/type
associated with the mbuf allocator being prefixed mbuf_.
Approved by: re (kensmith)
Add libmemstat(3), a library for use by debugging and monitoring
applications in tracking kernel memory statistics. It provides an
abstracted interface to uma(9) and malloc(9) statistics, wrapped
around the recently added binary stream sysctls for the allocators.
Using this interface, it is easy to build monitoring tools, query
specific memory types for usage information, etc. Facilities are
provided for binding caller-provided data to memory types,
incremental updates of memory types, and queries that span multiple
allocators.
Support for additional allocators is (relatively) easy to add.
The API for libmemstat(3) will probably change some over time as
consumers are written, and requirements evolve. It is written to
avoid encoding ABIs for data structure layout into consuming
applications for this reason.
This change merges all improvements, enhancements, bug fixes, etc, as
of this date. Revisions merged are:
Makefile:1.1-1.3
libmemstat.3:1.1-1.6
memstat.h:1.1-1.7
memstat_all.c:1.1
memstat_internal.h:1.5
memstat_malloc.c:1.1-1.4
memstat_uma.c:1.1-1.7
Approved by: re (kensmith)
Introduce a new sysctl, kern.malloc_stats, which exports kernel malloc
statistics via a binary structure stream:
- Add structure 'malloc_type_stream_header', which defines a stream
version, definition of MAXCPUS used in the stream, and a number of
malloc_type records in the stream.
- Add structure 'malloc_type_header', which defines the name of the
malloc type being reported on.
- When the sysctl is queried, return a stream header, followed by a
series of type descriptions, each consisting of a type header
followed by a series of MAXCPUS malloc_type_stats structures holding
per-CPU allocation information. Typical values of MAXCPUS will be 1
(UP compiled kernel) and 16 (SMP compiled kernel).
This query mechanism allows user space monitoring tools to extract
memory allocation statistics in a machine-readable form, and to do so
at a per-CPU granularity, allowing monitoring of allocation patterns
across CPUs in order to better understand the distribution of work and
memory flow over multiple CPUs.
While here:
- Bump statistics width to uint64_t, and hard code using fixed-width
type in order to be more sure about structure layout in the stream.
We allocate and free a lot of memory.
- Add kmemcount, a counter of the number of registered malloc types,
in order to avoid excessive manual counting of types. Export via a
new sysctl to allow user-space code to better size buffers.
- De-XXX comment on no longer maintaining the high watermark in old
sysctl monitoring code.
A follow-up commit of libmemstat(3), a library to monitor kernel memory
allocation, will occur in the next few days. Likewise, similar changes
to UMA.
kern_malloc.c:1.144:
Correct build on 64-bit: cast u_int64_t to (unsigned long long) before
printfing as (unsigned long long). 32-bit build on i386 didn't notice
this. Whoops.
Reported by: arved
Tested by: sledge
Approved by: re (kensmith)
Export pfsyncstats via sysctl "net.inet.pfsync" in order to print them
with netstat (seperate commit).
Requested by: glebius
Approved by: re (kensmith)
Move eventhandler for 'ifnet_departure_event' at the end of the progress.
Some of the (IPv6) cleanup functions send packets to inform peers of the
departure. These packets confused users of ifnet_departure_event (pf at
the moment).
PR: kern/80627
Tested by: Divacky Roman
Approved by: re (kensmith)
Further UMA statistics related changes:
- Add a new uma_zfree_internal() flag, ZFREE_STATFREE, which causes it to
to update the zone's uz_frees statistic. Previously, the statistic was
updated unconditionally.
- Use the flag in situations where a "real" free occurs: i.e., one where
the caller is freeing an allocated item, to be differentiated from
situations where uma_zfree_internal() is used to tear down the item
during slab teardown in order to invoke its fini() method. Also use
the flag when UMA is freeing its internal objects.
- When exchanging a bucket with the zone from the per-CPU cache when
freeing an item, flush cache statistics back to the zone (since the
zone lock and critical section are both held) to match the allocation
case.
Approved by: re (kensmith)
Use mp_maxid in preference to MAXCPU when creating exports of UMA
per-CPU cache statistics. UMA sizes the cache array based on the
number of CPUs at boot (mp_maxid + 1), and iterating based on MAXCPU
could read off the end of the array (into the next zone).
Reported by: yongari
Approved by: re (kensmith)
RELENG_6:
Improve canonicalization of copyrights. Order copyrights by order of
assertion (jeff, bmilekic, rwatson).
Suggested ages ago by: bde
Approved by: re (kensmith)
Move the unlocking of the zone mutex in sysctl_vm_zone_stats() so that
it covers the following of the uc_alloc/freebucket cache pointers.
Originally, I felt that the race wasn't helped by holding the mutex,
hence a comment in the code and not holding it across the cache access.
However, it does improve consistency, as while it doesn't prevent
bucket exchange, it does prevent bucket pointer invalidation. So a
race in gathering cache free space statistics still can occur, but not
one that follows an invalid bucket pointer, if the mutex is held.
Submitted by: yongari
Approved by: re (kensmith)
RELENG_6:
Track UMA(9) allocation failures by zone, and export via sysctl.
Requested by: victor cruceru <victor dot cruceru at gmail dot com>
Approved by: re (kensmith)
RELENG_6:
Introduce a new sysctl, vm.zone_stats, which exports UMA(9) allocator
statistics via a binary structure stream:
- Add structure 'uma_stream_header', which defines a stream version,
definition of MAXCPUs used in the stream, and the number of zone
records in the stream.
- Add structure 'uma_type_header', which defines the name, alignment,
size, resource allocation limits, current pages allocated, preferred
bucket size, and central zone + keg statistics.
- Add structure 'uma_percpu_stat', which, for each per-CPU cache,
includes the number of allocations and frees, as well as the number
of free items in the cache.
- When the sysctl is queried, return a stream header, followed by a
series of type descriptions, each consisting of a type header
followed by a series of MAXCPUs uma_percpu_stat structures holding
per-CPU allocation information. Typical values of MAXCPU will be
1 (UP compiled kernel) and 16 (SMP compiled kernel).
This query mechanism allows user space monitoring tools to extract
memory allocation statistics in a machine-readable form, and to do so
at a per-CPU granularity, allowing monitoring of allocation patterns
across CPUs in order to better understand the distribution of work and
memory flow over multiple CPUs.
While here, also export the number of UMA zones as a sysctl
vm.uma_count, in order to assist in sizing user swpace buffers to
receive the stream.
A follow-up commit of libmemstat(3), a library to monitor kernel memory
allocation, will occur in the next few days. This change directly
supports converting netstat(1)'s "-mb" mode to using UMA-sourced stats
rather than separately maintained mbuf allocator statistics.
Approved by: re (kensmith)
In an earlier world order, UMA would flush per-CPU statistics to the
zone whenever it was moving buckets between the zone and the cache,
or when coalescing statistics across the CPU. Remove flushing of
statistics to the zone when coalescing statistics as part of sysctl,
as we won't be running on the right CPU to write to the cache
statistics.
Add a missed gathering of statistics: when uma_zalloc_internal()
does a special case allocation of a single item, make sure to update
the zone statistics to represent this. Previously this case wasn't
accounted for in user-visible statistics.
Approved by: re (kensmith)
from struct addrinfo. This change break ABI compatibility on
64 bit arch.
include/netdb.h: 1.39
lib/libc/net/getaddrinfo.c: 1.70
Approved by: re (kensmith)
kbdmux(4) keyboard multiplexer integration
o Teach kbdcontrol(1) how to attach/detach keyboards to/from the keyboard
multiplexor;
o Update kbdcontrol(1) man page and document new functionality.
To attach/detach keyboard to/from keyboard multiplexor one needs to use
keyboard device name (i.e. ukbd0).
Approved by: re (kensmith)
Fix for a NFS soft mounts bug where if the number of retries exceeds
the max rexmits, the request was not being bounced back with a
ETIMEDOUT error.
Approved by: re
ifieee80211.c:1.19 from HEAD to RELENG_6:
Add a new flag '-k' to ifconfig(8), indicating that it is alright to
print potentially sensitive keying material to stdout. With the new
802.11 support, ifconfig(8) is now capable of printing 802.11 keys,
and did by default for the root user, which is undesirable in some
environments. Now it will not print keying material unless requested
(and available to the user).
Approved by: re (kensmith)
Fix the "..." special command. If this command is found all further
commands for this target are appended to the .END target instead
of beeing executed now. They are executed when the graph is finished.
There was a bug with executing the .END target which came in when
doing conversion to LST_FOREACH() which caused make to dump core.
PR: bin/83698
Submitted by: Max Okumoto <[email protected]>
Approved by: re
kbdmux(4) keyboard multiplexer integration
o Add two new ioctl's KBADDKBD and KBRELKBD. These are used to add and remove
keyboard to (and from) kbdmux(4) keyboard multiplexer;
o Introduce new kbd_find_keyboard2() function. It does exactly the same job
as kbd_find_keyboard() function except it allows to specify starting index.
This function can be used to iterate over keyboards array;
o Re-implement kbd_find_keyboard() as call to kbd_find_keyboard2() with starting
index of zero;
o Make sure syscons(4) passed KBADDKBD and KBRELKBD ioctl's onto currently
active keyboard.
These changes should not have any visible effect.
Approved by: re (kensmith)
g_stripe.c 1.26
Before calling g_orphan_provider(), add G_PF_WITHER flag, so GEOM will know
to destroy it.
PR: kern/81758
Submitted by: trasz <[email protected]>
Approved by: re (kensmith)
fix i8254_restore() so that it actually works in the non-lapic timer case
thus unbreaking suspend/resume for several people.
Approved by: re (kensmith)
* Replace fch{mod,own} with straight ch{mod,own} as the former cannot be used
on socket file descriptors
* Open permissions on /var/run/devd.pipe so that any user can read devd events
from this socket
* Enable non-blocking I/O on devd.pipe to keep clients from wedging devd.
If a write(2) on devd.pipe would block, the client in question will be
removed
Approved by: re (kensmith)
date: 2005/07/13 10:40:07; author: delphij; state: Exp; lines: +7 -4
Better memory handling:
- It is acceptable to call free(3) when the given pointer itself
is NULL, so we do not need to determine NULL before passing
a pointer to free(3)
- Handle failure of malloc(3)
Submitted by: Dan Lukes <dan at obluda cz>
PR: bin/83352
Approved by: re (scottl)
- Remove MLINKS to nonexistant manpages
- Change some section numbers to match reality
- For MLINKS to manpages from ports, mention which port installs them
Approved by: re (hrs)
\fBdig\fR (domain information groper) is a flexible tool
for interrogating DNS name servers. It performs DNS lookups and
displays the answers that are returned from the name server(s) that
were queried. Most DNS administrators use \fBdig\fR to
troubleshoot DNS problems because of its flexibility, ease of use and
clarity of output. Other lookup tools tend to have less functionality
than \fBdig\fR.
\fBdig\fR
(domain information groper) is a flexible tool for interrogating DNS name servers. It performs DNS lookups and displays the answers that are returned from the name server(s) that were queried. Most DNS administrators use
\fBdig\fR
to troubleshoot DNS problems because of its flexibility, ease of use and clarity of output. Other lookup tools tend to have less functionality than
\fBdig\fR.
.PP
Although\fBdig\fR is normally used with command-line
arguments, it also has a batch mode of operation for reading lookup
requests from a file. A brief summary of its command-line arguments
and options is printed when the \fB-h\fR option is given.
Unlike earlier versions, the BIND9 implementation of
\fBdig\fR allows multiple lookups to be issued from the
command line.
Although
\fBdig\fR
is normally used with command\-line arguments, it also has a batch mode of operation for reading lookup requests from a file. A brief summary of its command\-line arguments and options is printed when the
\fB\-h\fR
option is given. Unlike earlier versions, the BIND9 implementation of
\fBdig\fR
allows multiple lookups to be issued from the command line.
.PP
Unless it is told to query a specific name server,
\fBdig\fR will try each of the servers listed in
\fBdig\fR
will try each of the servers listed in
\fI/etc/resolv.conf\fR.
.PP
When no command line arguments or options are given, will perform an
NS query for "." (the root).
When no command line arguments or options are given, will perform an NS query for "." (the root).
.PP
It is possible to set per-user defaults for\fBdig\fR via
\fI${HOME}/.digrc\fR. This file is read and any options in it
are applied before the command line arguments.
It is possible to set per\-user defaults for
\fBdig\fR
via
\fI${HOME}/.digrc\fR. This file is read and any options in it are applied before the command line arguments.
.SH"SIMPLE USAGE"
.PP
A typical invocation of\fBdig\fR looks like:
A typical invocation of
\fBdig\fR
looks like:
.sp
.nf
dig @server name type
.sp
.fi
.sp
where:
.TP
\fBserver\fR
is the name or IP address of the name server to query. This can be an IPv4
address in dotted-decimal notation or an IPv6
address in colon-delimited notation. When the supplied
\fIserver\fR argument is a hostname,
\fBdig\fRresolves that name before querying that name
server. If no \fIserver\fR argument is provided,
\fBdig\fR consults \fI/etc/resolv.conf\fR
and queries the name servers listed there. The reply from the name
server that responds is displayed.
is the name or IP address of the name server to query. This can be an IPv4 address in dotted\-decimal notation or an IPv6 address in colon\-delimited notation. When the supplied
\fIserver\fR
argument is a hostname,
\fBdig\fR
resolves that name before querying that name server. If no
\fIserver\fR
argument is provided,
\fBdig\fR
consults
\fI/etc/resolv.conf\fR
and queries the name servers listed there. The reply from the name server that responds is displayed.
.TP
\fBname\fR
is the name of the resource record that is to be looked up.
.TP
\fBtype\fR
indicates what type of query is required \(em
ANY, A, MX, SIG, etc.
\fItype\fRcan be any valid query type. If no
\fItype\fR argument is supplied,
\fBdig\fR will perform a lookup for an A record.
indicates what type of query is required \(em ANY, A, MX, SIG, etc.
\fItype\fR
can be any valid query type. If no
\fItype\fR
argument is supplied,
\fBdig\fR
will perform a lookup for an A record.
.SH"OPTIONS"
.PP
The\fB-b\fR option sets the source IP address of the query
to \fIaddress\fR. This must be a valid address on
one of the host's network interfaces or "0.0.0.0" or "::". An optional port
may be specified by appending "#<port>"
The
\fB\-b\fR
option sets the source IP address of the query to
\fIaddress\fR. This must be a valid address on one of the host's network interfaces or "0.0.0.0" or "::". An optional port may be specified by appending "#<port>"
.PP
The default query class (IN for internet) is overridden by the
\fB-c\fR option. \fIclass\fR is any valid
class, such as HS for Hesiod records or CH for CHAOSNET records.
\fB\-c\fR
option.
\fIclass\fR
is any valid class, such as HS for Hesiod records or CH for CHAOSNET records.
.PP
The\fB-f\fR option makes \fBdig \fR operate
in batch mode by reading a list of lookup requests to process from the
file \fIfilename\fR. The file contains a number of
queries, one per line. Each entry in the file should be organised in
the same way they would be presented as queries to
\fBdig\fR using the command-line interface.
The
\fB\-f\fR
option makes
\fBdig \fR
operate in batch mode by reading a list of lookup requests to process from the file
\fIfilename\fR. The file contains a number of queries, one per line. Each entry in the file should be organised in the same way they would be presented as queries to
\fBdig\fR
using the command\-line interface.
.PP
If a non-standard port number is to be queried, the
\fB-p\fR option is used. \fIport#\fR is
the port number that \fBdig\fR will send its queries
instead of the standard DNS port number 53. This option would be used
to test a name server that has been configured to listen for queries
on a non-standard port number.
If a non\-standard port number is to be queried, the
\fB\-p\fR
option is used.
\fIport#\fR
is the port number that
\fBdig\fR
will send its queries instead of the standard DNS port number 53. This option would be used to test a name server that has been configured to listen for queries on a non\-standard port number.
.PP
The\fB-4\fR option forces \fBdig\fR to only
use IPv4 query transport. The \fB-6\fR option forces
\fBdig\fR to only use IPv6 query transport.
The
\fB\-4\fR
option forces
\fBdig\fR
to only use IPv4 query transport. The
\fB\-6\fR
option forces
\fBdig\fR
to only use IPv6 query transport.
.PP
The\fB-t\fR option sets the query type to
\fItype\fR. It can be any valid query type which is
supported in BIND9. The default query type "A", unless the
\fB-x\fR option is supplied to indicate a reverse lookup.
A zone transfer can be requested by specifying a type of AXFR. When
an incremental zone transfer (IXFR) is required,
\fItype\fR is set to ixfr=N.
The incremental zone transfer will contain the changes made to the zone
since the serial number in the zone's SOA record was
The
\fB\-t\fR
option sets the query type to
\fItype\fR. It can be any valid query type which is supported in BIND9. The default query type "A", unless the
\fB\-x\fR
option is supplied to indicate a reverse lookup. A zone transfer can be requested by specifying a type of AXFR. When an incremental zone transfer (IXFR) is required,
\fItype\fR
is set to
ixfr=N. The incremental zone transfer will contain the changes made to the zone since the serial number in the zone's SOA record was
\fIN\fR.
.PP
Reverse lookups - mapping addresses to names - are simplified by the
\fB-x\fR option. \fIaddr\fR is an IPv4
address in dotted-decimal notation, or a colon-delimited IPv6 address.
When this option is used, there is no need to provide the
\fIname\fR, \fIclass\fR and
\fItype\fR arguments. \fBdig\fR
Reverse lookups \- mapping addresses to names \- are simplified by the
\fB\-x\fR
option.
\fIaddr\fR
is an IPv4 address in dotted\-decimal notation, or a colon\-delimited IPv6 address. When this option is used, there is no need to provide the
\fIname\fR,
\fIclass\fR
and
\fItype\fR
arguments.
\fBdig\fR
automatically performs a lookup for a name like
11.12.13.10.in-addr.arpa and sets the query type and
class to PTR and IN respectively. By default, IPv6 addresses are
looked up using nibble format under the IP6.ARPA domain.
To use the older RFC1886 method using the IP6.INT domain
specify the \fB-i\fR option. Bit string labels (RFC2874)
are now experimental and are not attempted.
11.12.13.10.in\-addr.arpa
and sets the query type and class to PTR and IN respectively. By default, IPv6 addresses are looked up using nibble format under the IP6.ARPA domain. To use the older RFC1886 method using the IP6.INT domain specify the
\fB\-i\fR
option. Bit string labels (RFC2874) are now experimental and are not attempted.
.PP
To sign the DNS queries sent by\fBdig\fR and their
responses using transaction signatures (TSIG), specify a TSIG key file
using the \fB-k\fR option. You can also specify the TSIG
key itself on the command line using the \fB-y\fR option;
\fIname\fR is the name of the TSIG key and
\fIkey\fR is the actual key. The key is a base-64
encoded string, typically generated by \fBdnssec-keygen\fR(8).
Caution should be taken when using the \fB-y\fR option on
multi-user systems as the key can be visible in the output from
\fBps\fR(1) or in the shell's history file. When
using TSIG authentication with \fBdig\fR, the name
server that is queried needs to know the key and algorithm that is
being used. In BIND, this is done by providing appropriate
\fBkey\fR and \fBserver\fR statements in
To sign the DNS queries sent by
\fBdig\fR
and their responses using transaction signatures (TSIG), specify a TSIG key file using the
\fB\-k\fR
option. You can also specify the TSIG key itself on the command line using the
\fB\-y\fR
option;
\fIname\fR
is the name of the TSIG key and
\fIkey\fR
is the actual key. The key is a base\-64 encoded string, typically generated by
\fBdnssec\-keygen\fR(8). Caution should be taken when using the
\fB\-y\fR
option on multi\-user systems as the key can be visible in the output from
\fBps\fR(1 )
or in the shell's history file. When using TSIG authentication with
\fBdig\fR, the name server that is queried needs to know the key and algorithm that is being used. In BIND, this is done by providing appropriate
\fBkey\fR
and
\fBserver\fR
statements in
\fInamed.conf\fR.
.SH"QUERY OPTIONS"
.PP
\fBdig\fR provides a number of query options which affect
the way in which lookups are made and the results displayed. Some of
these set or reset flag bits in the query header, some determine which
sections of the answer get printed, and others determine the timeout
and retry strategies.
\fBdig\fR
provides a number of query options which affect the way in which lookups are made and the results displayed. Some of these set or reset flag bits in the query header, some determine which sections of the answer get printed, and others determine the timeout and retry strategies.
.PP
Each query option is identified by a keyword preceded by a plus sign
(+). Some keywords set or reset an option. These may be preceded
by the string no to negate the meaning of that keyword. Other
keywords assign values to options like the timeout interval. They
have the form \fB+keyword=value\fR.
The query options are:
Each query option is identified by a keyword preceded by a plus sign (+). Some keywords set or reset an option. These may be preceded by the string
no
to negate the meaning of that keyword. Other keywords assign values to options like the timeout interval. They have the form
\fB+keyword=value\fR. The query options are:
.TP
\fB+[no]tcp\fR
Use [do not use] TCP when querying name servers. The default
behaviour is to use UDP unless an AXFR or IXFR query is requested, in
which case a TCP connection is used.
Use [do not use] TCP when querying name servers. The default behaviour is to use UDP unless an AXFR or IXFR query is requested, in which case a TCP connection is used.
.TP
\fB+[no]vc\fR
Use [do not use] TCP when querying name servers. This alternate
syntax to \fI+[no]tcp\fR is provided for backwards
compatibility. The "vc" stands for "virtual circuit".
Use [do not use] TCP when querying name servers. This alternate syntax to
\fI+[no]tcp\fR
is provided for backwards compatibility. The "vc" stands for "virtual circuit".
.TP
\fB+[no]ignore\fR
Ignore truncation in UDP responses instead of retrying with TCP. By
default, TCP retries are performed.
Ignore truncation in UDP responses instead of retrying with TCP. By default, TCP retries are performed.
.TP
\fB+domain=somename\fR
Set the search list to contain the single domain
\fIsomename\fR, as if specified in a
\fBdomain\fR directive in
\fI/etc/resolv.conf\fR, and enable search list
processing as if the \fI+search\fR option were given.
\fBdomain\fR
directive in
\fI/etc/resolv.conf\fR, and enable search list processing as if the
\fI+search\fR
option were given.
.TP
\fB+[no]search\fR
Use [do not use] the search list defined by the searchlist or domain
directive in \fIresolv.conf\fR (if any).
The search list is not used by default.
Use [do not use] the search list defined by the searchlist or domain directive in
\fIresolv.conf\fR
(if any). The search list is not used by default.
.TP
\fB+[no]defname\fR
Deprecated, treated as a synonym for\fI+[no]search\fR
Deprecated, treated as a synonym for
\fI+[no]search\fR
.TP
\fB+[no]aaonly\fR
Sets the "aa" flag in the query.
.TP
\fB+[no]aaflag\fR
A synonym for\fI+[no]aaonly\fR.
A synonym for
\fI+[no]aaonly\fR.
.TP
\fB+[no]adflag\fR
Set [do not set] the AD (authentic data) bit in the query. The AD bit
currently has a standard meaning only in responses, not in queries,
but the ability to set the bit in the query is provided for
completeness.
Set [do not set] the AD (authentic data) bit in the query. The AD bit currently has a standard meaning only in responses, not in queries, but the ability to set the bit in the query is provided for completeness.
.TP
\fB+[no]cdflag\fR
Set [do not set] the CD (checking disabled) bit in the query. This
requests the server to not perform DNSSEC validation of responses.
Set [do not set] the CD (checking disabled) bit in the query. This requests the server to not perform DNSSEC validation of responses.
.TP
\fB+[no]cl\fR
Display [do not display] the CLASS when printing the record.
@@ -219,170 +247,164 @@ Display [do not display] the CLASS when printing the record.
Display [do not display] the TTL when printing the record.
.TP
\fB+[no]recurse\fR
Toggle the setting of the RD (recursion desired) bit in the query.
This bit is set by default, which means \fBdig\fR
normally sends recursive queries. Recursion is automatically disabled
when the \fI+nssearch\fR or
\fI+trace\fR query options are used.
Toggle the setting of the RD (recursion desired) bit in the query. This bit is set by default, which means
\fBdig\fR
normally sends recursive queries. Recursion is automatically disabled when the
\fI+nssearch\fR
or
\fI+trace\fR
query options are used.
.TP
\fB+[no]nssearch\fR
When this option is set,\fBdig\fR attempts to find the
authoritative name servers for the zone containing the name being
looked up and display the SOA record that each name server has for the
zone.
When this option is set,
\fBdig\fR
attempts to find the authoritative name servers for the zone containing the name being looked up and display the SOA record that each name server has for the zone.
.TP
\fB+[no]trace\fR
Toggle tracing of the delegation path from the root name servers for
the name being looked up. Tracing is disabled by default. When
tracing is enabled, \fBdig\fR makes iterative queries to
resolve the name being looked up. It will follow referrals from the
root servers, showing the answer from each server that was used to
resolve the lookup.
Toggle tracing of the delegation path from the root name servers for the name being looked up. Tracing is disabled by default. When tracing is enabled,
\fBdig\fR
makes iterative queries to resolve the name being looked up. It will follow referrals from the root servers, showing the answer from each server that was used to resolve the lookup.
.TP
\fB+[no]cmd\fR
toggles the printing of the initial comment in the output identifying
the version of \fBdig\fR and the query options that have
been applied. This comment is printed by default.
toggles the printing of the initial comment in the output identifying the version of
\fBdig\fR
and the query options that have been applied. This comment is printed by default.
.TP
\fB+[no]short\fR
Provide a terse answer. The default is to print the answer in a
verbose form.
Provide a terse answer. The default is to print the answer in a verbose form.
.TP
\fB+[no]identify\fR
Show [or do not show] the IP address and port number that supplied the
answer when the \fI+short\fR option is enabled. If
short form answers are requested, the default is not to show the
source address and port number of the server that provided the answer.
Show [or do not show] the IP address and port number that supplied the answer when the
\fI+short\fR
option is enabled. If short form answers are requested, the default is not to show the source address and port number of the server that provided the answer.
.TP
\fB+[no]comments\fR
Toggle the display of comment lines in the output. The default is to
print comments.
Toggle the display of comment lines in the output. The default is to print comments.
.TP
\fB+[no]stats\fR
This query option toggles the printing of statistics: when the query
was made, the size of the reply and so on. The default behaviour is
to print the query statistics.
This query option toggles the printing of statistics: when the query was made, the size of the reply and so on. The default behaviour is to print the query statistics.
.TP
\fB+[no]qr\fR
Print [do not print] the query as it is sent.
By default, the query is not printed.
Print [do not print] the query as it is sent. By default, the query is not printed.
.TP
\fB+[no]question\fR
Print [do not print] the question section of a query when an answer is
returned. The default is to print the question section as a comment.
Print [do not print] the question section of a query when an answer is returned. The default is to print the question section as a comment.
.TP
\fB+[no]answer\fR
Display [do not display] the answer section of a reply. The default
is to display it.
Display [do not display] the answer section of a reply. The default is to display it.
.TP
\fB+[no]authority\fR
Display [do not display] the authority section of a reply. The
default is to display it.
Display [do not display] the authority section of a reply. The default is to display it.
.TP
\fB+[no]additional\fR
Display [do not display] the additional section of a reply.
The default is to display it.
Display [do not display] the additional section of a reply. The default is to display it.
.TP
\fB+[no]all\fR
Set or clear all display flags.
.TP
\fB+time=T\fR
Sets the timeout for a query to
\fIT\fR seconds. The default time out is 5 seconds.
An attempt to set \fIT\fR to less than 1 will result
in a query timeout of 1 second being applied.
\fIT\fR
seconds. The default time out is 5 seconds. An attempt to set
\fIT\fR
to less than 1 will result in a query timeout of 1 second being applied.
.TP
\fB+tries=T\fR
Sets the number of times to try UDP queries to server to
\fIT\fR instead of the default, 3. If
\fIT\fR is less than or equal to zero, the number of
tries is silently rounded up to 1.
\fIT\fR
instead of the default, 3. If
\fIT\fR
is less than or equal to zero, the number of tries is silently rounded up to 1.
.TP
\fB+retry=T\fR
Sets the number of times to retry UDP queries to server to
\fIT\fR instead of the default, 2. Unlike
\fI+tries\fR, this does not include the initial
query.
\fIT\fR
instead of the default, 2. Unlike
\fI+tries\fR, this does not include the initial query.
.TP
\fB+ndots=D\fR
Set the number of dots that have to appear in
\fIname\fR to \fID\fR for it to be
considered absolute. The default value is that defined using the
ndots statement in \fI/etc/resolv.conf\fR, or 1 if no
ndots statement is present. Names with fewer dots are interpreted as
relative names and will be searched for in the domains listed in the
\fBsearch\fR or \fBdomain\fR directive in
\fIname\fR
to
\fID\fR
for it to be considered absolute. The default value is that defined using the ndots statement in
\fI/etc/resolv.conf\fR, or 1 if no ndots statement is present. Names with fewer dots are interpreted as relative names and will be searched for in the domains listed in the
\fBsearch\fR
or
\fBdomain\fR
directive in
\fI/etc/resolv.conf\fR.
.TP
\fB+bufsize=B\fR
Set the UDP message buffer size advertised using EDNS0 to
\fIB\fR bytes. The maximum and minimum sizes of this
buffer are 65535 and 0 respectively. Values outside this range are
rounded up or down appropriately.
\fIB\fR
bytes. The maximum and minimum sizes of this buffer are 65535 and 0 respectively. Values outside this range are rounded up or down appropriately.
.TP
\fB+[no]multiline\fR
Print records like the SOA records in a verbose multi-line
format with human-readable comments. The default is to print
each record on a single line, to facilitate machine parsing
of the \fBdig\fR output.
Print records like the SOA records in a verbose multi\-line format with human\-readable comments. The default is to print each record on a single line, to facilitate machine parsing of the
\fBdig\fR
output.
.TP
\fB+[no]fail\fR
Do not try the next server if you receive a SERVFAIL. The default is
to not try the next server which is the reverse of normal stub resolver
behaviour.
Do not try the next server if you receive a SERVFAIL. The default is to not try the next server which is the reverse of normal stub resolver behaviour.
.TP
\fB+[no]besteffort\fR
Attempt to display the contents of messages which are malformed.
The default is to not display malformed answers.
Attempt to display the contents of messages which are malformed. The default is to not display malformed answers.
.TP
\fB+[no]dnssec\fR
Requests DNSSEC records be sent by setting the DNSSEC OK bit (DO)
in the OPT record in the additional section of the query.
Requests DNSSEC records be sent by setting the DNSSEC OK bit (DO) in the OPT record in the additional section of the query.
.TP
\fB+[no]sigchase\fR
Chase DNSSEC signature chains. Requires dig be compiled with
-DDIG_SIGCHASE.
Chase DNSSEC signature chains. Requires dig be compiled with\-DDIG_SIGCHASE.
.TP
\fB+trusted-key=####\fR
Specify a trusted key to be used with\fB+sigchase\fR.
Requires dig be compiled with -DDIG_SIGCHASE.
\fB+trusted\-key=####\fR
Specifies a file containing trusted keys to be used with
\fB+sigchase\fR. Each DNSKEY record must be on its own line.
.sp
If not specified
\fBdig\fR
will look for
\fI/etc/trusted\-key.key\fR
then
\fItrusted\-key.key\fR
in the current directory.
.sp
Requires dig be compiled with \-DDIG_SIGCHASE.
.TP
\fB+[no]topdown\fR
When chasing DNSSEC signature chains perform a top down validation.
Requires dig be compiled with -DDIG_SIGCHASE.
When chasing DNSSEC signature chains perform a top down validation. Requires dig be compiled with \-DDIG_SIGCHASE.
.SH"MULTIPLE QUERIES"
.PP
The BIND 9 implementation of\fBdig \fR supports
specifying multiple queries on the command line (in addition to
supporting the \fB-f\fR batch file option). Each of those
queries can be supplied with its own set of flags, options and query
options.
The BIND 9 implementation of
\fBdig \fR
supports specifying multiple queries on the command line (in addition to supporting the
\fB\-f\fR
batch file option). Each of those queries can be supplied with its own set of flags, options and query options.
.PP
In this case, each\fIquery\fR argument represent an
individual query in the command-line syntax described above. Each
consists of any of the standard options and flags, the name to be
looked up, an optional query type and class and any query options that
should be applied to that query.
In this case, each
\fIquery\fR
argument represent an individual query in the command\-line syntax described above. Each consists of any of the standard options and flags, the name to be looked up, an optional query type and class and any query options that should be applied to that query.
.PP
A global set of query options, which should be applied to all queries,
can also be supplied. These global query options must precede the
first tuple of name, class, type, options, flags, and query options
supplied on the command line. Any global query options (except
the \fB+[no]cmd\fR option) can be
overridden by a query-specific set of query options. For example:
A global set of query options, which should be applied to all queries, can also be supplied. These global query options must precede the first tuple of name, class, type, options, flags, and query options supplied on the command line. Any global query options (except the
\fB+[no]cmd\fR
option) can be overridden by a query\-specific set of query options. For example:
.sp
.nf
dig +qr www.isc.org any -x 127.0.0.1 isc.org ns +noqr
.sp
dig +qr www.isc.org any \-x 127.0.0.1 isc.org ns +noqr
.fi
shows how \fBdig\fR could be used from the command line
to make three lookups: an ANY query for www.isc.org, a
reverse lookup of 127.0.0.1 and a query for the NS records of
isc.org.
A global query option of \fI+qr\fR is applied, so
that \fBdig\fR shows the initial query it made for each
lookup. The final query has a local query option of
\fI+noqr\fR which means that \fBdig\fR
.sp
shows how
\fBdig\fR
could be used from the command line to make three lookups: an ANY query for
www.isc.org, a reverse lookup of 127.0.0.1 and a query for the NS records of
isc.org. A global query option of
\fI+qr\fR
is applied, so that
\fBdig\fR
shows the initial query it made for each lookup. The final query has a local query option of
\fI+noqr\fR
which means that
\fBdig\fR
will not print the initial query when it looks up the NS records for
It is normally used to convert names to IP addresses and vice versa.
When no arguments or options are given,
is a simple utility for performing DNS lookups. It is normally used to convert names to IP addresses and vice versa. When no arguments or options are given,
\fBhost\fR
prints a short summary of its command line arguments and options.
.PP
\fIname\fR is the domain name that is to be looked
up. It can also be a dotted-decimal IPv4 address or a colon-delimited
IPv6 address, in which case \fBhost\fR will by default
perform a reverse lookup for that address.
\fIserver\fR is an optional argument which is either
the name or IP address of the name server that\fBhost\fR
\fIname\fR
is the domain name that is to be looked up. It can also be a dotted\-decimal IPv4 address or a colon\-delimited IPv6 address, in which case
\fBhost\fR
will by default perform a reverse lookup for that address.
\fIserver\fR
is an optional argument which is either the name or IP address of the name server that
\fBhost\fR
should query instead of the server or servers listed in
\fI/etc/resolv.conf\fR.
.PP
The\fB-a\fR (all) option is equivalent to setting the
\fB-v\fR option and asking \fBhost\fR to make
a query of type ANY.
The
\fB\-a\fR
(all) option is equivalent to setting the
\fB\-v\fR
option and asking
\fBhost\fR
to make a query of type ANY.
.PP
When the\fB-C\fR option is used, \fBhost\fR
When the
\fB\-C\fR
option is used,
\fBhost\fR
will attempt to display the SOA records for zone
\fIname\fR from all the listed authoritative name
servers for that zone. The list of name servers is defined by the NS
records that are found for the zone.
\fIname\fR
from all the listed authoritative name servers for that zone. The list of name servers is defined by the NS records that are found for the zone.
.PP
The\fB-c\fR option instructs to make a DNS query of class
\fIclass\fR. This can be used to lookup Hesiod or
Chaosnet class resource records. The default class is IN (Internet).
The
\fB\-c\fR
option instructs to make a DNS query of class
\fIclass\fR. This can be used to lookup Hesiod or Chaosnet class resource records. The default class is IN (Internet).
.PP
Verbose output is generated by\fBhost\fR when the
\fB-d\fR or \fB-v\fR option is used. The two
options are equivalent. They have been provided for backwards
compatibility. In previous versions, the \fB-d\fR option
switched on debugging traces and \fB-v\fR enabled verbose
output.
Verbose output is generated by
\fBhost\fR
when the
\fB\-d\fR
or
\fB\-v\fR
option is used. The two options are equivalent. They have been provided for backwards compatibility. In previous versions, the
\fB\-d\fR
option switched on debugging traces and
\fB\-v\fR
enabled verbose output.
.PP
List mode is selected by the\fB-l\fR option. This makes
\fBhost\fR perform a zone transfer for zone
\fIname\fR. Transfer the zone printing out the NS, PTR
and address records (A/AAAA). If combined with \fB-a\fR
all records will be printed.
List mode is selected by the
\fB\-l\fR
option. This makes
\fBhost\fR
perform a zone transfer for zone
\fIname\fR. Transfer the zone printing out the NS, PTR and address records (A/AAAA). If combined with
\fB\-a\fR
all records will be printed.
.PP
The\fB-i\fR
option specifies that reverse lookups of IPv6 addresses should
use the IP6.INT domain as defined in RFC1886.
The default is to use IP6.ARPA.
The
\fB\-i\fR
option specifies that reverse lookups of IPv6 addresses should use the IP6.INT domain as defined in RFC1886. The default is to use IP6.ARPA.
.PP
The\fB-N\fR option sets the number of dots that have to be
in \fIname\fR for it to be considered absolute. The
default value is that defined using the ndots statement in
\fI/etc/resolv.conf\fR, or 1 if no ndots statement is
present. Names with fewer dots are interpreted as relative names and
will be searched for in the domains listed in the\fBsearch\fR
or \fBdomain\fR directive in
The
\fB\-N\fR
option sets the number of dots that have to be in
\fIname\fR
for it to be considered absolute. The default value is that defined using the ndots statement in
\fI/etc/resolv.conf\fR, or 1 if no ndots statement is present. Names with fewer dots are interpreted as relative names and will be searched for in the domains listed in the
\fBsearch\fR
or
\fBdomain\fR
directive in
\fI/etc/resolv.conf\fR.
.PP
The number of UDP retries for a lookup can be changed with the
\fB-R\fR option. \fInumber\fR indicates
how many times \fBhost\fR will repeat a query that does
not get answered. The default number of retries is 1. If
\fInumber\fR is negative or zero, the number of
retries will default to 1.
\fB\-R\fR
option.
\fInumber\fR
indicates how many times
\fBhost\fR
will repeat a query that does not get answered. The default number of retries is 1. If
\fInumber\fR
is negative or zero, the number of retries will default to 1.
.PP
Non-recursive queries can be made via the\fB-r\fR option.
Setting this option clears the \fBRD\fR\(em recursion
desired \(em bit in the query which \fBhost\fR makes.
This should mean that the name server receiving the query will not
attempt to resolve \fIname\fR. The
\fB-r\fR option enables \fBhost\fR to mimic
the behaviour of a name server by making non-recursive queries and
expecting to receive answers to those queries that are usually
referrals to other name servers.
Non\-recursive queries can be made via the
\fB\-r\fR
option. Setting this option clears the
\fBRD\fR
\(em recursion desired \(em bit in the query which
\fBhost\fR
makes. This should mean that the name server receiving the query will not attempt to resolve
\fIname\fR. The
\fB\-r\fR
option enables
\fBhost\fR
to mimic the behaviour of a name server by making non\-recursive queries and expecting to receive answers to those queries that are usually referrals to other name servers.
.PP
By default\fBhost\fR uses UDP when making queries. The
\fB-T\fR option makes it use a TCP connection when querying
the name server. TCP will be automatically selected for queries that
require it, such as zone transfer (AXFR) requests.
By default
\fBhost\fR
uses UDP when making queries. The
\fB\-T\fR
option makes it use a TCP connection when querying the name server. TCP will be automatically selected for queries that require it, such as zone transfer (AXFR) requests.
.PP
The\fB-4\fR option forces \fBhost\fR to only
use IPv4 query transport. The \fB-6\fR option forces
\fBhost\fR to only use IPv6 query transport.
The
\fB\-4\fR
option forces
\fBhost\fR
to only use IPv4 query transport. The
\fB\-6\fR
option forces
\fBhost\fR
to only use IPv6 query transport.
.PP
The\fB-t\fR option is used to select the query type.
\fItype\fR can be any recognised query type: CNAME,
NS, SOA, SIG, KEY, AXFR, etc. When no query type is specified,
\fBhost\fR automatically selects an appropriate query
type. By default it looks for A records, but if the
\fB-C\fR option was given, queries will be made for SOA
records, and if \fIname\fR is a dotted-decimal IPv4
address or colon-delimited IPv6 address, \fBhost\fR will
query for PTR records. If a query type of IXFR is chosen the starting
serial number can be specified by appending an equal followed by the
starting serial number (e.g. -t IXFR=12345678).
The
\fB\-t\fR
option is used to select the query type.
\fItype\fR
can be any recognised query type: CNAME, NS, SOA, SIG, KEY, AXFR, etc. When no query type is specified,
\fBhost\fR
automatically selects an appropriate query type. By default it looks for A records, but if the
\fB\-C\fR
option was given, queries will be made for SOA records, and if
\fIname\fR
is a dotted\-decimal IPv4 address or colon\-delimited IPv6 address,
\fBhost\fR
will query for PTR records. If a query type of IXFR is chosen the starting serial number can be specified by appending an equal followed by the starting serial number (e.g. \-t IXFR=12345678).
.PP
The time to wait for a reply can be controlled through the
\fB-W\fR and \fB-w\fR options. The
\fB-W\fR option makes \fBhost\fR wait for
\fIwait\fR seconds. If \fIwait\fR
\fB\-W\fR
and
\fB\-w\fR
options. The
\fB\-W\fR
option makes
\fBhost\fR
wait for
\fIwait\fR
seconds. If
\fIwait\fR
is less than one, the wait interval is set to one second. When the
\fB-w\fR option is used, \fBhost\fR will
effectively wait forever for a reply. The time to wait for a response
will be set to the number of seconds given by the hardware's maximum
value for an integer quantity.
\fB\-w\fR
option is used,
\fBhost\fR
will effectively wait forever for a reply. The time to wait for a response will be set to the number of seconds given by the hardware's maximum value for an integer quantity.
is a program to query Internet domain name servers.\fBNslookup\fR
has two modes: interactive and non-interactive. Interactive mode allows
the user to query name servers for information about various hosts and
domains or to print a list of hosts in a domain. Non-interactive mode is
used to print just the name and requested information for a host or
domain.
is a program to query Internet domain name servers.
\fBNslookup\fR
has two modes: interactive and non\-interactive. Interactive mode allows the user to query name servers for information about various hosts and domains or to print a list of hosts in a domain. Non\-interactive mode is used to print just the name and requested information for a host or domain.
.SH"ARGUMENTS"
.PP
Interactive mode is entered in the following cases:
.IP1.
.TP3
1.
when no arguments are given (the default name server will be used)
.IP2.
when the first argument is a hyphen (-) and the second argument is
the host name or Internet address of a name server.
.TP
2.
when the first argument is a hyphen (\-) and the second argument is the host name or Internet address of a name server.
.PP
Non-interactive mode is used when the name or Internet address of the
host to be looked up is given as the first argument. The optional second
argument specifies the host name or address of a name server.
Non\-interactive mode is used when the name or Internet address of the host to be looked up is given as the first argument. The optional second argument specifies the host name or address of a name server.
.PP
Options can also be specified on the command line if they precede the
arguments and are prefixed with a hyphen. For example, to
change the default query type to host information, and the initial timeout to 10 seconds, type:
.PP
.sp
.nf
nslookup -query=hinfo -timeout=10
.sp
.fi
Options can also be specified on the command line if they precede the arguments and are prefixed with a hyphen. For example, to change the default query type to host information, and the initial timeout to 10 seconds, type:
.IP.sp.nfnslookup\-query=hinfo\-timeout=10.fi
.SH"INTERACTIVE COMMANDS"
.TP
\fBhost [server]\fR
Look up information for host using the current default server or
using server, if specified. If host is an Internet address and
the query type is A or PTR, the name of the host is returned.
If host is a name and does not have a trailing period, the
search list is used to qualify the name.
To look up a host not in the current domain, append a period to
the name.
host [server]
Look up information for host using the current default server or using server, if specified. If host is an Internet address and the query type is A or PTR, the name of the host is returned. If host is a name and does not have a trailing period, the search list is used to qualify the name.
.sp
To look up a host not in the current domain, append a period to the name.
.TP
\fBserver \fIdomain\fB\fR
\fBserver\fR\fIdomain\fR
.TP
\fBlserver \fIdomain\fB\fR
Change the default server to\fIdomain\fR; lserver uses the initial
server to look up information about \fIdomain\fR, while server uses
the current default server. If an authoritative answer can't be
found, the names of servers that might have the answer are
returned.
\fBlserver\fR\fIdomain\fR
Change the default server to
\fIdomain\fR;
\fBlserver\fR
uses the initial server to look up information about
\fIdomain\fR, while
\fBserver\fR
uses the current default server. If an authoritative answer can't be found, the names of servers that might have the answer are returned.
.TP
\fBroot\fR
not implemented
@@ -93,17 +89,15 @@ not implemented
\fBexit\fR
Exits the program.
.TP
\fBset \fIkeyword[=value]\fB\fR
This command is used to change state information that affects
the lookups. Valid keywords are:
\fBset\fR\fIkeyword\fR\fI[=value]\fR
This command is used to change state information that affects the lookups. Valid keywords are:
.RS
.TP
\fBall\fR
Prints the current values of the frequently used
options to \fBset\fR. Information about the current default
server and host is also printed.
Prints the current values of the frequently used options to
\fBset\fR. Information about the current default server and host is also printed.
.TP
\fBclass=\fIvalue\fB\fR
\fBclass=\fR\fIvalue\fR
Change the query class to one of:
.RS
.TP
@@ -119,66 +113,61 @@ the Hesiod class
\fBANY\fR
wildcard
.RE
.PP
.IP
The class specifies the protocol group of the information.
.sp
(Default = IN; abbreviation = cl)
.TP
\fB\fI[no]\fBdebug\fR
Turn debugging mode on. A lot more information is
printed about the packet sent to the server and the
resulting answer.
(Default = nodebug; abbreviation = [no]deb)
\fB\fI[no]\fR\fR\fBdebug\fR
Turn debugging mode on. A lot more information is printed about the packet sent to the server and the resulting answer.
.sp
(Default = nodebug; abbreviation =
[no]deb)
.TP
\fB\fI[no]\fBd2\fR
Turn debugging mode on. A lot more information is
printed about the packet sent to the server and the
resulting answer.
\fB\fI[no]\fR\fR\fBd2\fR
Turn debugging mode on. A lot more information is printed about the packet sent to the server and the resulting answer.
.sp
(Default = nod2)
.TP
\fBdomain=\fIname\fB\fR
Sets the search list to\fIname\fR.
\fBdomain=\fR\fIname\fR
Sets the search list to
\fIname\fR.
.TP
\fB\fI[no]\fBsearch\fR
If the lookup request contains at least one period but
doesn't end with a trailing period, append the domain
names in the domain search list to the request until an
answer is received.
\fB\fI[no]\fR\fR\fBsearch\fR
If the lookup request contains at least one period but doesn't end with a trailing period, append the domain names in the domain search list to the request until an answer is received.
.sp
(Default = search)
.TP
\fBport=\fIvalue\fB\fR
Change the default TCP/UDP name server port to\fIvalue\fR.
\fBport=\fR\fIvalue\fR
Change the default TCP/UDP name server port to
\fIvalue\fR.
.sp
(Default = 53; abbreviation = po)
.TP
\fBquerytype=\fIvalue\fB\fR
\fBquerytype=\fR\fIvalue\fR
.TP
\fBtype=\fIvalue\fB\fR
\fBtype=\fR\fIvalue\fR
Change the top of the information query.
.sp
(Default = A; abbreviations = q, ty)
.TP
\fB\fI[no]\fBrecurse\fR
Tell the name server to query other servers if it does not have the
information.
\fB\fI[no]\fR\fR\fBrecurse\fR
Tell the name server to query other servers if it does not have the information.
.sp
(Default = recurse; abbreviation = [no]rec)
.TP
\fBretry=\fInumber\fB\fR
\fBretry=\fR\fInumber\fR
Set the number of retries to number.
.TP
\fBtimeout=\fInumber\fB\fR
Change the initial timeout interval for waiting for a
reply to number seconds.
\fBtimeout=\fR\fInumber\fR
Change the initial timeout interval for waiting for a reply to number seconds.
.TP
\fB\fI[no]\fBvc\fR
\fB\fI[no]\fR\fR\fBvc\fR
Always use a virtual circuit when sending requests to the server.
(Secure DNS), as defined in RFC 2535 and RFC <TBA\\>. It can also generate
keys for use with TSIG (Transaction Signatures), as
defined in RFC 2845.
\fBdnssec\-keygen\fR
generates keys for DNSSEC (Secure DNS), as defined in RFC 2535 and RFC <TBA\\>. It can also generate keys for use with TSIG (Transaction Signatures), as defined in RFC 2845.
.SH "OPTIONS"
.TP
\fB-a \fIalgorithm\fB\fR
\-a \fIalgorithm\fR
Selects the cryptographic algorithm. The value of
\fBalgorithm\fR must be one of RSAMD5 (RSA) or RSASHA1,
DSA, DH (Diffie Hellman), or HMAC-MD5. These values
are case insensitive.
Note 1: that for DNSSEC, RSASHA1 is a mandatory to implement algorithm,
and DSA is recommended. For TSIG, HMAC-MD5 is mandatory.
Note 2: HMAC-MD5 and DH automatically set the -k flag.
\fBalgorithm\fR
must be one of RSAMD5 (RSA) or RSASHA1, DSA, DH (Diffie Hellman), or HMAC\-MD5. These values are case insensitive.
.sp
Note 1: that for DNSSEC, RSASHA1 is a mandatory to implement algorithm, and DSA is recommended. For TSIG, HMAC\-MD5 is mandatory.
.sp
Note 2: HMAC\-MD5 and DH automatically set the \-k flag.
.TP
\fB-b \fIkeysize\fB\fR
Specifies the number of bits in the key. The choice of key
size depends on the algorithm used. RSAMD5 / RSASHA1 keys must be between
512 and 2048 bits. Diffie Hellman keys must be between
128 and 4096 bits. DSA keys must be between 512 and 1024
bits and an exact multiple of 64. HMAC-MD5 keys must be
between 1 and 512 bits.
\-b \fIkeysize\fR
Specifies the number of bits in the key. The choice of key size depends on the algorithm used. RSAMD5 / RSASHA1 keys must be between 512 and 2048 bits. Diffie Hellman keys must be between 128 and 4096 bits. DSA keys must be between 512 and 1024 bits and an exact multiple of 64. HMAC\-MD5 keys must be between 1 and 512 bits.
.TP
\fB-n \fInametype\fB\fR
\-n \fInametype\fR
Specifies the owner type of the key. The value of
\fBnametype\fR must either be ZONE (for a DNSSEC
zone key (KEY/DNSKEY)), HOST or ENTITY (for a key associated with a host (KEY)),
USER (for a key associated with a user(KEY)) or OTHER (DNSKEY). These values are
case insensitive.
\fBnametype\fR
must either be ZONE (for a DNSSEC zone key (KEY/DNSKEY)), HOST or ENTITY (for a key associated with a host (KEY)), USER (for a key associated with a user(KEY)) or OTHER (DNSKEY). These values are case insensitive.
.TP
\fB-c \fIclass\fB\fR
Indicates that the DNS record containing the key should have
the specified class. If not specified, class IN is used.
\-c \fIclass\fR
Indicates that the DNS record containing the key should have the specified class. If not specified, class IN is used.
.TP
\fB-e\fR
\-e
If generating an RSAMD5/RSASHA1 key, use a large exponent.
.TP
\fB-f \fIflag\fB\fR
Set the specified flag in the flag field of the KEY/DNSKEY record.
The only recognized flag is KSK (Key Signing Key) DNSKEY.
\-f \fIflag\fR
Set the specified flag in the flag field of the KEY/DNSKEY record. The only recognized flag is KSK (Key Signing Key) DNSKEY.
.TP
\fB-g \fIgenerator\fB\fR
If generating a Diffie Hellman key, use this generator.
Allowed values are 2 and 5. If no generator
is specified, a known prime from RFC 2539 will be used
if possible; otherwise the default is 2.
\-g \fIgenerator\fR
If generating a Diffie Hellman key, use this generator. Allowed values are 2 and 5. If no generator is specified, a known prime from RFC 2539 will be used if possible; otherwise the default is 2.
.TP
\fB-h\fR
\-h
Prints a short summary of the options and arguments to
\fBdnssec-keygen\fR.
\fBdnssec\-keygen\fR.
.TP
\fB-k\fR
\-k
Generate KEY records rather than DNSKEY records.
.TP
\fB-p \fIprotocol\fB\fR
Sets the protocol value for the generated key. The protocol
is a number between 0 and 255. The default is 3 (DNSSEC).
Other possible values for this argument are listed in
RFC 2535 and its successors.
\-p \fIprotocol\fR
Sets the protocol value for the generated key. The protocol is a number between 0 and 255. The default is 3 (DNSSEC). Other possible values for this argument are listed in RFC 2535 and its successors.
.TP
\fB-r \fIrandomdev\fB\fR
Specifies the source of randomness. If the operating
system does not provide a \fI/dev/random\fR
or equivalent device, the default source of randomness
is keyboard input. \fIrandomdev\fR specifies
the name of a character device or file containing random
data to be used instead of the default. The special value
\fIkeyboard\fR indicates that keyboard
input should be used.
\-r \fIrandomdev\fR
Specifies the source of randomness. If the operating system does not provide a
\fI/dev/random\fR
or equivalent device, the default source of randomness is keyboard input.
\fIrandomdev\fR
specifies the name of a character device or file containing random data to be used instead of the default. The special value
\fIkeyboard\fR
indicates that keyboard input should be used.
.TP
\fB-s \fIstrength\fB\fR
Specifies the strength value of the key. The strength is
a number between 0 and 15, and currently has no defined
purpose in DNSSEC.
\-s \fIstrength\fR
Specifies the strength value of the key. The strength is a number between 0 and 15, and currently has no defined purpose in DNSSEC.
.TP
\fB-t \fItype\fB\fR
Indicates the use of the key. \fBtype\fR must be
one of AUTHCONF, NOAUTHCONF, NOAUTH, or NOCONF. The default
is AUTHCONF. AUTH refers to the ability to authenticate
data, and CONF the ability to encrypt data.
\-t \fItype\fR
Indicates the use of the key.
\fBtype\fR
must be one of AUTHCONF, NOAUTHCONF, NOAUTH, or NOCONF. The default is AUTHCONF. AUTH refers to the ability to authenticate data, and CONF the ability to encrypt data.
.TP
\fB-v \fIlevel\fB\fR
\-v \fIlevel\fR
Sets the debugging level.
.SH "GENERATED KEYS"
.PP
When \fBdnssec-keygen\fR completes successfully,
it prints a string of the form \fIKnnnn.+aaa+iiiii\fR
to the standard output. This is an identification string for
the key it has generated. These strings can be used as arguments
to \fBdnssec-makekeyset\fR.
.TP 0.2i
When
\fBdnssec\-keygen\fR
completes successfully, it prints a string of the form
\fIKnnnn.+aaa+iiiii\fR
to the standard output. This is an identification string for the key it has generated.
.TP 3
\(bu
\fInnnn\fR is the key name.
.TP 0.2i
\fInnnn\fR
is the key name.
.TP
\(bu
\fIaaa\fR is the numeric representation of the
algorithm.
.TP 0.2i
\fIaaa\fR
is the numeric representation of the algorithm.
.TP
\(bu
\fIiiiii\fR is the key identifier (or footprint).
\fIiiiii\fR
is the key identifier (or footprint).
.PP
\fBdnssec-keygen\fR creates two file, with names based
on the printed string. \fIKnnnn.+aaa+iiiii.key\fR
\fBdnssec\-keygen\fR
creates two file, with names based on the printed string.
\fIKnnnn.+aaa+iiiii.key\fR
contains the public key, and
\fIKnnnn.+aaa+iiiii.private\fR contains the private
key.
\fIKnnnn.+aaa+iiiii.private\fR
contains the private key.
.PP
The
\fI.key\fR
file contains a DNS KEY record that can be inserted into a zone file (directly or with a $INCLUDE statement).
.PP
The \fI.key\fR file contains a DNS KEY record that
can be inserted into a zone file (directly or with a $INCLUDE
statement).
.PP
.PP
The \fI.private\fR file contains algorithm specific
fields. For obvious security reasons, this file does not have
general read permission.
.PP
.PP
Both \fI.key\fR and \fI.private\fR
files are generated for symmetric encryption algorithm such as
HMAC-MD5, even though the public and private key are equivalent.
The
\fI.private\fR
file contains algorithm specific fields. For obvious security reasons, this file does not have general read permission.
.PP
Both
\fI.key\fR
and
\fI.private\fR
files are generated for symmetric encryption algorithm such as HMAC\-MD5, even though the public and private key are equivalent.
.SH "EXAMPLE"
.PP
To generate a 768-bit DSA key for the domain
\fBexample.com\fR, the following command would be
issued:
To generate a 768\-bit DSA key for the domain
\fBexample.com\fR, the following command would be issued:
.PP
\fBdnssec-keygen -a DSA -b 768 -n ZONE example.com\fR
\fBdnssec\-keygen \-a DSA \-b 768 \-n ZONE example.com\fR
In this example, <command>dnssec-signkey</command> creates
the file <filename>signedkey-example.com.</filename>, which
contains the <userinput>example.com</userinput> keys and the
signatures by the <userinput>.com</userinput> keys.
</para>
</refsect1>
<refsect1>
<title>SEE ALSO</title>
<para>
<citerefentry>
<refentrytitle>dnssec-keygen</refentrytitle>
<manvolnum>8</manvolnum>
</citerefentry>,
<citerefentry>
<refentrytitle>dnssec-makekeyset</refentrytitle>
<manvolnum>8</manvolnum>
</citerefentry>,
<citerefentry>
<refentrytitle>dnssec-signzone</refentrytitle>
<manvolnum>8</manvolnum>
</citerefentry>.
</para>
</refsect1>
<refsect1>
<title>AUTHOR</title>
<para>
<corpauthor>Internet Systems Consortium</corpauthor>
</para>
</refsect1>
</refentry>
<!--
- Local variables:
- mode: sgml
- End:
-->
Loaded 100 of 4948 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.