Commit Graph

207561 Commits

Author SHA1 Message Date
Alexander V. Chernikov
fcbfdb37a1 Fix panic in IP redirect. Panic was introduced in r293466.
Found by:	Yamagi Burmeister <lists at yamagi.org>>
2016-01-14 16:31:00 +00:00
Warner Losh
5147131ae4 Document how to enter the debugger here. I'm sure there's some better
canonical place, and the nit-pickers are welcome to move this
information there with a cross reference.

Differential Review: https://reviews.freebsd.org/D4860
2016-01-14 16:23:07 +00:00
John Baldwin
2f9e579166 Fix building with GCC since PAGE_MASK is signed on i386.
Reviewed by:	ngie
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D4772
2016-01-14 15:51:13 +00:00
John Baldwin
a6c9d35c23 Adjust previous fix to conform to the existing style in this file. 2016-01-14 15:49:24 +00:00
Alexander V. Chernikov
6369f51bc8 Make ng_netflow(9) use new routing KPI.
Netflow module is supposed to store (along with fields like
  gateway address and interface index) matched netmask for each record.
  This (currently) requires returning individual route entries, instead
  of optimized next-hop structure. Given that, use control-plane
  rib_lookup_info() function to avoid accessing rtentries directly.
While rib_lookup_info() might be slower, than fibX_lookup() flavours,
  it is more scalable than rtalloc1_fib(), because rtentry mutex is
  not acquired.
2016-01-14 13:14:12 +00:00
Michael Tuexen
ebee3dc229 Fail the SCTP_GET_ASSOC_NUMBER and SCTP_GET_ASSOC_ID_LIST
socket options for 1-to-1 style sockets as specified in RFC 6458.

MFC after:	3 days
2016-01-14 11:25:28 +00:00
Gleb Smirnoff
dc5f4fa86e Install /etc/snmpd.config with 0600 permissions.
Noticed by:	Pierre Kim
Security:	SA-16:06.snmpd
Pointy hat to:	glebius in 2005
2016-01-14 10:25:18 +00:00
Gleb Smirnoff
f73d9fd2f1 There is a bug in tcp_output()'s implementation of the TCP_SIGNATURE
(RFC 2385/TCP-MD5) kernel option.

If a tcpcb has TF_NOOPT flag, then tcp_addoptions() is not called,
and to.to_signature is an uninitialized stack variable. The value
is later used as write offset, which leads to writing to random
address.

Submitted by:	rstone, jtl
Security:	SA-16:05.tcp
2016-01-14 10:22:45 +00:00
Gleb Smirnoff
c8358c6e0d Call crextend() before copying old credentials to the new credentials
and replace crcopysafe by crcopy as crcopysafe is is not intended to be
safe in a threaded environment, it drops PROC_LOCK() in while() that
can lead to unexpected results, such as overwrite kernel memory.

In my POV crcopysafe() needs special attention. For now I do not see
any problems with this function, but who knows.

Submitted by:	dchagin
Found by:	trinity
Security:	SA-16:04.linux
2016-01-14 10:16:25 +00:00
Gleb Smirnoff
de44d808ef Regen after r293907. 2016-01-14 10:15:21 +00:00
Gleb Smirnoff
037f750877 Change linux get_robust_list system call to match actual linux one.
The set_robust_list system call request the kernel to record the head
of the list of robust futexes owned by the calling thread. The head
argument is the list head to record.
The get_robust_list system call should return the head of the robust
list of the thread whose thread id is specified in pid argument.
The list head should be stored in the location pointed to by head
argument.

In contrast, our implemenattion of get_robust_list system call copies
the known portion of memory pointed by recorded in set_robust_list
system call pointer to the head of the robust list to the location
pointed by head argument.

So, it is possible for a local attacker to read portions of kernel
memory, which may result in a privilege escalation.

Submitted by:	mjg
Security:	SA-16:03.linux
2016-01-14 10:13:58 +00:00
Gleb Smirnoff
479795819a Verify the packet length in sctp6_input().
The sctp6_ctlinput() function does not properly check the length of the packet
it receives from the ICMP6 input routine. This means that an attacker can craft
a packet that will cause a kernel panic.

When the kernel receives an ICMP6 error message with one of the types/codes
it handles, it calls icmp6_notify_error() to deliver it to the upper-level
protocol. icmp6_notify_error() cycles through the extension headers (if any)
to find the protocol number of the first non-extension header. It does NOT
verify the length of the non-extension header.

It passes information about the packet (including the actual packet) to the
upper-level protocol's pr_ctlinput function. In the case of SCTP for IPv6,
icmp6_notify_error() calls sctp6_ctlinput().

sctp6_ctlinput() assumes that the incoming packet contains a sufficiently-long
SCTP header and calls m_copydata() to extract a copy of that header. In turn,
m_copydata() assumes that the caller has already verified that the offset and
length parameters are correct. If they are incorrect, it will dereference a
NULL pointer and cause a kernel panic.

In short, no one is sufficiently verifying the input, and the result is a
kernel panic.

Submitted by:	jtl
Security:	SA-16:01.sctp
2016-01-14 10:11:10 +00:00
Steven Hartland
ff7ea78834 Allow file specific user-specified flag overrides
Allow user-specified warning flag overrides for specific files under
bsd.sys.mk, in the same way kern.mk does.

This will to be used by future commits.

MFC after:	2 weeks
X-MFC-With:	r293268
Sponsored by:	Multiplay
2016-01-14 10:09:05 +00:00
Steven Hartland
bb39a9ed8e Fix GCC warnings causing build failure after r293724
Disable some compiler warnings for GCC (non-standard compiler) fixing
build failures introduced by r293724, which enabled WARNS in the EFI boot
code, when compiling with none standard compiler (GCC).

Raised by:	ian
MFC after:	2 weeks
X-MFC-With:	r293268
Sponsored by:	Multiplay
2016-01-14 09:22:01 +00:00
Andrew Rybchenko
0ed660ee94 sfxge: cleanup: quieten efx_mcdi_read_resonse_header error reporting
The "mcdi_err_arg" probe still reports results of failed MCDI
commands, unless the caller invoked efx_mcdi_execute_quiet().

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D4919
2016-01-14 09:20:25 +00:00
Andrew Rybchenko
0c848230f7 sfxge: add accessors for license-related MCDI calls to common code
Add support for Huntington MCDI licensing interface to common code.
Ported from Linux net driver IOCTL functions with restructuring for
initial support for V3 licensing API.

Submitted by:   Richard Houldsworth <rhouldsworth at solarflare.com>
Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D4918
2016-01-14 09:19:28 +00:00
Andrew Rybchenko
dc5427fc70 sfxge: add table entries for License NVRAM partition
Submitted by:   Richard Houldsworth <rhouldsworth at solarflare.com>
Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D4917
2016-01-14 09:14:40 +00:00
Andrew Rybchenko
410298b138 sfxge: cleanup: adjust efx_mcdi_get_port_modes() comment for clarity
Fix an explanatory comment which did not explain very well.

Submitted by:   Richard Houldsworth <rhouldsworth at solarflare.com>
Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D4916
2016-01-14 09:12:40 +00:00
Andrew Rybchenko
72cda83214 sfxge: fix common code VPD iterator and duplicate tag verification
Fix efx_vpd_hunk_next() which has -- since its inception -- failed to
correctly iterate over the tags and keywords contained in the VPD data.
Only the first tag or keyword would be returned and the next call with
*contp == 1 would walk to the end of the data and finish.

This was spotted when fixing up errors spotted by Prefast code analysis
(which neglected to set all of the out parameters in all successful cases)

Also fix efx_vpd_verify() on Siena and EF10 which (as a side effect of
correctly iterating over all the tags and keywords) was failing as it
detected that both the static VPD and dynamic VPD storage contained an
RV keyword in the VPD-R tag.  This is intentional as the static VPD and
dynamic VPD are stored separately (firmware merges their contents and
computes a new RV keyword checksum for the data readable from the VPD
capability in PCIe configuration space).

Submitted by:   Andrew Lee <alee at solarflare.com>
Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D4915
2016-01-14 09:11:20 +00:00
Andrew Rybchenko
ac23c34a9f sfxge: use correct register definitions for setting interrupt moderation on Medford
The only value which has changed is the number of rows
(ER_DZ_EVQ_TMR_REG_ROWS is 2048 vs 1024 for FR_BZ_TIMER_COMMAND_REGP0_ROWS)
but that isn't used, so this shouldn't change behaviour.

Submitted by:   Mark Spender <mspender at solarflare.com>
Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D4913
2016-01-14 09:07:40 +00:00
Andrew Rybchenko
4ab4936911 sfxge: support FATSOv2 in common code
Sponsored by:   Solarflare Communications, Inc.
Reviewed by:    gnn
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D4912
2016-01-14 09:05:51 +00:00
Andrew Rybchenko
0a91bc3ff4 sfxge: rx_prefix_pktlen methods do not require EFSYS_OPT_RX_SCALE
Submitted by:   Mark Spender <mspender at solarflare.com>
Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D4911
2016-01-14 09:03:02 +00:00
Andrew Rybchenko
56bd83b0c5 sfxge: convert nvram size method to use partition id
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D4910
2016-01-14 09:01:53 +00:00
Andrew Rybchenko
fd7501bf79 sfxge: rework MCDI start request
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D4909
2016-01-14 09:00:35 +00:00
Andrew Rybchenko
cfa023eb90 sfxge: add Medford NIC methods
Submitted by:   Mark Spender <mspender at solarflare.com>
Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D4908
2016-01-14 08:59:38 +00:00
Alexander V. Chernikov
10e0e23528 Remove now-unused wrappers for various routing functions. 2016-01-14 08:54:44 +00:00
Enji Cooper
0713024269 PID file support hasn't been committed for ggated(8) yet. Unbreak running
the testcase more than once by restoring the "killall ggated"

MFC after: 15 days
Sponsored by: EMC / Isilon Storage Division
2016-01-14 07:39:05 +00:00
Ed Schouten
3196923796 Remove an unneeded assignment of the return value.
tdelete() is supposed to return the address of the parent node that has
been deleted. We already keep track of this node in the loop between
lines 94-107. The GO_LEFT()/GO_RIGHT() macros are used later on as well,
so we must make sure not to change it to something else.
2016-01-14 07:27:42 +00:00
Enji Cooper
4c29cf96d4 Remove unnecessary kldload logic added to geom_subr.sh in r293028
MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division
2016-01-14 07:27:14 +00:00
Enji Cooper
8d5bab80ea Unbreak make depend with sys/modules/hyperv/vmbus after r293870
Pointyhat to: sephe
2016-01-14 05:02:33 +00:00
Sepherosa Ziehau
dd7a7dd6af hyperv: set receive buffer size according to NVSP protocol version
If the NVSP protocol version is not greater than NVSP_PROTOCOL_VERSION_2,
then the recv buffer size is 15MB, otherwise the buffer size is 16MB.

Submitted by:		Hongjiang Zhang <honzhan microsoft com>
Reviewed by:		royger, Dexuan Cui <decui microsoft com>, adrian
Approved by:		adrian (mentor)
Sponsored by:		Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D4814
2016-01-14 03:16:29 +00:00
Sepherosa Ziehau
1952924333 hyperv: add interrupt counters
Submitted by:		Howard Su <howard0su gmail com>
Reviewed by:		royger, Dexuan Cui <decui microsoft com>, adrian
Approved by:		adrian (mentor)
Sponsored by:		Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D4693
2016-01-14 03:11:35 +00:00
Sepherosa Ziehau
99781cb353 hyperv: implement an event timer
Submitted by:		Howard Su <howard0su@gmail.com>
Reviewed by:		delphij, royger, adrian
Approved by:		adrian (mentor)
Sponsored by:		Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D4676
2016-01-14 03:05:10 +00:00
Adrian Chadd
82104eda6a [gpiobus] handle the case of there being a single GPIO pin available.
PR:		kern/206035
Submitted by:	Stanislav Galabov <sgalabov@gmail.com>
2016-01-14 02:58:28 +00:00
Sepherosa Ziehau
358d08b83b hyperv: remove unused vmbus definitions
We don't need them at all.

Submitted by:		Dexuan Cui <decui microsoft com>
Sponsored by:		Microsoft OSTC
Reviewed by:		royger, adrian, delphij
Approved by:		adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D4595
2016-01-14 02:55:28 +00:00
Sepherosa Ziehau
69a53a7a3a hyperv: use x86 generic code to do the hypervisor detection
This is first step to move the generic part of HV code into kernel instead
of module, so that it is possible to use hypercall to implement some other
paravirtualization code in the kernel.

Submitted by:		Howard Su <howard0su@gmail.com>
Reviewed by:		royger, delphij, adrian
Approved by:		adrian (mentor)
Sponsored by:		Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D3072
2016-01-14 02:50:13 +00:00
Sepherosa Ziehau
5de888779e hyperv/hn: Unbreak LINT-NOIP
Reported by:	bz
Approved by:	adrain (mentor)
Sponsored by:	Microsoft OSTC
2016-01-14 02:32:50 +00:00
Devin Teske
9e35cfced5 Default to en_US.ISO8859-1 if no locale
MFC after:	3 days
X-MFC-to:	stable/10
2016-01-14 01:59:20 +00:00
Eric van Gyzen
414dbbaf56 numactl: fix CPU affinity when modifying an existing process or thread
numactl was only modifying its own CPU affinity, which is fine
when creating a new process, but not very helpful when modifying
an existing processes.

Reviewed by:	adrian
Sponsored by:	Dell Inc.
Differential Revision:	https://reviews.freebsd.org/D4927
2016-01-14 01:34:41 +00:00
Kevin Lo
c911734adb - Add the 'restrict' type qualifier to match function prototype.
- Remove sys/types.h.
2016-01-14 01:33:16 +00:00
Kevin Lo
6e9a914bb2 Suggest setting gateway_enable="YES" instead of sysctl net.inet.ip.forwarding=1 to enable packet forwarding.
Reviewed by:	glebius
2016-01-14 01:32:17 +00:00
Mark Johnston
807b6a646a Remove a dead local variable, missed in r274565.
MFC after:	3 days
Sponsored by:	EMC / Isilon Storage Division
2016-01-14 00:34:37 +00:00
Eric van Gyzen
50d901977a bsdinstall: Suggest the GPT+Active workaround on Dell T5810
The Dell Precision Tower 5810 fails to boot from GPT in Legacy/BIOS mode
without the Active flag in the Protective MBR.  Suggest the workaround
during installation.

Since an increasing number of Dell systems exhibit this behavior,
I imagine all Dells past a certain date will do so.  I would like
to suggest the workaround for all Dells with a BIOS date of, say,
2014 or later, but I would need to test a variety of systems before
committing such a change.

Reviewed by:	allanjude, dteske
MFC after:	5 days
Relnotes:	We should probably suggest using GPT+Active on "recent" Dells.
Sponsored by:	Dell Inc.
Differential Revision:	https://reviews.freebsd.org/D4075
2016-01-14 00:31:00 +00:00
Eric van Gyzen
8e402f34b9 libthr: const-ify two variables
Make the default umutex and urwlock initializers const,
because they can be, and as a microoptimization.

MFC after:	5 days
Sponsored by:	Dell Inc.
2016-01-13 22:34:55 +00:00
Brooks Davis
216818a1bb Avoid reading pass the end of the source buffer when it is not NUL
terminated.

If this buffer is adjacent to an unmapped page or a version of C with
bounds checked is used this may result in a crash.

PR:		206178
Submitted by:	Alexander Cherepanov <cherepan@mccme.ru>
MFC after:	1 week
2016-01-13 21:50:08 +00:00
Brooks Davis
cd3dbc2573 Avoid reading pass the end of the source buffer when it is not NUL
terminated.

If this buffer is adjacent to an unmapped page or a version of C with
bounds checked is used this may result in a crash.

PR:		206177
Submitted by:	Alexander Cherepanov <cherepan@mccme.ru>
MFC after:	1 week
2016-01-13 21:49:01 +00:00
Marius Strobl
e12a9f251e Given that em(4), lem(4) and igb(4) hardware doesn't require the
alignment guarantees provided by m_defrag(9), use m_collapse(9)
instead for performance reasons.
While at it, sanitize the statistics softc members, i. e. retire
unused ones and add SYSCTL nodes missing for actually used ones.

Differential Revision:	https://reviews.freebsd.org/D4717
2016-01-13 21:47:27 +00:00
Andrew Turner
f5e45e53f9 Add support for relocating AArch64 modules to kldxref. This fixes an error
message where it fails to read the module as the unrelocated addresses
are zero.

Sponsored by:	ABT Systems Ltd
2016-01-13 21:34:15 +00:00
Jean-Sébastien Pédron
fe8e65ae3d drm: Revert the part of r288653 about M_WAITOK vs M_NOWAIT
Using M_NOWAIT could lead to transient failures with ioctls.

Suggested by:	kib
2016-01-13 20:35:02 +00:00
Jean-Sébastien Pédron
bd2ebb612d drm/i915: Further reduce the diff with Linux 3.8
There is no functional change. The goal is to ease the future update to
Linux 3.8's i915 driver.
2016-01-13 19:52:25 +00:00