Commit Graph

182398 Commits

Author SHA1 Message Date
rmacklem
9290b3731b Attila Bogar and Herbert Poeckl both reported similar problems
w.r.t. a Linux NFS client doing a krb5 NFS mount against the
FreeBSD server. We determined this was a Linux bug:
http://www.spinics.net/lists/linux-nfs/msg32466.html, however
the mount failed to work, because the Destroy operation with a
bogus encrypted checksum destroyed the authenticator handle.
This patch changes the rpcsec_gss code so that it doesn't
Destroy the authenticator handle for this case and, as such,
the Linux mount will work.

Tested by: Attila Bogar and Herbert Poeckl
MFC after:	2 weeks
2012-10-01 12:28:58 +00:00
gabor
53bc32bb8f - Rename .sgml files to .xml to track the recent doc changes
MFC after:	1 day
2012-10-01 11:26:49 +00:00
kib
8c57b62918 Add the UPDATING note about padlock rng support requiring the config change.
Requested by:	Dewayne Geraghty <dewayne.geraghty@heuristicsystems.com.au>
MFC after:	3 days
2012-10-01 10:46:35 +00:00
hselasky
12849bcc7c Regenerate usb.conf
MFC after:	1 week
2012-10-01 06:48:59 +00:00
pjd
ef5782071f - Enforce CAP_MKFIFO on mkfifoat(2), not on mknodat(2). Without this change
mkfifoat(2) was not restricted.
- Introduce CAP_MKNOD and enforce it on mknodat(2).

Sponsored by:	FreeBSD Foundation
MFC after:	2 weeks
2012-10-01 05:43:24 +00:00
hselasky
c081610de9 Inherit USB mode from RootHUB port where the USB device is connected.
Only RootHUB ports can be dual mode. Disallow OTG ports on external HUBs.
This simplifies some checks in the USB controller drivers.

MFC after:	1 week
2012-10-01 05:42:43 +00:00
andrew
c5105a1581 Remove unused variables from the OMAP ehci code. 2012-10-01 05:15:13 +00:00
andrew
251a50eaea Fix the clobber list on the atomic operators that do comparisons. Without
this some compilers will place a cmp instruction before the atomic operation
and expect to be able to use the result afterwards. By adding "cc" to the
list of used registers we tell the compiler to not do this.
2012-10-01 05:12:17 +00:00
hselasky
5685c823b4 The USB Bluetooth driver should only grab its own interfaces. This allows the
USB bluetooth driver to co-exist with other USB device classes and drivers.

Reported by:	Geoffrey Levand
MFC after:	1 week
2012-09-30 19:31:20 +00:00
tijl
762446dfda - Simplify the implementation of atomic_compare_exchange_strong_explicit.
- Evaluate the memory order argument in atomic_fetch_*_explicit macros.
- Implement atomic_store_explicit using atomic_exchange_explicit instead
  of a plain assignment.

Reviewed by:	theraven
MFC after:	2 weeks
2012-09-30 17:33:30 +00:00
kevlo
411fa10088 Add missing header needed by free(9).
Spotted by:	David Wolfskill <david at catwhisker dot org>
2012-09-30 15:42:20 +00:00
ae
7cdd95d9e2 Fix the style. 2012-09-30 13:17:33 +00:00
ae
3cb28a5481 Remember the file format of the last loaded module and try to use it for
next files.
2012-09-30 13:14:37 +00:00
ae
2441140ba8 Reduce the number of attempts to detect proper kld format for the amd64
loader.
2012-09-30 12:24:15 +00:00
kevlo
333f372c81 Remove an unneeded NULL check after M_WAITOK. 2012-09-30 09:26:26 +00:00
kevlo
77dc747e6c Free result of device_get_children(9). 2012-09-30 09:21:10 +00:00
ae
810d3ec225 Fix disk_cleanup() to work without DISK_DEBUG too. 2012-09-30 07:52:40 +00:00
joel
68ac3a8b2c mdoc: remove superfluous paragraph macro. 2012-09-30 07:51:57 +00:00
alc
3c3407b17a Stop calling pmap_remove_write() from pmap_remove_all(). Doing so is not
only inefficient but also leads to recursive lock acquisition.

Tested by:	ray
2012-09-30 03:54:57 +00:00
eadler
02d21d96e0 clarify the wording for 'first' and 'last'
Approved by:	wblock
MFC after:	3 days
2012-09-30 03:25:04 +00:00
eadler
525250e187 Document the security.bsd.unprivileged_idprio in idprio(1) in addition
to rtprio(2).

Approved by:	wblock
MFC after:	3 days
2012-09-30 03:21:21 +00:00
alc
bc883ac4c7 Eliminate an unused declaration. 2012-09-29 22:28:00 +00:00
glebius
2c4db2ae64 Clear and re-setup all function pointers that glue pf(4) and pfsync(4)
together whenever the pfsync0 is brought down or up respectively.
2012-09-29 20:11:00 +00:00
glebius
ad137f3f93 Simplify send out queue code:
- Write method of a queue now is void,length of item is taken
  as queue property.
- Write methods don't need to know about mbud, supply just buf
  to them.
- No need for safe queue iterator in pfsync_sendout().

Obtained from:	OpenBSD
2012-09-29 20:02:26 +00:00
alc
716b70c1d6 Eliminate unused variables. 2012-09-29 19:09:11 +00:00
alc
b5093c1361 Add support for mincore(). Specifically, this is an adaptation of the
pmap_mincore() implementation that was added to the original arm pmap
in r235717.
2012-09-29 17:20:16 +00:00
ae
75dfd50beb Almost each time when loader opens a file, this leads to calling
disk_open(). Very often this is called several times for one file.
This leads to reading partition table metadata for each call. To
reduce the number of disk I/O we have a simple block cache, but it
is very dumb and more than half of I/O operations related to reading
metadata, misses this cache.

Introduce new cache layer to resolve this problem. It is independent
and doesn't need initialization like bcache, and will work by default
for all loaders which use the new DISK API. A successful disk_open()
call to each new disk or partition produces new entry in the cache.
Even more, when disk was already open, now opening of any nested
partitions does not require reading top level partition table.
So, if without this cache, partition table metadata was read around
20-50 times during boot, now it reads only once. This affects the booting
from GPT and MBR from the UFS.
2012-09-29 16:47:56 +00:00
glebius
a7f869fbc1 - Get rid of #ifdef __FreeBSD__.
- Use correct format when printing uint64_t.
2012-09-29 16:42:01 +00:00
kargl
3772749075 * src/math_private.h:
. Change the API for the LD80C by removing the explicit passing
    of the sign bit.  The sign can be determined from the last
    parameter of the macro.
  . On i386, load long double by bit manipulations to work around
    at least a gcc compiler issue.  On non-i386 ld80 architectures,
    use a simple assignment.

* ld80/s_expl.c:
  . Update the only consumer of LD80C.

Submitted by:	bde
Approved by:	das (mentor)
2012-09-29 16:40:12 +00:00
kevlo
4a88b958f4 If devclass_get_devices(9) returns success but a count of 0,
free the pointer.
2012-09-29 16:27:13 +00:00
kevlo
3afe08ab11 Add missing va_end. 2012-09-29 16:19:01 +00:00
kevlo
147924627e Remove unused variables. 2012-09-29 16:15:27 +00:00
ae
56dc079ef6 Disable splitfs support, since we aren't support floppies for a long
time. This slightly reduces an overhead, when loader tries to open
file that doesn't exist.
2012-09-29 15:08:55 +00:00
jilles
fba61ef227 libc: Use O_CLOEXEC for various internal file descriptors.
This fixes a race condition where another thread may fork() before CLOEXEC
is set, unintentionally passing the descriptor to the child process.

This commit only adds O_CLOEXEC flags to open() or openat() calls where no
fcntl(fd, F_SETFD, FD_CLOEXEC) follows. The separate fcntl() call still
leaves a race window so it should be fixed later.
2012-09-29 11:54:34 +00:00
glebius
576f4f1ec8 Give a clue how to force tcpdump(8) to interpret correctly CARP packets. 2012-09-29 10:49:02 +00:00
alc
c160c4b557 Update a comment to reflect recent locking changes. 2012-09-29 08:11:12 +00:00
glebius
a16cfb3463 carp_send_ad() should never return without rescheduling next run. 2012-09-29 05:52:19 +00:00
dteske
e094bc67f5 Allow deferred word-splitting via f_sysrc_get() by allowing $IFS in the
"clean-room" environment used to query rc.conf(5) parameters.

This brings bsdconfig(8)'s sysrc.subr in-line with both the sysrc(8) manual
[provided by sysutils/sysrc] and sysrc(8)'s own sysrc.subr (now identical to
bsdconfig(8)'s sysrc.subr as of this patch).

Finally, this will allow a clean import of sysutils/sysrc (sans sysrc.subr,
already provided here).

Reviewed by:	jilles
Approved by:	adrian (co-mentor)
2012-09-29 03:41:21 +00:00
glebius
5c64acd0e7 Simplify and somewhat redesign interaction between pf_purge_thread() and
pf_purge_expired_states().

Now pf purging daemon stores the current hash table index on stack
in pf_purge_thread(), and supplies it to next iteration of
pf_purge_expired_states(). The latter returns new index back.

The important change is that whenever pf_purge_expired_states() wraps
around the array it returns immediately. This makes our knowledge about
status of states expiry run more consistent. Prior to this change it
could happen that n-th run stopped on i-th entry, and returned (1) as
full run complete, then next (n+1) full run stopped on j-th entry, where
j < i, and that broke the mark-and-sweep algorythm that saves references
rules. A referenced rule was freed, and this later lead to a crash.
2012-09-28 20:43:03 +00:00
glebius
4b29d585cf The drbr(9) API appeared to be so unclear, that most drivers in
tree used it incorrectly, which lead to inaccurate overrated
if_obytes accounting. The drbr(9) used to update ifnet stats on
drbr_enqueue(), which is not accurate since enqueuing doesn't
imply successful processing by driver. Dequeuing neither mean
that. Most drivers also called drbr_stats_update() which did
accounting again, leading to doubled if_obytes statistics. And
in case of severe transmitting, when a packet could be several
times enqueued and dequeued it could have been accounted several
times.

o Thus, make drbr(9) API thinner. Now drbr(9) merely chooses between
  ALTQ queueing or buf_ring(9) queueing.
  - It doesn't touch the buf_ring stats any more.
  - It doesn't touch ifnet stats anymore.
  - drbr_stats_update() no longer exists.

o buf_ring(9) handles its stats itself:
  - It handles br_drops itself.
  - br_prod_bytes stats are dropped. Rationale: no one ever
    reads them but update of a common counter on every packet
    negatively affects performance due to excessive cache
    invalidation.
  - buf_ring_enqueue_bytes() reduced to buf_ring_enqueue(), since
    we no longer account bytes.

o Drivers handle their stats theirselves: if_obytes, if_omcasts.

o mlx4(4), igb(4), em(4), vxge(4), oce(4) and  ixv(4) no longer
  use drbr_stats_update(), and update ifnet stats theirselves.

o bxe(4) was the most correct driver, it didn't call
  drbr_stats_update(), thus it was the only driver accurate under
  moderate load. Now it also maintains stats itself.

o ixgbe(4) had already taken stats from hardware, so just
  - drop software stats updating.
  - take multicast packet count from hardware as well.

o mxge(4) just no longer needs NO_SLOW_STATS define.

o cxgb(4), cxgbe(4) need no change, since they obtain stats
  from hardware.

Reviewed by:	jfv, gnn
2012-09-28 18:28:27 +00:00
mdf
186eb51daa Fix some nearby type and style errors.
Pointed out by:	bde
2012-09-28 17:34:34 +00:00
hselasky
1e08816c2c Make sure we don't leak a mbuf in a fail case. 2012-09-28 16:23:01 +00:00
hselasky
c416994d01 Remove some trailing bytes which are not part of the ethernet packet.
Discussed with:		bgray @
2012-09-28 15:33:13 +00:00
hselasky
fc2bcd64bf Correct NYET handling. Remove superfluous transfer complete interrupt mask. 2012-09-28 15:24:14 +00:00
des
26701fe358 Slight stylification. 2012-09-28 13:50:37 +00:00
des
26f1bc7822 Remove unnecessary #include. 2012-09-28 12:29:25 +00:00
mav
06f4d9dad6 Change queue overflow checks from DIAGNOSTIC+panic() to KASSERT() to make
them enabled on HEAD by default. It is probably better to do single compare
then hunt for unexpected memory corruption.
2012-09-28 12:13:34 +00:00
jhb
f643d4c50a - Re-shuffle the <machine/pc/bios.h> headers to move all kernel-specific
bits under #ifdef _KERNEL but leave definitions for various structures
  defined by standards ($PIR table, SMAP entries, etc.) available to
  userland.
- Consolidate duplicate SMBIOS table structure definitions in ipmi(4)
  and smbios(4) in <machine/pc/bios.h> and make them available to
  userland.

MFC after:	2 weeks
2012-09-28 11:59:32 +00:00
issyl0
9546d5704f Change "only only" to "only" in portsnap(8).
Spotted by:	Ruslan Mahmatkhanov
Approved by:	gabor (mentor, implicit)
2012-09-28 11:40:59 +00:00
kib
8f845e475e Fix the mis-handling of the VV_TEXT on the nullfs vnodes.
If you have a binary on a filesystem which is also mounted over by
nullfs, you could execute the binary from the lower filesystem, or
from the nullfs mount. When executed from lower filesystem, the lower
vnode gets VV_TEXT flag set, and the file cannot be modified while the
binary is active. But, if executed as the nullfs alias, only the
nullfs vnode gets VV_TEXT set, and you still can open the lower vnode
for write.

Add a set of VOPs for the VV_TEXT query, set and clear operations,
which are correctly bypassed to lower vnode.

Tested by:	pho (previous version)
MFC after:	2 weeks
2012-09-28 11:25:02 +00:00