Commit Graph

189475 Commits

Author SHA1 Message Date
Eitan Adler
a345aa5953 Add a /dev/full device.
/dev/full is similar to /dev/zero except it always returns
ENOSPC when you attempt to write to it.

Reviewed by:	jhibbits
Discussed with:	rpaulo
2014-04-30 06:20:48 +00:00
Xin LI
c6f70658c3 Fix TCP reassembly vulnerability.
Patch done by:	glebius
Security:	FreeBSD-SA-14:08.tcp
Security:	CVE-2014-3000
2014-04-30 04:02:57 +00:00
Xin LI
e38c714ed3 Fix OpenSSL use-after-free vulnerability.
Obtained from:	OpenBSD
Security:	FreeBSD-SA-14:09.openssl
Security:	CVE-2010-5298
2014-04-30 04:02:36 +00:00
Xin LI
97a065c889 Fix devfs rules not applied by default for jails.
Security:	FreeBSD-SA-14:07.devfs
Security:	CVE-2014-3001
2014-04-30 04:02:32 +00:00
Adrian Chadd
8cc3f9c9e1 * Modify the beacon interval in debugging to be ni_intval, not 102400
* Be paranoid about avoiding divide-by-zero.

Tested:

* AR9380, STA mode
2014-04-30 02:44:07 +00:00
Adrian Chadd
0694aa7903 Add ar9300_get_next_tbtt().
Tested:

* AR9380, STA mode
2014-04-30 02:29:31 +00:00
Adrian Chadd
f5c30c4e8d Bring over some initial power save management support, reset path
fixes and beacon programming / debugging into the ath(4) driver.

The basic power save tracking:

* Add some new code to track the current desired powersave state; and
* Add some reference count tracking so we know when the NIC is awake; then
* Add code in all the points where we're about to touch the hardware and
  push it to force-wake.

Then, how things are moved into power save:

* Only move into network-sleep during a RUN->SLEEP transition;
* Force wake the hardware up everywhere that we're about to touch
  the hardware.

The net80211 stack takes care of doing RUN<->SLEEP<->(other) state
transitions so we don't have to do it in the driver.

Next, when to wake things up:

* In short - everywhere we touch the hardware.
* The hardware will take care of staying awake if things are queued
  in the transmit queue(s); it'll then transit down to sleep if
  there's nothing left.  This way we don't have to track the
  software / hardware transmit queue(s) and keep the hardware
  awake for those.

Then, some transmit path fixes that aren't related but useful:

* Force EAPOL frames to go out at the lowest rate.  This improves
  reliability during the encryption handshake after 802.11
  negotiation.

Next, some reset path fixes!

* Fix the overlap between reset and transmit pause so we don't
  transmit frames during a reset.
* Some noisy environments will end up taking a lot longer to reset
  than normal, so extend the reset period and drop the raise the
  reset interval to be more realistic and give the hardware some
  time to finish calibration.
* Skip calibration during the reset path.  Tsk!

Then, beacon fixes in station mode!

* Add a _lot_ more debugging in the station beacon reset path.
  This is all quite fluid right now.
* Modify the STA beacon programming code to try and take
  the TU gap between desired TSF and the target TU into
  account.  (Lifted from QCA.)

Tested:

* AR5210
* AR5211
* AR5212
* AR5413
* AR5416
* AR9280
* AR9285

TODO:

* More AP, IBSS, mesh, TDMA testing
* Thorough AR9380 and later testing!
* AR9160 and AR9287 testing

Obtained from:	QCA
2014-04-30 02:19:41 +00:00
Neel Natu
2cb97c9dd6 Ignore writes to microcode update MSR. This MSR is accessed by RHEL7 guest.
Add KTR tracepoints to annotate wrmsr and rdmsr VM exits.
2014-04-30 02:08:27 +00:00
Adrian Chadd
91e198f6a2 Only track the power state variable if the power state is changed,
not if the self-generated frame state is changed.
2014-04-30 02:03:47 +00:00
Adrian Chadd
ce3f9a8950 * Only update ah_powerMode if we're setting the chip sleep state.
Some code will appear soon that is actually setting the chip powerstate
  separate from the self-generated frames power state.
* Allow the AR5416 family chips to actually have the power state changed
  from the self generated state change.

Tested (STA mode):

* AR5210
* AR5211
* AR5412
* AR5413
* AR5416
* AR9285
2014-04-30 02:03:13 +00:00
Ian Lepore
457e64a02f Make this declaration into a proper function prototype. 2014-04-29 23:29:28 +00:00
Marius Strobl
2daea0bce6 Update comment. 2014-04-29 20:57:25 +00:00
Marius Strobl
0d13d5fce2 Given that as of r258002 the last external user is gone, make sched_lock
static.
2014-04-29 20:51:57 +00:00
Ryan Stone
a998d4b50e Be consistent with the whitespace in the rest of these files.
X-MFC-With: r264007
2014-04-29 20:49:47 +00:00
Alexander V. Chernikov
d9437c0f46 Partially revert r265019 - allocating 512 bytes on stack
can be too much for architectures like ARM. Always use rounded
malloc instead.

Discussed with:	jmallett
MFC after:	4 weeks
2014-04-29 19:48:11 +00:00
Alexander V. Chernikov
0fb9298db9 Move rt_setmetrics() from rtsock.c to route.c.
All rtsock-initiated rte creation/modification are now
performed in route.c holding radix tree write lock.
This reduces the need for per-rte mutex.

Sponsored by:	Yandex LLC
MFC after:	1 month
2014-04-29 19:14:42 +00:00
Konstantin Belousov
d3f44b8d74 Fix two cases of recursive acquisitions of the vm object lock, only
possible in rare failure situations.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2014-04-29 19:02:34 +00:00
Neel Natu
c6a0cc2e21 Some Linux guests will implement a 'halt' by disabling the APIC and executing
the 'HLT' instruction. This condition was detected by 'vm_handle_hlt()' and
converted into the SPINDOWN_CPU exitcode . The bhyve(8) process would exit
the vcpu thread in response to a SPINDOWN_CPU and when the last vcpu was
spun down it would reset the virtual machine via vm_suspend(VM_SUSPEND_RESET).

This functionality was broken in r263780 in a way that made it impossible
to kill the bhyve(8) process because it would loop forever in
vm_handle_suspend().

Unbreak this by removing the code to spindown vcpus. Thus a 'halt' from
a Linux guest will appear to be hung but this is consistent with the
behavior on bare metal. The guest can be rebooted by using the bhyvectl
options '--force-reset' or '--force-poweroff'.

Reviewed by:	grehan@
2014-04-29 18:42:56 +00:00
Konstantin Belousov
a17937bdd0 For the VM_PHYSSEG_DENSE case, checking the requested range to fall
into the area backed by vm_page_array wrongly compared end with
vm_page_array_size.  It should be adjusted by first_page index to be
correct.

Also, the corner and incorrect case of the requested range extending
after the end of the vm_page_array was incorrectly handled by
allocating the segment.

Fix the comparision for the end of range and return EINVAL if the end
extends beyond vm_page_array.

Discussed with:	royger
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2014-04-29 18:42:37 +00:00
Ian Lepore
06177e52c9 Add SMP support for Zedboard.
Submitted by:	Thomas Skibo <ThomasSkibo@sbcglobal.net>
2014-04-29 17:48:57 +00:00
Peter Grehan
d6cd193e5e Bump WITNESS_PENDLIST by MAXCPU to account for the
pmap pvlist locks which are scaled by MAXCPU.

This allows an amd64 system to boot with MAXCPU set
to 256, which is currently FreeBSD's hard limit without
x2apic support.

Compile-tested for other arch's.

PR:	185831
Discussed with:		jhb
MFC after:	3 weeks
2014-04-29 17:22:29 +00:00
Brooks Davis
4b55d3602f Merge from CheriBSD:
commit 1d1b908107
Author: Brooks Davis <brooks@one-eyed-alien.net>
Date:   Fri Mar 28 16:24:45 2014 +0000

    Add a long needed seatbelt.

    Exit with an error when make is called without a target at the top level
    rather than poluting the source tree and causing use confusion in future
    builds.

commit a9d9aa341b
Author: Brooks Davis <brooks@one-eyed-alien.net>
Date:   Tue Apr 29 16:06:12 2014 +0000

    Simplify seatbelt added in 1d1b908 based in feedback.

    Discussed with:	imp@FreeBSD.org

Reviewed by:	imp
Sponsored by:	DARPA, AFRL
2014-04-29 16:57:25 +00:00
Alexander V. Chernikov
68bbdd0e71 Fix "netstat -gW" behavior broken in r259638.
netstat has two options for printing multicast tables:
sysctl (the default one for live systems) and kvm-based one (for cores).
It looks like kvm-based one hasn't been working since it's been introduced
in r190012 due to absence of mfctablesize kernel symbol.
Check for all ipv4-multicast symbols being correctly resolved was introduced
in r259638 regardless of 'live' value leading to "No IPv4 MROUTING" error
message.

Reported by:	Olivier Cochard-Labbé
MFC after:	1 week
2014-04-29 16:51:28 +00:00
Pedro F. Giffuni
97ecaa8907 citrus: Avoid invalid code points.
From the OpenBSD log:
The UTF-8 decoder should not accept byte sequences which decode to unicode
code positions U+D800 to U+DFFF (UTF-16 surrogates), U+FFFE, and U+FFFF.

http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
http://unicode.org/faq/utf_bom.html#utf8-4

Reported by:	Stefan Sperling
Obtained from:	OpenBSD
MFC after:	5 days
2014-04-29 15:25:57 +00:00
Alan Somers
368f6e2f2f Add regression test for PR kern/189088.
PR:		kern/189088
MFC after:	3 weeks
Sponsored by:	Spectra Logic
2014-04-29 15:12:23 +00:00
Warner Losh
6f9f01a2d8 NLS is used by the build system. 2014-04-29 14:52:39 +00:00
Alan Somers
7278b62aee Fix a panic when removing an IP address from an interface, if the same address
exists on another interface.  The panic was introduced by change 264887, which
changed the fibnum parameter in the call to rtalloc1_fib() in
ifa_switch_loopback_route() from RT_DEFAULT_FIB to RT_ALL_FIBS.  The solution
is to use the interface fib in that call.  For the majority of users, that will
be equivalent to the legacy behavior.

PR:		kern/189089
Reported by:	neel
Reviewed by:	neel
MFC after:	3 weeks
X-MFC with:	264887
Sponsored by:	Spectra Logic
2014-04-29 14:46:45 +00:00
Alexander V. Chernikov
a713ee5cf7 Do not use senderr() in rtrequest1_fib_change().
Suggested by:	glebius
MFC after:	4 weeks
2014-04-29 12:52:36 +00:00
Marius Strobl
b05e961602 Merge r133175 from upstream:
2008-03-13  Dennis Czeremin  <dennis.czeremin@smiths-heimann.com>

	PR libstdc++/35566
	* include/bits/stl_multimap.h (multimap<>::multimap(_InputIterator,
	_InputIterator)): Forward to _M_insert_equal, not _M_insert_unique.

This patch was GPL2 at the time and fixes a regression introduced with
the merge of GCC r129013 in FreeBSD r236829.

MFC after:	3 days
Sponsored by:	Bally Wulff Games & Entertainment GmbH
2014-04-29 11:31:22 +00:00
Bjoern A. Zeeb
27caa49f0b After r264897 restore the ability to add bootoptions from FDT for
platforms which do not use loaders or kernels that want to hardcode
options or for FDT passed in by loader.

Also fix a build issue by putting the kmdp variable accessed back under
the #ifdef FDT;  we may wish to revisit decision in which case more
code needs changing.

Submitted by:	brooks
2014-04-29 07:48:07 +00:00
Christian Brueffer
e418b6fd0b Add standard SYNOPSIS wording, fix typos, contractions and new sentence -> new line. 2014-04-29 07:45:21 +00:00
Scott Long
5ae1451da6 Fix formatting of the -a option in usage() to be consistent.
Obtained from:	Netflix, Inc.
MFC after:	3 days
2014-04-29 07:19:22 +00:00
Scott Long
f6f851a37b Document the -a option that was added in r262424.
Obtained from:	Netflix, Inc.
MFC after:	3 days
2014-04-29 07:17:33 +00:00
Bryan Drewery
74679c6a99 Remove redundant include
MFC after:	3 days
2014-04-29 01:17:43 +00:00
Warner Losh
52cb8b8fe1 Add dependency for libm to libstdc++. This fixes high -j value builds
when not building with clang.

Submitted by: ian@
2014-04-28 23:16:46 +00:00
Neel Natu
f0fdcfe247 Allow a virtual machine to be forcibly reset or powered off. This is done
by adding an argument to the VM_SUSPEND ioctl that specifies how the virtual
machine should be suspended, viz. VM_SUSPEND_RESET or VM_SUSPEND_POWEROFF.

The disposition of VM_SUSPEND is also made available to the exit handler
via the 'u.suspended' member of 'struct vm_exit'.

This capability is exposed via the '--force-reset' and '--force-poweroff'
arguments to /usr/sbin/bhyvectl.

Discussed with:	grehan@
2014-04-28 22:06:40 +00:00
Glen Barber
70b7e330c6 Remove note about hw.bus.devctl_disable removal, restored
in r265060.

Sponsored by:	The FreeBSD Foundation
2014-04-28 20:40:36 +00:00
Brooks Davis
a3fe2bc59e Revert r263754, re-adding support for hw.bus.devctl_disable. Breaking
old devd's and thus hosts that get IP addresses from DHCP was too much
of a POLA violation.

The sysctl may be removed again after r263758 has been merged to at
least stable/9 and stable/10, and releases have been cut from those
branches.

Discussed with:	mjg
Reported by:	theraven, rwatson
2014-04-28 20:38:08 +00:00
Andrew Turner
8258fd68ef Set the new floating point exception mask correctly
Submitted by:	Keith White <kwhite@site.uottawa.ca>
2014-04-28 18:54:12 +00:00
Peter Grehan
67e1705297 Implement legacy interrupts for the AHCI device emulation
according to the method outlined in the AHCI spec.

Tested with FreeBSD 9/10/11 with MSI disabled,
and also NetBSD/amd64 (lightly).

Reviewed by:	neel, tychon
MFC after:	3 weeks
2014-04-28 18:41:25 +00:00
Nathan Whitehorn
4424e30878 Turn off various fancy instruction sets, as well as deduplicate some options.
This makes the EFI loader build work with CPUTYPE=native in make.conf on
my Core i5.
2014-04-28 18:25:21 +00:00
Marcel Moolenaar
0c2b180a35 Add a C libary and a Python module that implements an API similar
to bus_space(9) and that uses the proto(4) driver for talking to
hardware. If the I/O resource is a memory mapped I/O resource,
then mmap(2) will be attempted to avoid read(2)/write(2) overhead.

Sponsored by:	Juniper Networks, Inc.
2014-04-28 18:06:11 +00:00
Marcel Moolenaar
67fb10f30c Add proto(4): A driver for prototyping and diagnostics.
It exposes I/O resources to user space, so that programs can peek
and poke at the hardware. It does not itself have knowledge about
the hardware device it attaches to.

Sponsored by:	Juniper Networks, Inc.
2014-04-28 17:58:40 +00:00
Alexander Motin
dea1e22600 Reduce number of opens by REOM RAID during provider taste.
Instead opening/closing provider by each of metadata classes, do it only
once in core code.  Since for SCSI disks open/close means sending some
SCSI commands to the device, this change reduces taste time.

MFC after:	2 weeks
Sponsored by:	iXsystems, Inc.
2014-04-28 15:03:52 +00:00
Ed Maste
bd92124545 Drop explicit unsigned from FD_SETSIZE constant
FD_SETSIZE is often used as an argument to select or compared with an
integer file descriptor.  Rather than force 3rd party software to add
explicit casts, just make it a plain (int) constant as on other
operating systems.

Previous discussion:
http://lists.freebsd.org/pipermail/freebsd-standards/2012-July/002410.html
2014-04-28 13:42:41 +00:00
Steven Hartland
101dfa0ed4 Fix ZIO reordering done by vdev_queue_io causing panics when zio_vdev_io_start
returns ZIO_PIPELINE_CONTINUE from vdev_op_io_start to zio_execute resulting
in the wrong ZIO continuing its pipeline.

This is a serious issue which could cause data loss / corruption but appears
to be limited to error handling such as when vdev_readable(vd) returns false.

MFC after:	2 days
2014-04-28 09:00:00 +00:00
Eitan Adler
b2ba559513 bsd-family-tree: Fix date 2014-04-28 06:24:37 +00:00
Ganbold Tsagaankhuu
5372fec0bc Move common device tree informations to separate dtsi files for A10 and A20 SoC.
Change cubieboard1 and cubieboard2 dts files accordingly.

Approved by:	stas (mentor)
2014-04-28 05:39:20 +00:00
Ian Lepore
440fe55df6 Don't use multiprocessing-extensions instruction on processors that don't
support SMP.

Submitted by:	loos@
Pointy hat to:	me
2014-04-28 02:35:28 +00:00
Ian Lepore
88b3694bd9 Move duplicated code to print l2 cache config into the common code. 2014-04-27 23:47:38 +00:00