Commit Graph

211761 Commits

Author SHA1 Message Date
Conrad Meyer
9183be81a7 stdio.h: Fix function-type typedef style and use _types.h __ssize_t
I'm still not sure why only Pypy runs into the error with the function
typedefs.  Fix it anyway.

Use __ssize_t instead of ssize_t for the types; it's possible for the size_t
type to not be visible if at the wrong POSIX_VISIBLE level.

A final (crossing my fingers) follow-up to r299456.

Sponsored by:	EMC / Isilon Storage Division
2016-05-12 22:13:12 +00:00
Don Lewis
90abdc2dd7 Use strlcpy() instead of strncpy() when copying to dom_domain to
ensure that the latter is NUL terminated since it is passed
as an argument to *printf().

Warn about NIS domains that are too long.

Reported by:	Coverity
CID:		1009620, 1009621
MFH:		1 week
2016-05-12 21:35:40 +00:00
Conrad Meyer
1deb20f631 libc: Actually export fopencookie(3)
A follow-up to r299456.

Sponsored by:	EMC / Isilon Storage Division
2016-05-12 21:30:22 +00:00
Conrad Meyer
6710d21d9f Pollute more places with off64_t and add __off64_t
Despite the private namespace, several broken ports depend on the __off64_t
name for the type.  Export it exactly the same way off_t and __off_t are
exported.

A follow-up to r299456.

Suggested by:	php56
Sponsored by:	EMC / Isilon Storage Division
2016-05-12 21:18:17 +00:00
Oleksandr Tymoshenko
81d3ea9f28 Add loadable module for gpiokeys 2016-05-12 20:20:54 +00:00
Oleksandr Tymoshenko
3c977d6f36 Fix detach routine for gpiokeys
- Release pin only when all per=key callouts are stopped
- Unregister keyboard when detaching device node
2016-05-12 20:15:23 +00:00
Oleksandr Tymoshenko
f058b6fbee Properly release mapped pin in gpio_pin_release 2016-05-12 20:13:16 +00:00
Oleksandr Tymoshenko
3381a3898a Add gpiobus_release_pin function to release mapped pin
Add gpiobus_release_pin as a counterpart for gpiobus_map_pin. Without it
it's impossible to properly release pin so if kernel module is reloaded
it can't re-use pins again
2016-05-12 20:12:45 +00:00
Nick Hibma
3868814725 Add myself to the list of src committers. I've never been added it
seems.
2016-05-12 20:04:09 +00:00
Nick Hibma
6d07c1575b Allow silencing of 'promiscuous mode enabled/disabled' messages.
PR:		166255
Submitted by:	eugen.grosbein.net
Obtained from:	eugen.grosbein.net
MFC after:	1 week
2016-05-12 19:42:13 +00:00
Steven Kreuzer
16403ff439 Document r296633, OpenSSH updated to 7.2p2.
Approved by:	gjb@ (implicit with re@ hat on)
2016-05-12 19:32:40 +00:00
Eric Joyner
6bb8f4f665 ixl: Re-add a change to TC0 setup made in D5203.
Differential Revision:  https://reviews.freebsd.org/D6211
Reviewed by:    sbruno, kmacy, jeffrey.e.pieper@intel.com
MFC after:      2 weeks
Sponsored by:   Intel Corporation
2016-05-12 18:22:34 +00:00
Eric Joyner
d4683565fd ixl: Update to 1.4.27-k.
Changes:

Kevin Scott		i40e-shared: Save off VSI resource count when updating VSI
Anjali Singhai Jain	i40e-shared: Expose some registers to program parser, FD and RSS logic
Eric Joyner		ixl: Fix errors in queue interrupt setup in MSIX mode.
Shannon Nelson		i40e-shared: implement and use rx ctl helper functions
Shannon Nelson		i40e-shared: don't use AQ calls from clear_hw
Eric Joyner		ixl: Use rx ctl read/write functions instead of register accesses in certain places.
Shannon Nelson		i40e-shared: add adminq commands for rx ctl registers
Shannon Nelson		i40e-shared: implement and use rx ctl helper functions
Jeremiah Kyle		i40e-shared: Corrected function name in comment block
Deepthi Kavalur		i40e-shared: correcting a HW capability display info
Shannon Nelson		i40e-shared: fixups for (Linux) upstream consistency
Eric Joyner		ixl: Only stop firmware's LLDP agent on older firmware versions.

Differential Revision:  https://reviews.freebsd.org/D6211
Reviewed by:    sbruno, kmacy, jeffrey.e.pieper@intel.com
MFC after:      2 weeks
Sponsored by:   Intel Corporation
2016-05-12 18:22:12 +00:00
Eric Joyner
6d011ad5f6 ixl: Update to 1.4.24-k.
Changes by author:

Eric Joyner		ixl: Fix compile error when IXL_DEBUG is defined.
Eric Joyner		ixl: Fix taskqueues created in init() not being freed in stop().
Eric Joyner		ixl: Add additional debug sysctls, for Tx and Rx queue stats.
Eric Joyner		ixl: Enable dynamic itr by default.
Eric Joyner		ixl: Edit spacing, comments,  function signatures (to conform to style(9)).
Eric Joyner		ixl: Check for errors when tearing down msix interrupts.
Eric Joyner		ixl: Remove unnecessary register reads/writes.
Eric Joyner		ixl: Remove admin queue interrupt enable from general interrupt enable.
Eric Joyner		ixl: Update switch config after teardown/reset flow in init().
Eric Joyner		ixl: Add additional admin queue error code output to admin queue call errors.
Eric Joyner		ixl: Don't destroy i40e spinlock if it's already uninitialized.
Shannon Nelson		i40e-shared: clean event descriptor before use
Anjali Singhai Jain	i40e-shared: When in promisc mode apply promisc mode to Tx Traffic as well
Kevin Scott		i40e_shared: Increase timeout when checking GLGEN_RSTAT_DEVSTATE bit
Eric Joyner		ixlv: Fix IXL_DEBUG compile issue.
Eric Joyner		ixlv: Attempt to fix panic/other issues when rapidly unloading/loading driver.
Eric Joyner		ixl/ixlv: Revert m_collapse() in ixl_xmit() to m_defrag().
Deepthi Kavalur		i40e_shared: Trace logging HW capabilities
Eric Joyner		ixlv: Correctly unlock/relock around init() call in vc_completion().
Eric Joyner		ixl: Stop preventing changing flow control mode for CR4 media.
Eric Joyner		ixl: Set IPv6 TCP offload flag when doing TSO.

Differential Revision:  https://reviews.freebsd.org/D6211
Reviewed by:    sbruno, kmacy, jeffrey.e.pieper@intel.com
MFC after:      2 weeks
Sponsored by:   Intel Corporation
2016-05-12 18:21:52 +00:00
Eric Joyner
6c42605965 ixl: Update to 1.4.20-k.
Changes by author:

Eric Joyner	ixl: Add more error messages/checks to ixl_vsi_assign_msix().
Eric Joyner	ixl/ixlv: Clarify a comment about descriptors.
Eric Joyner	ixl/ixlv: Improve i40e_debug() implementation.
Eric Joyner	ixl/ixlv: Remove unused ASSERT() macro; move struct around.
Eric Joyner	ixl: Set initial advertised speed value in init_locked().
Eric Joyner	ixl: Fix flow control sysctl value being stored when new value is invalid.
Eric Joyner	Edit comments and spacing.
Carolyn Wyborny	i40e-shared: Add functions to blink led on Coppervale PHY
Eric Joyner	ixl: Re-do interrupt setup.
Eric Joyner	ixl: Remove VFLR task setup from legacy flow.
Eric Joyner	ixl: Shutdown/setup HMC when handling an EMPR reset.

Differential Revision:  https://reviews.freebsd.org/D6211
Reviewed by:    sbruno, kmacy, jeffrey.e.pieper@intel.com
MFC after:      2 weeks
Sponsored by:   Intel Corporation
2016-05-12 18:21:34 +00:00
Eric Joyner
1d767a8eae ixl: Update to 1.4.17-k.
Changes:

Kiran Patil	i40e-shared: APIs to Add/remove port mirroring rules
Shannon Nelson	i40e-shared: add VEB stat control and remove L2 cloud filter
Eric Joyner	ixl: Update NVM version information shown.
Eric Joyner	ixl: Remove empty else block.
Eric Joyner	ixl: Slightly re-work ixl_init_msix().
Eric Joyner	ixl: Remove duplicate queue enablement.
Shannon Nelson	i40e-shared: implement the API function for aq_set_switch_config
Eric Joyner	ixl: Update nvm version string shown in sysctl.
Eric Joyner	ixl/ixlv: Changes to PF/VF minor version checking/handling.
Eric Joyner	ixlv: Reduce maximum wait time for responses to VF AQ messages.
Eric Joyner	ixl/ixlv: Edit comments, comment out code, and edit spacing.
Eric Joyner	ixl: Print log message when SR-IOV init is successful.
Eric Joyner	ixl: Add Tx Flow Control filter from main PF VSI.
Eric Joyner	ixlv: Add extra error message when ixlv_get_vf_config times out.
Eric Joyner	ixl: Assign current MOCS optics the XLPPI media type.
Eric Joyner	ixl: Remove conditional wait after link status event.
Eric Joyner	ixl: Add line break and remove extraneous return statement.
Eric Joyner	ixl: Allow 40G speeds in the advertise_speed sysctl.
Eric Joyner	ixl: Add "CRC enable" field to link_status sysctl output.
Eric Joyner	ixl: Move sbuf.h include out of IXL_DEBUG* defines.
Eric Joyner	ixl: Move remaining debug sysctl funcs to IXL_DEBUG_SYSCTL define.
Eric Joyner	ixl: Add cases for all remaining media types in shared code to media_status().

Differential Revision:  https://reviews.freebsd.org/D6211
Reviewed by:    sbruno, kmacy, jeffrey.e.pieper@intel.com
MFC after:      2 weeks
Sponsored by:   Intel Corporation
2016-05-12 18:21:17 +00:00
Eric Joyner
95bb050439 ixl: Update to 1.4.13-k.
Changes:

Shannon Nelson		i40e-shared: set shared bit for multicast filters
Piotr Raczynski		i40e-shared: Bump AQ minor version for FVL/FPK
Eric Joyner		ixl: Remove call to i40e_aq_set_mac_config() in init path.
Eric Joyner		ixl: Always add interface mac address to driver+hw filter list.
Eric Joyner		ixl: Edit comments.
Eric Joyner		ixl: Add more descriptive sysctl help messages.
Eric Joyner		ixl: Report more info in link_status sysctl.
Eric Joyner		ixl: Flip set_aq_phy_int_mask mask bits.

Differential Revision:  https://reviews.freebsd.org/D6211
Reviewed by:    sbruno, kmacy, jeffrey.e.pieper@intel.com
MFC after:      2 weeks
Sponsored by:   Intel Corporation
2016-05-12 18:20:59 +00:00
Eric Joyner
fdb6f38a3d ixl: Update to 1.4.12-k.
Changes by author:

Eric Joyner		ixl: Remove substitution of EACCES for EPERM when perrno is set on an nvmupdate command return.
Eric Joyner		ixl: Print message when hardware sends GRST interrupt.
Eric Joyner		ixl: Fix kernel panic when driver fails to initialize admin queue.
Eric Joyner		ixl: Print out messages when a non-handled other interrupt occurs.
Eric Joyner		ixl: Fix spaces in a couple messages.
Eric Joyner		ixl: Add lock around nvmupd command entry point and reconvert EPERM errors to EACCES.
Anjali Singhai Jain	i40e-shared: Make some changes in the nvm read code
Shannon Nelson		i40e-shared: AQ Add Run PHY Activity struct
Shannon Nelson		i40e-shared: AQ Add Geneve cloud tunnel type
Shannon Nelson		i40e-shared: AQ Add external power class to get link status response struct
Shannon Nelson		i40e-shared: AQ Add shared resource flags for macvlan filters
Shannon Nelson		i40e-shared: AQ Add set_switch_config
Shannon Nelson		i40e-shared: AQ Add VXLAN-GPE tunnel type for cloud filter and tunnel commands
Shannon Nelson		i40e-shared: AQ thermal sensor control struct
Shannon Nelson		i40e-shared: Bump AQ minor version to 1.5 for FVL5 features
Shannon Nelson		i40e-shared: add a little more to an NVM update debug message
Carolyn Wyborny		i40e-shared: Fix for PHY NVM interaction problem
Eric Joyner		i40e-shared: Add prototypes for private NVM write functions
Eric Joyner		ixl/ixlv: Remove unused define from ixl.h.
Eric Joyner		ixl: Add handling of EMP reset for nvm update purposes.
Eric Joyner		ixl: Move addition of device sysctls to separate function.
Eric Joyner		ixl: Fix up a couple error messages in ixl_attach().
Eric Joyner		ixl: Update the hardware resource allocation debug sysctl.

Differential Revision:  https://reviews.freebsd.org/D6211
Reviewed by:    sbruno, kmacy, jeffrey.e.pieper@intel.com
MFC after:      2 weeks
Sponsored by:   Intel Corporation
2016-05-12 18:20:36 +00:00
Eric Joyner
7f70bec623 ixl: Update to 1.4.9-k.
Changes by author:

Kamil Krawczyk		i40e-shared: use explicit cast from u16 to u8
Anjali Singhai Jain	i40e-shared: Add a Virtchnl offload for RSS PCTYPE V2
Eric Joyner		ixl: Remove HP device IDs.
Jesse Brandeburg	i40e-shared: add small bit of debug
Mitch Williams		i40e-shared: check for stopped admin queue
Mitch Williams		i40e-shared: set aq count after memory allocation
Jesse Brandeburg	i40e-shared: remove forever unused ID
Eric Joyner		ixl: Fix bug where RSS does not hash to more than 16 queues.
Shannon Nelson		i40e-shared: define function capabilities in only one place
Eric Joyner		ixl: Change spacing, comments, and a single error message.
Eric Joyner		ixl: Save admin queue phy interrupt mask as a define.
Eric Joyner		ixl: Move callout_reset() to later in init_locked(), and stop clearing OACTIVE in driver flags.
Eric Joyner		ixl: Add new reset+build flow to init() if it detects that the admin queue is stopped.
Eric Joyner		ixl: Return EACCES instead of EPERM when an nvmupdate command fails.
Eric Joyner		ixl: Remove KX_A device ID.

Differential Revision:  https://reviews.freebsd.org/D6211
Reviewed by:    sbruno, kmacy, jeffrey.e.pieper@intel.com
MFC after:      2 weeks
Sponsored by:   Intel Corporation
2016-05-12 18:20:18 +00:00
Eric Joyner
223d846d93 ixl: Update to 1.4.7-k.
Changes by author:

Helin Zhang		i40e_shared: Fix compilation error - pointer-arith
Paul M Stillwell Jr	i40e-shared: Replace sprintf with i40e_debug
Anjali Singhai Jain	i40e-shared: Fix an accidental error with BIT_ULL replacement
Jesse Brandeburg	i40e-shared: remove useless assignments
Anjali Singhai Jain	i40e-shared: Add a workaround to drop all flow control frames
Anjali Singhai Jain	i40e-shared: Add new response struct from FW for AQ command i40e_aqc_lldp_set_local_mib
Anjali Singhai Jain	i40e-shared: Acquire NVM, before issuing an AQ read nvm command
Eric Joyner		ixl/ixlv: Remove unused MAX_LOOP define.
Eric Joyner		ixl: Remove extra aq_get_link_info() call in attach().
Eric Joyner		ixl: Modify a couple error messages in attach() to be more informative.
Eric Joyner		ixl: Add i40e_get_link_status() call to init_locked().
Eric Joyner		ixl: Move callout_stop() to earlier in ixl_stop().
Eric Joyner		ixl: Add extra comments around link ITR code.
Eric Joyner		ixl: Attempt to enhance link event handling.
Eric Joyner		ixl: Style, spacing, and comment changes.
Eric Joyner		ixl: Add I40E_NVM_ACCESS definition.
Eric Joyner		ixl: Add interface for nvmupdate tool ioctl to driver.
Eric Joyner		ixl: Don't strip out nvm update support from the driver anymore.
Eric Joyner		ixl: Interrupts are now allocated/setup and torn down/released on init()/stop().

Differential Revision:  https://reviews.freebsd.org/D6211
Reviewed by:    sbruno, kmacy, jeffrey.e.pieper@intel.com
MFC after:      2 weeks
Sponsored by:   Intel Corporation
2016-05-12 18:19:53 +00:00
Eric Joyner
a48d00d276 ixl: Update to 1.4.6-k.
Changes by author:

Greg Rose		ixl: Add MAC+VLAN filter for LAA MAC assignment
Carolyn Wyborny		i40e_shared: fix for PHY NVM interaction problem
Anjali Singhai Jain	i40e-shared: Fix an accidental error with BIT_ULL replacement
Eric Joyner		ixl: Fix potential crash when loading driver a startup and cannot setup all requested MSIX vectors.
Eric Joyner		ixl: Add max of 8 queues limit to autoconfig.
Eric Joyner		ixl: Re-add ian@'s sysctl fixes from upstream (r280043).

Differential Revision:  https://reviews.freebsd.org/D6211
Reviewed by:    sbruno, kmacy, jeffrey.e.pieper@intel.com
MFC after:      2 weeks
Sponsored by:   Intel Corporation
2016-05-12 18:19:31 +00:00
Eric Joyner
ac83ea833d ixl: Update to 1.4.5-k.
This first update will revert some upstream changes; forthcoming updates will reinstate them.

Changes, by author:

Anjali Singhai Jain		i40e-shared: Add WB_ON_ITR offload support
Shannon Nelson			i40e-shared: fix phy_types bitmap type
Kevin Scott			i40e-shared: Store off PHY capabilities
Shannon Nelson			i40e-shared: fix byteswap of phy_type
Jingjing Wu			i40e-shared: Fix compile issue related to const string
Greg Bowers			i40e-shared: Add AQ defines for non-willing Apps (DCB)
Greg Bowers			i40e-shared: Support for non-willing Apps (DCB)
Shannon Nelson			i40e-shared: use upper-32 bit macro for address
Shannon Nelson			i40e-shared: grab the AQ spinlocks before clearing registers
Eric Joyner			ixl: Properly strip out X722_SUPPORT (temporarily).
Eric Joyner			ixl: Allow Fort Pond devices to advertise 100M in set_advertise sysctl.

Differential Revision:  https://reviews.freebsd.org/D6211
Reviewed by:    sbruno, kmacy, jeffrey.e.pieper@intel.com
MFC after:      2 weeks
Sponsored by:   Intel Corporation
2016-05-12 18:18:55 +00:00
Scott Long
3934bc5561 Move mutex initialization from PCI probe to PCI attach. Drivers are not
allowed to create any persistent state in their probe routine because it's
not guaranteed that they'll win the election and be allowed to attach.

Submitted by:	Matthew Macy
MFC after:	3 days
2016-05-12 17:47:30 +00:00
Michael Tuexen
fd60718d17 Retire net.inet.sctp.strict_sacks and net.inet.sctp.strict_data_order
sysctl's, since they where only there to interop with non-conformant
implementations. This should not be a problem anymore.
2016-05-12 16:34:59 +00:00
Roger Pau Monné
107cfbb743 xen-netfront: fix feature detection
Current netfront code relies on xs_scanf returning a value < 0 on error,
which is not right, xs_scanf returns a positive value on error.

MFC after:	3 days
Tested by:	Stephen Jones <StephenJo@LivingComputerMuseum.org>
Sponsored by:	Citrix Systems R&D
2016-05-12 16:18:02 +00:00
Adrian Chadd
7deb99d785 [siba] add more MCS tx power offset decoding.
This is required by the bwn(4) N-PHY support.

Obtained from:	Linux ssb (definitions)
2016-05-12 16:14:16 +00:00
Martin Matuska
2ddb11afb2 MFV 299539:
Record mergeinfo in contrib/libarchive for patches accepted upstream.
2016-05-12 16:07:25 +00:00
Martin Matuska
cf8cc1c884 Update vendor/libarchive/dist to git commit f48d99b
Integrates my pull requests #701, #702 and #703
2016-05-12 16:03:55 +00:00
Adrian Chadd
98950ba039 [siba] add TX power index entry parsing.
This is required by the bwn(4) N-PHY support.

Obtained from:	Linux ssb (definitions)
2016-05-12 16:01:33 +00:00
Michael Tuexen
d88a626a1d Enable SACK Immediately per default.
This has been tested for a long time and implements covered by RFC 7053.

MFC after: 1 week
2016-05-12 15:48:08 +00:00
Andrew Turner
f82b6f5255 Rename the internal BUC_DMA_* flags to BF_* so they won't conflict with
the flags in sys/bus_dma.h.

Obtained from:	ABT Systems Ltd
Sponsored by:	The FreeBSD Foundation
2016-05-12 15:24:36 +00:00
Adrian Chadd
a0f943c116 [siba] add extra methods for chipcommon access and PLL configuration.
This is needed by the PHY-N bwn(4) support.

Obtained from:	Linux b43 (definitions)
2016-05-12 15:18:36 +00:00
Michael Tuexen
e7f232a0db Use a format string in snprintf() for consistency.
This was reported by Radek Malcic when using the userland stack in
combination with MinGW.

MFC after: 1 week
2016-05-12 14:41:53 +00:00
Andrew Turner
2b45fde379 Restrict the memory barriers in bus_dmamap_sync to just the operations
where it's needed.

Obtained from:	ABT Systems Ltd
Sponsored by:	The FreeBSD Foundation
2016-05-12 12:13:28 +00:00
Hans Petter Selasky
3a8bec33ef Fix handling of IOCTLs in the LinuxKPI.
Linux requires that all IOCTL data resides in userspace. FreeBSD
always moves the main IOCTL structure into a kernel buffer before
invoking the IOCTL handler and then copies it back into userspace,
before returning. Hide this difference in the "linux_copyin()" and
"linux_copyout()" functions by remapping userspace addresses in the
range from 0x10000 to 0x20000, to the kernel IOCTL data buffer.

It is assumed that the userspace code, data and stack segments starts
no lower than memory address 0x400000, which is also stated by "man 1
ld", which means any valid userspace pointer can be passed to regular
LinuxKPI handled IOCTLs.

Bump the FreeBSD version to force recompilation of all kernel modules.

Discussed with:	kmacy @
MFC after:	1 week
Sponsored by:	Mellanox Technologies
2016-05-12 11:38:28 +00:00
Martin Matuska
cdf63a700c MFV r299425:
Update libarchive to 3.2.0

New features:
- new bsdcat command-line utility
- LZ4 compression (in src only via external utility from ports)
- Warc format support
- 'Raw' format writer
- Zip: Support archives >4GB, entries >4GB
- Zip: Support encrypting and decrypting entries
- Zip: Support experimental streaming extension
- Identify encrypted entries in several formats
- New --clear-nochange-flags option to bsdtar tries to remove noschg and
  similar flags before deleting files
- New --ignore-zeros option to bsdtar to handle concatenated tar archives
- Use multi-threaded LZMA decompression if liblzma supports it
- Expose version info for libraries used by libarchive

Patched files (fixed compiler warnings):

contrib/libarchive/cat/bsdcat.c (vendor PR #702)
contrib/libarchive/cat/bsdcat.h (vendor PR #702)
contrib/libarchive/libarchive/archive_read_support_format_mtree.c (PR #701)
contrib/libarchive/libarchive_fe/err.c (vendor PR #703)

MFC after:	1 month
Relnotes:	yes
2016-05-12 10:16:16 +00:00
Hans Petter Selasky
15c98ff2f1 Remove redundant "task_struct_set()".
This is done by the "linux_kthread_fn()".

MFC after:	1 week
Sponsored by:	Mellanox Technologies
2016-05-12 09:11:18 +00:00
Hans Petter Selasky
464d20bcc8 Create a dummy "task_struct" on the stack which is returned by
"current" inside all LinuxKPI file operation callbacks. The "current"
is frequently used for various debug prints, printing the thread name
and thread ID for example.

Obtained from:	kmacy @
MFC after:	1 week
Sponsored by:	Mellanox Technologies
2016-05-12 09:06:54 +00:00
Don Lewis
dc77866517 Use strlcpy() instead of strncpy() when copying date and subj
to ensure that these are properly NUL terminated since they
are passed to printf().

Reported by:	Coverity
CID:		974770
MFH:		1 week
2016-05-12 08:55:57 +00:00
Don Lewis
1f12a67942 Use strlcpy() instead of strncpy() when copying the encoding value
to ensure that the destination is NUL terminated.  Length truncation
of one more character should not be an issue since encoding values
that long are not supported by libc.  The destination string is
treated as a NUL terminated string, but it is only passed to strcmp()
for comparison to a set of shorter, fixed length strings, so this
is not a serious problem.

Reported by:	Coverity
CID:		974769
MFC after:	1 week
2016-05-12 08:41:22 +00:00
Edward Tomasz Napierala
ebc2f37754 Stop hiding errors that result in failure to mount /dev. Otherwise,
missing /dev directory makes one end up with a completely deaf (init
without stdout/stderr) system with no hints on the console, unless
you've booted up with bootverbose.

MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2016-05-12 07:38:10 +00:00
Don Lewis
77b822dbc0 Use strlcpy() instead of strncpy() to copy the string returned by
setlocale() so that static analyzers know that the string is NUL
terminated.  This was causing a false positive in Coverity even
though the longest string returned by setlocale() is ENCODING_LEN
(31) and we are copying into a 64 byte buffer.  This change is also
a bit of an optimization since we don't need the strncpy() feature
of padding the rest of the destination buffer with NUL characters.

Reported by:	Coverity
CID:		974654
2016-05-12 06:39:13 +00:00
Konstantin Belousov
5525a2edd8 Typo in comment. 2016-05-12 06:20:26 +00:00
Andrew Rybchenko
2681c0e9fe sfxge(4): update multicast filter insertion algorithm
When the multicast filters we're allowed to insert are controlled by the
hypervisor, it may be that we can insert some but not others. So we need
to have fallbacks where we insert any filters we can without rolling back
when one fails to insert.

Submitted by:   Mark Spender <mspender at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D6318
2016-05-12 06:20:26 +00:00
Andrew Rybchenko
ec831f7ff9 sfxge(4): cleanup: constify common code method tables
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D6317
2016-05-12 06:19:06 +00:00
Don Lewis
eeb6394364 Check for socket creation success before calling bind().
Reported by:	Coverity
CID:		1194209
2016-05-12 05:43:54 +00:00
Conrad Meyer
a09a9cbb40 rtadvd(8): Fix use-after-close in cm_handler_client
cm_send() closes 'fd' on error.  In that case, bail out early without trying to
recv from or close 'fd' again.

Reported by:	Coverity
CID:		1006078
Sponsored by:	EMC / Isilon Storage Division
2016-05-12 05:12:24 +00:00
Conrad Meyer
5ecc225fc5 nfsd: Fix use-after-free in NFS4 lock test service
Trivial use-after-free where stp was freed too soon in the non-error path.
To fix, simply move its release to the end of the routine.

Reported by:	Coverity
CID:		1006105
Sponsored by:	EMC / Isilon Storage Division
2016-05-12 05:03:12 +00:00
Conrad Meyer
5c4eb89746 rtadvd(8): Don't use-after-free
This whole block of code as committed fully formed in r224144.  I'm not really
sure what the intent was, but it seems plausible that !persist ifis could need
other member cleanup.  Don't free the object until after we've finished
cleaning its members.

Reported by:	Coverity
CID:		1006079
Sponsored by:	EMC / Isilon Storage Division
2016-05-12 04:54:32 +00:00
Conrad Meyer
021b92e5ba dhclient: Fix some trivial buffer overruns
There was some confusion about how to limit a hardware address to at most 16
bytes.  In some cases it would overrun a byte off the end of the array.
Correct the types and rectify the overrun.

Reported by:	Coverity
CIDs:		1008682, 1305550
Sponsored by:	EMC / Isilon Storage Division
2016-05-12 04:28:22 +00:00