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]
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: so (cperciva)
Security: FreeBSD-SA-06:11.ipsec [1]
Security: FreeBSD-SA-06:12.opie [2]
Security: FreeBSD-SA-06:13.sendmail [3]
them to userland. [1]
MFC rev. 1.37 of sys/net80211/ieee80211_ioctl.c: Correct a logic error
which could allow too much data to be copied into userland. [2]
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.
[3]
Security: FreeBSD-SA-06:06.kmem [1] [2]
Security: FreeBSD-SA-06:07.pf [3]
Approved by: so (cperciva)
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
Approved by: so (cperciva)
MFC 1.260 (by ps): Fixed a panic that can happen when nfs_lookup() hits
an error.
Work done by: Mohan Srinivasan
Approved by: re (scottl), so (cperciva)
Erratum: FreeBSD-EN-05:04.nfs
> 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
testing result, 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)
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)
> 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)
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)
> Temporary hack to get the hme network interface on Sun E250 servers to
> 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
can 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)
is freeing ifc_units field, which is used in
vlan_clone_destroy()->ifc_free_unit().
This fixes panic: ifc_free_unit: bit is already cleared
The fix introduces a small race in that a new interface could be created
between the vlan_clone_destroy() loop and the call to if_clone_detach().
The race is probably too hard to trigger to be worry about it.
This is not an MFC, because better fix was committed to HEAD.
We decided to use this fix, as it is a low-risk fix, which fits just fine
for 6.0 at this stage.
Discussed with: brooks, thompsa
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)
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)
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
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.
Reported by: lofi
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)
> 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)
Loaded 100 of 2084 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.