]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
8 years agoRemove aiod_timeout.
John Baldwin [Thu, 14 Jan 2016 21:28:56 +0000 (21:28 +0000)]
Remove aiod_timeout.

It hasn't been used since the AIO code was made MPSAFE 10 years ago.

Reviewed by: kib
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D4946

8 years agoImprovements to the MDXFileChunk() template function:
Jonathan T. Looney [Thu, 14 Jan 2016 21:08:23 +0000 (21:08 +0000)]
Improvements to the MDXFileChunk() template function:
- Remove unneeded fstat()/lseek() calls.
- Return NULL and set errno to EINVAL on negative length.
- Fix small style problems and expand variable names.

After this change, it is possible to use this code for some irregular
files. For example, 'md5 /dev/md0' should now succeed.

Differential Revision: https://reviews.freebsd.org/D4748
Suggested by: bde
Reviewed by: bde, allanjude, delphij

8 years agoRename aiod_bio taskqueue to aiod_kick.
John Baldwin [Thu, 14 Jan 2016 20:51:48 +0000 (20:51 +0000)]
Rename aiod_bio taskqueue to aiod_kick.

This taskqueue is not used to handle bio requests.  It is only used to
run aio_kick_nowait() to spin up new aio daemon processes.

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D4904

8 years agoFix order of last two arguments of mtx_init
Oleksandr Tymoshenko [Thu, 14 Jan 2016 20:25:22 +0000 (20:25 +0000)]
Fix order of last two arguments of mtx_init

Spotted by: jmcneill@NetBSD.org

8 years agoFix the handling of the "PDC write transfer length" erratum for at91. The
Ian Lepore [Thu, 14 Jan 2016 19:33:13 +0000 (19:33 +0000)]
Fix the handling of the "PDC write transfer length" erratum for at91.  The
problem affects revision 1xx hardware as well as later versions.  Also, the
recommended workaround is to set the PDC count register for a 12-byte
transfer when the actual size is less than that, but there is no need to
extend or zero-out the data buffer, because the blklen register contains
the real transfer size and only that many bytes will be transferred.

Also add a sysctl to turn debugging printfs on or off on the fly.

8 years agoSet -mlong-calls where needed to get a static clang and lldb 3.8.0
Andrew Turner [Thu, 14 Jan 2016 19:00:13 +0000 (19:00 +0000)]
Set -mlong-calls where needed to get a static clang and lldb 3.8.0
linking. These are too large for a branch instruction to branch from an
earlier point in the code to somewhere later.

This will also allow these to be build with Thumb-2 when we get this
infrastructure.

Reviewed by: dim
Differential Revision: https://reviews.freebsd.org/D4855

8 years agoOnly build EFI components on supported compilers
Steven Hartland [Thu, 14 Jan 2016 18:53:54 +0000 (18:53 +0000)]
Only build EFI components on supported compilers

As the in-tree GCC does not support __attribute__((ms_abi)) EFI can only
be built with Clang.

The EFI loader and boot1 validated this, but unused libefi was still built
causing issues under GCC after warnings where enabled by r293724.

Disable building all of EFI when the selected compiler is GCC.

MFC after: 2 weeks
X-MFC-With: r293268
Sponsored by: Multiplay

8 years agoRevert r293903
Steven Hartland [Thu, 14 Jan 2016 18:46:57 +0000 (18:46 +0000)]
Revert r293903

Revert r293903 as EFI shouldn't be built on this platform that the this
was reported on.

Sponsored by: Multiplay

8 years agoFix race condition involving ZFS remove events
Alan Somers [Thu, 14 Jan 2016 18:19:05 +0000 (18:19 +0000)]
Fix race condition involving ZFS remove events

When a ZFS drive disappears, ZFS sends a resource.fs.zfs.removed event to
userland. A userland program like zfsd(8) can use that event, for example to
activate a hotspare. The current code contains a race condition: vdev_geom
will sent the sysevent _before_ spa.c would update the vdev's status,
causing userland processes to see pool state that does not reflect the
device removal. This change moves the sysevent to spa.c, closing the race.

Reviewed by: delphij, Sean Eric Fagan
MFC after: 4 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D4902

8 years agoFix spelling of IPMI
Enji Cooper [Thu, 14 Jan 2016 18:04:49 +0000 (18:04 +0000)]
Fix spelling of IPMI

Sponsored by: EMC / Isilon Storage Division

8 years agoUpdate .Dd, missed in r294011
Benjamin Kaduk [Thu, 14 Jan 2016 17:16:47 +0000 (17:16 +0000)]
Update .Dd, missed in r294011

8 years agoWrap overlong comment lines.
Edward Tomasz Napierala [Thu, 14 Jan 2016 16:55:07 +0000 (16:55 +0000)]
Wrap overlong comment lines.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years agoFix the code to retry mount attempt in mountcritlocal if there are
Edward Tomasz Napierala [Thu, 14 Jan 2016 16:53:17 +0000 (16:53 +0000)]
Fix the code to retry mount attempt in mountcritlocal if there are
any root mount holds.  The previous one used a wrong conditional - the
"err=$?" assignment resets "$?" to 0.

Submitted by: jilles@
MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years agoFix panic in IP redirect. Panic was introduced in r293466.
Alexander V. Chernikov [Thu, 14 Jan 2016 16:31:00 +0000 (16:31 +0000)]
Fix panic in IP redirect. Panic was introduced in r293466.

Found by: Yamagi Burmeister <lists at yamagi.org>>

8 years agoDocument how to enter the debugger here. I'm sure there's some better
Warner Losh [Thu, 14 Jan 2016 16:23:07 +0000 (16:23 +0000)]
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

8 years agoFix building with GCC since PAGE_MASK is signed on i386.
John Baldwin [Thu, 14 Jan 2016 15:51:13 +0000 (15:51 +0000)]
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

8 years agoAdjust previous fix to conform to the existing style in this file.
John Baldwin [Thu, 14 Jan 2016 15:49:24 +0000 (15:49 +0000)]
Adjust previous fix to conform to the existing style in this file.

8 years agoMake ng_netflow(9) use new routing KPI.
Alexander V. Chernikov [Thu, 14 Jan 2016 13:14:12 +0000 (13:14 +0000)]
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.

8 years agoFail the SCTP_GET_ASSOC_NUMBER and SCTP_GET_ASSOC_ID_LIST
Michael Tuexen [Thu, 14 Jan 2016 11:25:28 +0000 (11:25 +0000)]
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

8 years agoInstall /etc/snmpd.config with 0600 permissions.
Gleb Smirnoff [Thu, 14 Jan 2016 10:25:18 +0000 (10:25 +0000)]
Install /etc/snmpd.config with 0600 permissions.

Noticed by: Pierre Kim
Security: SA-16:06.snmpd
Pointy hat to: glebius in 2005

8 years agoThere is a bug in tcp_output()'s implementation of the TCP_SIGNATURE
Gleb Smirnoff [Thu, 14 Jan 2016 10:22:45 +0000 (10:22 +0000)]
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

8 years agoCall crextend() before copying old credentials to the new credentials
Gleb Smirnoff [Thu, 14 Jan 2016 10:16:25 +0000 (10:16 +0000)]
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

8 years agoRegen after r293907.
Gleb Smirnoff [Thu, 14 Jan 2016 10:15:21 +0000 (10:15 +0000)]
Regen after r293907.

8 years agoChange linux get_robust_list system call to match actual linux one.
Gleb Smirnoff [Thu, 14 Jan 2016 10:13:58 +0000 (10:13 +0000)]
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

8 years agoVerify the packet length in sctp6_input().
Gleb Smirnoff [Thu, 14 Jan 2016 10:11:10 +0000 (10:11 +0000)]
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

8 years agoAllow file specific user-specified flag overrides
Steven Hartland [Thu, 14 Jan 2016 10:09:05 +0000 (10:09 +0000)]
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

8 years agoFix GCC warnings causing build failure after r293724
Steven Hartland [Thu, 14 Jan 2016 09:22:01 +0000 (09:22 +0000)]
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

8 years agosfxge: cleanup: quieten efx_mcdi_read_resonse_header error reporting
Andrew Rybchenko [Thu, 14 Jan 2016 09:20:25 +0000 (09:20 +0000)]
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

8 years agosfxge: add accessors for license-related MCDI calls to common code
Andrew Rybchenko [Thu, 14 Jan 2016 09:19:28 +0000 (09:19 +0000)]
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

8 years agosfxge: add table entries for License NVRAM partition
Andrew Rybchenko [Thu, 14 Jan 2016 09:14:40 +0000 (09:14 +0000)]
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

8 years agosfxge: cleanup: adjust efx_mcdi_get_port_modes() comment for clarity
Andrew Rybchenko [Thu, 14 Jan 2016 09:12:40 +0000 (09:12 +0000)]
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

8 years agosfxge: fix common code VPD iterator and duplicate tag verification
Andrew Rybchenko [Thu, 14 Jan 2016 09:11:20 +0000 (09:11 +0000)]
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

8 years agosfxge: use correct register definitions for setting interrupt moderation on Medford
Andrew Rybchenko [Thu, 14 Jan 2016 09:07:40 +0000 (09:07 +0000)]
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

8 years agosfxge: support FATSOv2 in common code
Andrew Rybchenko [Thu, 14 Jan 2016 09:05:51 +0000 (09:05 +0000)]
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

8 years agosfxge: rx_prefix_pktlen methods do not require EFSYS_OPT_RX_SCALE
Andrew Rybchenko [Thu, 14 Jan 2016 09:03:02 +0000 (09:03 +0000)]
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

8 years agosfxge: convert nvram size method to use partition id
Andrew Rybchenko [Thu, 14 Jan 2016 09:01:53 +0000 (09:01 +0000)]
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

8 years agosfxge: rework MCDI start request
Andrew Rybchenko [Thu, 14 Jan 2016 09:00:35 +0000 (09:00 +0000)]
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

8 years agosfxge: add Medford NIC methods
Andrew Rybchenko [Thu, 14 Jan 2016 08:59:38 +0000 (08:59 +0000)]
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

8 years agoRemove now-unused wrappers for various routing functions.
Alexander V. Chernikov [Thu, 14 Jan 2016 08:54:44 +0000 (08:54 +0000)]
Remove now-unused wrappers for various routing functions.

8 years agoPID file support hasn't been committed for ggated(8) yet. Unbreak running
Enji Cooper [Thu, 14 Jan 2016 07:39:05 +0000 (07:39 +0000)]
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

8 years agoRemove an unneeded assignment of the return value.
Ed Schouten [Thu, 14 Jan 2016 07:27:42 +0000 (07:27 +0000)]
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.

8 years agoRemove unnecessary kldload logic added to geom_subr.sh in r293028
Enji Cooper [Thu, 14 Jan 2016 07:27:14 +0000 (07:27 +0000)]
Remove unnecessary kldload logic added to geom_subr.sh in r293028

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

8 years agoUnbreak `make depend` with sys/modules/hyperv/vmbus after r293870
Enji Cooper [Thu, 14 Jan 2016 05:02:33 +0000 (05:02 +0000)]
Unbreak `make depend` with sys/modules/hyperv/vmbus after r293870

Pointyhat to: sephe

8 years agohyperv: set receive buffer size according to NVSP protocol version
Sepherosa Ziehau [Thu, 14 Jan 2016 03:16:29 +0000 (03:16 +0000)]
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

8 years agohyperv: add interrupt counters
Sepherosa Ziehau [Thu, 14 Jan 2016 03:11:35 +0000 (03:11 +0000)]
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

8 years agohyperv: implement an event timer
Sepherosa Ziehau [Thu, 14 Jan 2016 03:05:10 +0000 (03:05 +0000)]
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

8 years ago[gpiobus] handle the case of there being a single GPIO pin available.
Adrian Chadd [Thu, 14 Jan 2016 02:58:28 +0000 (02:58 +0000)]
[gpiobus] handle the case of there being a single GPIO pin available.

PR: kern/206035
Submitted by: Stanislav Galabov <sgalabov@gmail.com>

8 years agohyperv: remove unused vmbus definitions
Sepherosa Ziehau [Thu, 14 Jan 2016 02:55:28 +0000 (02:55 +0000)]
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

8 years agohyperv: use x86 generic code to do the hypervisor detection
Sepherosa Ziehau [Thu, 14 Jan 2016 02:50:13 +0000 (02:50 +0000)]
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

8 years agohyperv/hn: Unbreak LINT-NOIP
Sepherosa Ziehau [Thu, 14 Jan 2016 02:32:50 +0000 (02:32 +0000)]
hyperv/hn: Unbreak LINT-NOIP

Reported by: bz
Approved by: adrain (mentor)
Sponsored by: Microsoft OSTC

8 years agoDefault to en_US.ISO8859-1 if no locale
Devin Teske [Thu, 14 Jan 2016 01:59:20 +0000 (01:59 +0000)]
Default to en_US.ISO8859-1 if no locale

MFC after: 3 days
X-MFC-to: stable/10

8 years agonumactl: fix CPU affinity when modifying an existing process or thread
Eric van Gyzen [Thu, 14 Jan 2016 01:34:41 +0000 (01:34 +0000)]
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

8 years ago- Add the 'restrict' type qualifier to match function prototype.
Kevin Lo [Thu, 14 Jan 2016 01:33:16 +0000 (01:33 +0000)]
- Add the 'restrict' type qualifier to match function prototype.
- Remove sys/types.h.

8 years agoSuggest setting gateway_enable="YES" instead of sysctl net.inet.ip.forwarding=1 to...
Kevin Lo [Thu, 14 Jan 2016 01:32:17 +0000 (01:32 +0000)]
Suggest setting gateway_enable="YES" instead of sysctl net.inet.ip.forwarding=1 to enable packet forwarding.

Reviewed by: glebius

8 years agoRemove a dead local variable, missed in r274565.
Mark Johnston [Thu, 14 Jan 2016 00:34:37 +0000 (00:34 +0000)]
Remove a dead local variable, missed in r274565.

MFC after: 3 days
Sponsored by: EMC / Isilon Storage Division

8 years agobsdinstall: Suggest the GPT+Active workaround on Dell T5810
Eric van Gyzen [Thu, 14 Jan 2016 00:31:00 +0000 (00:31 +0000)]
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

8 years agolibthr: const-ify two variables
Eric van Gyzen [Wed, 13 Jan 2016 22:34:55 +0000 (22:34 +0000)]
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.

8 years agoAvoid reading pass the end of the source buffer when it is not NUL
Brooks Davis [Wed, 13 Jan 2016 21:50:08 +0000 (21:50 +0000)]
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

8 years agoAvoid reading pass the end of the source buffer when it is not NUL
Brooks Davis [Wed, 13 Jan 2016 21:49:01 +0000 (21:49 +0000)]
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

8 years agoGiven that em(4), lem(4) and igb(4) hardware doesn't require the
Marius Strobl [Wed, 13 Jan 2016 21:47:27 +0000 (21:47 +0000)]
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

8 years agoAdd support for relocating AArch64 modules to kldxref. This fixes an error
Andrew Turner [Wed, 13 Jan 2016 21:34:15 +0000 (21:34 +0000)]
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

8 years agodrm: Revert the part of r288653 about M_WAITOK vs M_NOWAIT
Jean-Sébastien Pédron [Wed, 13 Jan 2016 20:35:02 +0000 (20:35 +0000)]
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

8 years agodrm/i915: Further reduce the diff with Linux 3.8
Jean-Sébastien Pédron [Wed, 13 Jan 2016 19:52:25 +0000 (19:52 +0000)]
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.

8 years agoRemove dead code when the target processor has POPCNT instruction.
Jung-uk Kim [Wed, 13 Jan 2016 19:19:50 +0000 (19:19 +0000)]
Remove dead code when the target processor has POPCNT instruction.

8 years agoImprove non-interactive forth cmd error reporting
Steven Hartland [Wed, 13 Jan 2016 18:33:12 +0000 (18:33 +0000)]
Improve non-interactive forth cmd error reporting

Non-interactive forth command errors where silent even for critical issues
e.g. failing to load a required kernel module or mfs_root.

This resulted in later unexplained and hard to trace errors such as mount
root failures.

This introduces additional command return codes that are treated
appropriately by the non-interactive command processor (bf_command).
* CMD_CRIT = print error
* CMD_FATAL = panic

Also fix minor style(9) issues with command_load return codes.

MFC after: 2 weeks
X-MFC-With: r293268
Sponsored by: Multiplay

8 years agoRemove some unneeded headers
Baptiste Daroussin [Wed, 13 Jan 2016 17:59:12 +0000 (17:59 +0000)]
Remove some unneeded headers

8 years agoFix Coverity warnings regarding r293229
Alan Somers [Wed, 13 Jan 2016 17:33:50 +0000 (17:33 +0000)]
Fix Coverity warnings regarding r293229

rpcbind/check_bound.c
Fix CID1347798, a memory leak in mergeaddr.

rpcbind/tests/addrmerge_test.c
Fix CID1347800 through CID1347803, memory leaks in ATF tests.  They
are harmless because each ATF test case runs in its own process, but
they are trivial to fix.  Fix a few other leaks that Coverity didn't
detect, too.

Coverity CID: 13477981347800134780113478021347803
MFC after: 2 weeks
X-MFC-With: 293229
Sponsored by: Spectra Logic Corp

8 years agoRemove the compat code to handle the kernel passing us an unalinged
Andrew Turner [Wed, 13 Jan 2016 15:54:17 +0000 (15:54 +0000)]
Remove the compat code to handle the kernel passing us an unalinged
stackpointer. Userland expects the kernel to pass it an aligned sp and
pass a pointer to the arguments in x0. The kernel side was updated in
r289502, 3 months ago.

Sponsored by: ABT Systems Ltd

8 years agoIncrease efiboot.img size used in ISO creation
Steven Hartland [Wed, 13 Jan 2016 14:47:13 +0000 (14:47 +0000)]
Increase efiboot.img size used in ISO creation

Due to recent and upcoming changes to add additional functionality to
the EFI loader its now bigger than the space allocates for efiboot.img
so increase this in line with boot1.efifat.

MFC after: 2 weeks
X-MFC-With: r293268
Sponsored by: Multiplay

8 years agoFix the spelling of fueword* to eliminate compile warnings about mismatched
Ian Lepore [Wed, 13 Jan 2016 14:39:39 +0000 (14:39 +0000)]
Fix the spelling of fueword* to eliminate compile warnings about mismatched
begin/end symbols when the warning level is turned up.

Submitted by: Steve Kiernan <stevek@juniper.net>

8 years agoRemove RTF_RNH_LOCKED support from rtalloc1_fib().
Alexander V. Chernikov [Wed, 13 Jan 2016 14:32:48 +0000 (14:32 +0000)]
Remove RTF_RNH_LOCKED support from rtalloc1_fib().

Last caller using it was eliminated in r293471.

Sponsored by: Yandex LLC

8 years agoStore the timer type for logging, because the timer can be freed
Michael Tuexen [Wed, 13 Jan 2016 14:28:12 +0000 (14:28 +0000)]
Store the timer type for logging, because the timer can be freed
during processing the timerout.

MFC after: 3 days

8 years agoMake devfs_fpdrop() static. It was not a public KPI, and it has no
Konstantin Belousov [Wed, 13 Jan 2016 14:03:06 +0000 (14:03 +0000)]
Make devfs_fpdrop() static.  It was not a public KPI, and it has no
reason to remain exported for some time.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

8 years agoMove the funsetown(9) call from audit_pipe_close() to cdevpriv
Konstantin Belousov [Wed, 13 Jan 2016 14:02:07 +0000 (14:02 +0000)]
Move the funsetown(9) call from audit_pipe_close() to cdevpriv
destructor.  As result, close method becomes trivial and removed.
Final cdevsw close method might be called without file
context (e.g. in vn_open_vnode() if the vnode is reclaimed meantime),
which leaves ap_sigio registered for notification, despite cdevpriv
destructor frees the memory later.

Call destructor instead of doing a cleanup inline, for
devfs_set_cdevpriv() failure in open.  This adds missed funsetown(9)
call and locks ap to satisfy audit_pipe_free() invariants.

Reported and tested by: pho (previous version)
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

8 years agoSwitch legacy pty clone handler to use make_dev_s(9). Add
Konstantin Belousov [Wed, 13 Jan 2016 12:01:28 +0000 (12:01 +0000)]
Switch legacy pty clone handler to use make_dev_s(9).  Add
MAKEDEV_CHECKNAME flag to the call, this is required to not panic on
race between the clone and destructing the closed master.

Reported by and discussed with: bde
Tested by: pho (as part of the larger patch)
Sponsored by: The FreeBSD Foundation
MFC after: 3 weeks

8 years agoIntegrate
Enji Cooper [Wed, 13 Jan 2016 09:14:27 +0000 (09:14 +0000)]
Integrate
tools/regression/geom_{concat,eli,gate,mirror,nop,raid3,shsec,stripe,uzip}
in to the FreeBSD test suite as
tests/sys/geom/class/{concat,eli,gate,mirror,nop,raid3,shsec,stripe,uzip}

The tools/regression/geom and tools/regression/geom_part testcases are being
left alone because both test sets are both currently broken.

The majority of this work was done on ^/user/ngie/more-tests2 . The differences
are as follows:
- tests/sys/geom/class/Makefile.inc is not present; it was
  inlined into the class's Makefiles for explicitness.
- The testcases officially require root via kyua
- The geom_gate(4) tests don't use the pidfile changes proposed in
  https://reviews.freebsd.org/D4836 .

MFC after: 1 month
Sponsored by: EMC / Isilon Storage Division

8 years agosfxge: cleanup: fix return code types
Andrew Rybchenko [Wed, 13 Jan 2016 08:09:28 +0000 (08:09 +0000)]
sfxge: cleanup: fix return code types

Submitted by:   Richard Houldsworth <rhouldsworth at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days

8 years agosfxge: cleanup: fix typo in unused EFX_QWORD_IS_SET64
Andrew Rybchenko [Wed, 13 Jan 2016 07:55:47 +0000 (07:55 +0000)]
sfxge: cleanup: fix typo in unused EFX_QWORD_IS_SET64

Submitted by:   Richard Houldsworth <rhouldsworth at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days

8 years agosfxge: cleanup: prefast fixes in common code
Andrew Rybchenko [Wed, 13 Jan 2016 07:46:21 +0000 (07:46 +0000)]
sfxge: cleanup: prefast fixes in common code

Submitted by:   Andrew Lee <alee at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days

8 years agoAdd conf.sh file missed in r293621
Enji Cooper [Wed, 13 Jan 2016 07:31:59 +0000 (07:31 +0000)]
Add conf.sh file missed in r293621

MFC after: 16 days
Sponsored by: EMC / Isilon Storage Division

8 years agosfxge: cleanup: simplify EFX header includes
Andrew Rybchenko [Wed, 13 Jan 2016 07:25:51 +0000 (07:25 +0000)]
sfxge: cleanup: simplify EFX header includes

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days

8 years agosfxge: define FATSOv2 option descriptors
Andrew Rybchenko [Wed, 13 Jan 2016 07:11:43 +0000 (07:11 +0000)]
sfxge: define FATSOv2 option descriptors

Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days

8 years agosfxge: add Medford firmware subtypes definitions
Andrew Rybchenko [Wed, 13 Jan 2016 06:47:47 +0000 (06:47 +0000)]
sfxge: add Medford firmware subtypes definitions

Pulled firmware_ids.h from firmwaresrc and applied genfwdef script.

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/D4897

8 years agosfxge: support MC_CMD_GET_CAPABILITIES_V2
Andrew Rybchenko [Wed, 13 Jan 2016 06:45:05 +0000 (06:45 +0000)]
sfxge: support MC_CMD_GET_CAPABILITIES_V2

Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D4896

8 years agosfxge: simplify conversion of NVRAM types to/from partition ids
Andrew Rybchenko [Wed, 13 Jan 2016 06:44:05 +0000 (06:44 +0000)]
sfxge: simplify conversion of NVRAM types to/from partition ids

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/D4895

8 years agosfxge: simplify MCDI request start
Andrew Rybchenko [Wed, 13 Jan 2016 06:42:51 +0000 (06:42 +0000)]
sfxge: simplify MCDI request start

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/D4894

8 years agosfxge: note VI_SHIFT reported in ALLOC_VIS response
Andrew Rybchenko [Wed, 13 Jan 2016 06:41:39 +0000 (06:41 +0000)]
sfxge: note VI_SHIFT reported in ALLOC_VIS response

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/D4892

8 years agosfxge: rework RX prefix handling in the common code
Andrew Rybchenko [Wed, 13 Jan 2016 06:40:00 +0000 (06:40 +0000)]
sfxge: rework RX prefix handling in the common code

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/D4889

8 years agosfxge: remove unused common code EFSYS_OPT_RX_HDR_SPLIT
Andrew Rybchenko [Wed, 13 Jan 2016 06:37:45 +0000 (06:37 +0000)]
sfxge: remove unused common code EFSYS_OPT_RX_HDR_SPLIT

The EFSYS_OPT_RX_HDR_SPLIT optional feature in the common code
implemented the Lookahead Split feature of Windows. This split
received packets at a preconfigured byte offset, and delivered
the header and payload portions to separate receive queues.

Now the common code interface has no callers, so remove it.

Note that this should not be confused with the Header Data Split
feature of Windows, which splits packets at a header boundary.

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D4888

8 years agosfxge: rename common hunt NIC methods to ef10
Andrew Rybchenko [Wed, 13 Jan 2016 06:34:51 +0000 (06:34 +0000)]
sfxge: rename common hunt NIC methods to ef10

Submitted by:   Mark Spender <mspender at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D4880

8 years agoypldap(8) is a feature ready to be used to translate nis(8) database to ldap(3).
Marcelo Araujo [Wed, 13 Jan 2016 01:49:35 +0000 (01:49 +0000)]
ypldap(8) is a feature ready to be used to translate nis(8) database to ldap(3).

This commit, fix a core dump on ypldap(8) related with memory allocation.
Also an example of how to set the ypldap.conf(5) properly is added to
examples files.

A new user _ypldap is required to be able to run ypldap(8) as well as
in a chroot mode.

Reviewed by: rodrigc (mentor), bjk
Approved by: bapt (mentor)
Relnotes: Yes
Sponsored by: gandi.net
Differential Revision: https://reviews.freebsd.org/D4744

8 years agoFix typo in libefi.c
Steven Hartland [Wed, 13 Jan 2016 00:37:28 +0000 (00:37 +0000)]
Fix typo in libefi.c

Fix a typo in libefl.c (removal or L) introduced by r293724

MFC after: 2 weeks
X-MFC-With: r293268
Sponsored by: Multiplay

8 years agoGo back to using uintptr_t, because code that actually compiles is
Ian Lepore [Wed, 13 Jan 2016 00:22:12 +0000 (00:22 +0000)]
Go back to using uintptr_t, because code that actually compiles is
infinitely less buggy than code that is theoretically correct in some
alternate universe.

The uintfptr_t type is apparently a freebsd invention, and exists only when
compiling the kernel.  It's a little hard to say for sure, since it doesn't
seem to be documented anywhere except in email advice to unsuspecting and
overly-trusting souls, who then get to wear the pointy hat for blindly
following advice without investigating or testing it first.

8 years agoUpdate futimens/utimensat for MFC to stable/10:
Jilles Tjoelker [Tue, 12 Jan 2016 20:53:57 +0000 (20:53 +0000)]
Update futimens/utimensat for MFC to stable/10:

* Fix __FreeBSD_version check.
* Update history section in man page.

An MFC of this commit to stable/10 will allow using the new system calls
instead of the fallback.

MFC after: 3 days

8 years agoRestore uart PPS signal capture polarity to its historical norm, and add an
Ian Lepore [Tue, 12 Jan 2016 18:42:00 +0000 (18:42 +0000)]
Restore uart PPS signal capture polarity to its historical norm, and add an
option to invert the polarity in software. Also add an option to capture
very narrow pulses by using the hardware's MSR delta-bit capability of
latching line state changes.

This effectively reverts the mistake I made in r286595 which was based on
empirical measurements made on hardware using TTL-level signaling, in which
the logic levels are inverted from RS-232. Thus, this re-syncs the polarity
with the requirements of RFC 2783, which is writen in terms of RS-232
signaling.

Narrow-pulse mode uses the ability of most ns8250 and similar chips to
provide a delta indication in the modem status register. The hardware is
able to notice and latch the change when the pulse width is shorter than
interrupt latency, which results in the signal no longer being asserted by
time the interrupt service code runs. When running in this mode we get
notified only that "a pulse happened" so the driver synthesizes both an
ASSERT and a CLEAR event (with the same timestamp for each). When the pulse
width is about equal to the interrupt latency the driver may intermittantly
see both edges of the pulse. To prevent generating spurious events, the
driver implements a half-second lockout period after generating an event
before it will generate another.

Differential Revision: https://reviews.freebsd.org/D4477

8 years agoCast using uintfptr_t and eliminate the cast to uint64_t which is uneeded
Ian Lepore [Tue, 12 Jan 2016 16:31:07 +0000 (16:31 +0000)]
Cast using uintfptr_t and eliminate the cast to uint64_t which is uneeded
because rounding down cannot increase the number of bits needed to express
the result.

I had no idea there was such a thing as uintfptr_t.

Requested by: bde

8 years agosfxge: regenerate MCDI header
Andrew Rybchenko [Tue, 12 Jan 2016 16:21:34 +0000 (16:21 +0000)]
sfxge: regenerate MCDI header

Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days

8 years agosfxge: remove obsolete lookahead split RXQ support
Andrew Rybchenko [Tue, 12 Jan 2016 15:35:00 +0000 (15:35 +0000)]
sfxge: remove obsolete lookahead split RXQ support

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/D4891

8 years agosfxge: pass context type and num_queues to efx_mcdi_rss_context_alloc
Andrew Rybchenko [Tue, 12 Jan 2016 15:33:48 +0000 (15:33 +0000)]
sfxge: pass context type and num_queues to efx_mcdi_rss_context_alloc

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/D4890

8 years agoFix local macro for early KVA allocation.
Svatopluk Kraus [Tue, 12 Jan 2016 15:31:32 +0000 (15:31 +0000)]
Fix local macro for early KVA allocation.

Only crashdumpmap allocation was affected which is used for temporary
mappings during panic dump.

Approved by: kib (mentor)