201767 Commits

Author SHA1 Message Date
dwmalone
241b0e18f1 MFC:
r295924: Make sure that hash-based db files fsync befor closing/syncing.
r295925: We no longer need O_SYNC pwd_mkd
r295465: We no longer need O_SYNC on services_mkdb
r295800: We no longer need O_SYNC on cap_mkdb

This should improve the performance of building db files.
2016-03-06 08:40:21 +00:00
rpokala
0ea76a354b MFC r295276: Add defines for WRITE_UNCORRECTABLE ATA command, and improve
command logging

Add #defines for ATA_WRITE_UNCORRECTABLE48 and its features. Update the
decoding in ATACAM to recognize the new values. Also improve command
decoding for a few other commands (SMART, NOP, SET_FEATURES). Bring the
decoding in ata(4) up to parity with ATACAM.

Sponsored by:	Panasas, Inc.
2016-03-06 02:33:02 +00:00
marius
74ee552c5d - Reset stable/10 back to -PRERELEASE status now that releng/10.3
has been branched.
- Update __FreeBSD_version to reflect the new -STABLE branch.

Approved by:	re (implicit)
2016-03-04 01:29:09 +00:00
jkim
86f5b30ace Re-enable SSLv2 support to restore ABI.
Excerpt from CHANGES:

    Even if "enable-ssl2" is used, users who want to negotiate SSLv2 via
    the version-flexible SSLv23_method() will need to explicitly call
    either of:

	SSL_CTX_clear_options(ctx, SSL_OP_NO_SSLv2);
    or
	SSL_clear_options(ssl, SSL_OP_NO_SSLv2);

    as appropriate.  Even if either of those is used, or the application
    explicitly uses the version-specific SSLv2_method() or its client and
    server variants, SSLv2 ciphers vulnerable to exhaustive search key
    recovery have been removed.  Specifically, the SSLv2 40-bit EXPORT
    ciphers, and SSLv2 56-bit DES are no longer available.

Approved by:	re (marius, gjb), so (delphij)
2016-03-04 00:40:15 +00:00
gnn
a80787b3cf MFC 285730
Only report the lack of ALTQ support if pfctl is using verbose (-v) mode.

PR:		194935
Submitted by:	Jim Thompson
Approved by: re (gjb)
2016-03-03 23:25:31 +00:00
kp
2667c3d5fb MFC: r296025:
pf: Fix possible out-of-bounds write

In the DIOCRSETADDRS ioctl() handler we allocate a table for struct pfr_addrs,
which is processed in pfr_set_addrs(). At the users request we also provide
feedback on the deleted addresses, by storing them after the new list
('bcopy(&ad, addr + size + i, sizeof(ad));' in pfr_set_addrs()).

This means we write outside the bounds of the buffer we've just allocated.
We need to look at pfrio_size2 instead (i.e. the size the user reserved for our
feedback). That'd allow a malicious user to specify a smaller pfrio_size2 than
pfrio_size though, in which case we'd still read outside of the allocated
buffer. Instead we allocate the largest of the two values.

Reported By:        Paul J Murphy <paul@inetstat.net>
PR:         207463
Approved by:	re (marius)
2016-03-03 07:16:35 +00:00
delphij
73af9669cd Merge OpenSSL 1.0.1s. This is a security update.
Relnotes:	yes
Approved by:	re (so@ implicit)
2016-03-02 15:43:01 +00:00
ae
3b4b162df0 MFC r295969:
Fix bug in filling and handling ipfw's O_DSCP opcode.
  Due to integer overflow CS4 token was handled as BE.

  PR:		207459
Approved by:	re (gjb)
2016-03-02 13:38:21 +00:00
bdrewery
c297413491 MFC r295995:
BDECFLAGS has not been available since r82604 removed
  /etc/defaults/make.conf.

Approved by:	re (gjb)
2016-03-02 01:24:41 +00:00
sephe
ac1ac2d42e MFC [Hyper-V]: r296028
hyperv: Wait 5 seconds for hyperv result, instead of 500ms

This addresses various devices (network, stoarge) attach failure.

Approved by:	re (gjb)
Reported by:    Hongxiong Xian <v-hoxian microsoft com>
Tested by:      Hongxiong Xian <v-hoxian microsoft com>
Sponsored by:   Microsoft OSTC
Differential Revision:  https://reviews.freebsd.org/D5435
2016-03-01 02:07:14 +00:00
jimharris
74f3aa2e27 MFC r295944:
nvme: fix intx handler to not dereference ioq during initialization

  This was a regression from r293328, which deferred allocation
  of the controller's ioq array until after interrupts are enabled
  during boot.

Approved by:	re (gjb)
Sponsored by:	Intel
2016-02-29 15:45:43 +00:00
marius
15dc3e2435 Update stable/10 to BETA3 in preparation for 10.3-BETA3 builds.
Approved by:	re (implicit)
2016-02-26 00:10:52 +00:00
marius
329e2d0e3d MFC: r295906
Fix and clean up usage of DMA and TSO segments:
- At Intel it is believed that most of their products support "only"
  40 DMA segments so lower {EM,IGB}_MAX_SCATTER accordingly. Actually,
  40 is more than plenty to handle full size TSO packets so it doesn't
  make sense to further distinguish between MAC variants that really
  can do 64 DMA segments. Moreover, capping at 40 DMA segments limits
  the stack usage of {em,igb}_xmit() that - given the rare use of more
  than these - previously hardly was justifiable, while still being
  sufficient to avoid the problems seen with em(4) and EM_MAX_SCATTER
  set to 32.
- In igb(4), pass the actually supported TSO parameters up the stack.
  Previously, the defaults set in if_attach_internal() were applied,
  i. e. a maximum of 35 TSO segments, which made supporting more than
  these in the driver pointless. However, this might explain why no
  problems were seen with IGB_MAX_SCATTER at 64.
- In em(4), take the 5 m_pullup(9) invocations performed by em_xmit()
  in the TSO case into account when reporting TSO parameters upwards.
  In the worst case, each of these calls will add another mbuf and,
  thus, the requirement for an additional DMA segment. So for best
  performance, it doesn't make sense to advertize a maximum of TSO
  segments that typically will require defragmentation in em_xmit().
  Again, this leaves enough room to handle full size TSO packets.
- Drop TSO macros from if_lem.h given that corresponding MACS don't
  support TSO in the first place.

Reviewed by:	erj, sbruno, jeffrey.e.pieper_intel.com
Approved by:	re (gjb)
2016-02-26 00:09:50 +00:00
davidcs
0d6689440d MFC r295830
Remove dead code. Code Cleanup. Improve clarity in debug messages

Approved by:re (marius)
2016-02-25 22:07:32 +00:00
davidcs
03e1ae7c4d MFC r295823
Modified the use of bxe_grc_dump() function so that it can be invoked directly
at any potential error path, where a fwdump is needed.
The fwdump (a.k.a grcdump) is stored in a driver buffer.
The sysctl grcdump_done indicates if a fwdump was taken and waiting to be retrieved.
The sysctl trigger_grcdump can be used to manually trigger a fwdump.

Approved by:re (marius)
2016-02-25 20:02:30 +00:00
davidcs
a074944516 MFC r294854
Upgrade FW to 5.4.56
Update driver version to 3.10.26

Approved by:re (marius)
2016-02-25 19:28:57 +00:00
tuexen
bc35a041dd MFC r295273:
In FreeBSD 10 and higher the driver announces SCTP checksum offloading support
also for 82598, which doesn't support it.
The legacy code has a check for it, which was missed when the code for dealing with
CSUM_IP6_* was added. Add the same check for FreeBSD 10 and higher.

Approved by:		re (marius)
Differential Revision:	D5192
2016-02-25 19:21:46 +00:00
erj
fee8ce16d0 MFC r295323:
Update em(4) to 7.6.1; update igb(4) to 2.5.3.

Major changes:

- Add i219/i219(2) hardware support. (Found on Skylake generation and newer
  chipsets.)
- Further to the last Skylake support diff, this one also includes support for
  the Lewisburg chipset (i219(3)).

- Add a workaround to an igb hardware errata.
  All 1G server products need to have IPv6 extension header parsing turned off.
  This should be listed in the specification updates for current 1G server
  products, e.g. for i350 it's errata #37 in this document:
  http://www.intel.com/content/dam/www/public/us/en/documents/specification-updates/ethernet-controller-i350-spec-update.pdf

- Avoton (i354) PHY errata workaround added

And a bunch of minor fixes, as well as #defines for things that the current
em(4)/igb(4) drivers don't implement.

MFC r287465:

igb(4): Update and fix HW errata
- HW errata workaround for IPv6 offload w/ extension headers
- Edited start of if_igb.c (Device IDs / #includes) to match ixgbe/ixl

Approved by: re (gjb)
Sponsored by: Intel Corporation
2016-02-25 19:15:06 +00:00
tuexen
42508cdc2e MFC r295549:
Loopback addresses are 127.0.0.0/8, not 127.0.0.1/32.

MFC r295668:
Improve the teardown of the SCTP stack.

MFC r295670:
Whitespace changes.

MFC r295708:
Address a warning reported by D5245 / PVS.

MFC r295709:
Code cleanup which will silence a warning in PVS / D5245.

MFC r295710:
Add protection code for issues reported by PVS / D5245.

MFC r295771:
Fix reporting of mapped addressed in getpeername() and getsockname() for
IPv6 SCTP sockets.
This bugs were found because of an issue reported by PVS / D5245.

MFC r295772:
Add some protection code.

MFC r295773:
Add protection code.

MFC r295805:
Use the SCTP level pointer, not the interface level.

MFC r295929:
Don't leak an address in an error path.

Approved by: re (marius)
2016-02-25 18:46:06 +00:00
araujo
5be4dc53c1 MFH 295796 (based on)
Fix regression introduced on 272446r. lagg(4) supports the protocol none,
where it disables any traffic without disabling the lagg(4) interface itself.

PR:		206478
Submitted by:	Erin Clark <erin.clark.ix@gmail.com>
Reviewed by:	rpokala, bapt
Approved by:	re (glebius)
Differential Revision:	https://reviews.freebsd.org/D5188
2016-02-25 15:33:55 +00:00
bdrewery
ca8ffc54be MFC r294933,r294949,r294952,r294953,r294957,r294965,r294967,r294968,r295017,
r295026,r295027,r295029,r295030,r295649:

  r294933:
    Drop any previous fd when setting a new one.
  r294949:
    filemon_ioctl: Handle error from devfs_get_cdevpriv(9).
  r294952:
    filemon_ioctl: Lock the associated filemon handle before writing to it.
  r294953:
    filemon_comment has nothing to do with wrappers so move it out of
    filemon_wrapper.c.
  r294957:
    filemon_dtr: Lock the associated filemon handle before writing to it.
  r294965:
    filemon: Use process_exit EVENTHANDLER to capture process exit.
  r294967:
    filemon: Trace fork via process_fork event.
  r294968:
    Follow-up r294967: Mark flags unused.
  r295017:
    filemon: Use process_exec EVENTHANDLER to capture sys_execve.
  r295026:
    filemon_open: Don't record a process to trace here.
  r295027:
    filemon: Track the process pointer rather than a pid.
  r295029:
    Document the purpose and non-purpose of filemon(4).
  r295030:
    Note the double fork behavior with filemon.
  r295649:
    filemon: Fix panic when fork1() is called from kproc_create().

Approved by:	re (marius)
2016-02-24 22:30:22 +00:00
jhb
266e77bc14 MFC 295636,295637:
Fix issues with tracing Linux/i386 binaries.

295636:
Sign extend the error value for failing Linux/i386 system calls.  This
restores the mapping of Linux errors to native FreeBSD errno values after
the refactoring in r288424.

295637:
Correct the ABI name for Linux/i386 binaries under FreeBSD/i386.

This allows truss to work for these binaries again after r288424.

Approved by:	re (marius)
2016-02-24 22:01:45 +00:00
kib
972671f920 MFC r295717:
After nullfs rmdir operation, reclaim the directory vnode which was
unlinked.  Otherwise the vnode stays cached, causing leak.  This is
similar to r292961 for regular files.

Approved by:	re (marius)
2016-02-24 13:48:40 +00:00
delphij
008df39fd8 MFC r295914: MFV r295913:
Partially apply upstream changeset 6e06b1c8 (kientzle).

Limit filter recursion level to 25 (instead of infinite).  This fixes a
potential crash issue discovered by Alexander Cherepanov.

PR:		207362
Reported by:	Robert Clausecker
Obtained from:	libarchive github project
Approved by:	re (marius)
2016-02-24 05:40:03 +00:00
araujo
b357db3ca6 MFH: 285685
Add support to the jail framework to be able to mount linsysfs(5) and linprocfs(5).

PR:		207179
Requested by:	thomas@gibfest.dk
Reviewed by:	jamie, bapt
Approved by:	re (gjb)
Sponsored by:	gandi.net
Differential Revision:	https://reviews.freebsd.org/D5390
2016-02-24 02:34:11 +00:00
sephe
63b2f3db69 MFC [Hyper-V]: r294553, r294700
r294553

hyperv/vmbus: Lookup channel through id table

Vmbus event handler will need to find the channel by its relative
id, when software interrupt for event happens.  The original lookup
searches the channel list, which is not very efficient.  We now
create a table indexed by the channel relative id to speed up
the channel lookup.

Submitted by:           Hongjiang Zhang <honzhan microsoft com>
Reviewed by:            delphij, adrain, sephe, Dexuan Cui <decui microsoft com>
Approved by:            adrian (mentor)
Sponsored by:           Microsoft OSTC
Differential Revision:  https://reviews.freebsd.org/D4802

-------------

r294700

hyperv/hn: Partly rework transmission path

- Avoid unnecessary malloc/free on transmission path.
- busdma(9)-fy transmission path.
- Properly handle IFF_DRV_OACTIVE.  This should fix the network
  stalls reported by many.
- Properly setup TSO parameters.
- Properly handle bpf(4) tapping.  This 5 times the performance
  during TCP sending test, when there is one bpf(4) attached.
- Allow size of chimney sending be tuned on a running system.
  Default value still needs more test to determine.

Reviewed by:            adrian, delphij
Approved by:            adrian (mentor)
Sponsored by:           Microsoft OSTC
Differential Revision:  https://reviews.freebsd.org/D4972

Approved by:	re (marius)
Sponsored by:	Microsoft OSTC
2016-02-24 01:30:50 +00:00
marius
257e82612c In preparation for 10.3-RELEASE, temporarily revert the MFC of r291244
done as part of r292895 on stable/10 as that change causes hangs with
ZFS and the cause on at least amd64 so far not understood.
Discussed with:	kib
For further information see:
https://lists.freebsd.org/pipermail/freebsd-stable/2016-February/084045.html

PR:		207281
Approved by:	re (gjb)
2016-02-23 01:09:35 +00:00
bdrewery
64f5438a36 MFC r295665:
Remove temporary hack from r294370 for SSH upgrades.

Approved by:	re (marius)
2016-02-23 00:45:27 +00:00
markj
59f8276e61 MFC r295737:
Use the _SAFE loop variant.

PR:		207146
Approved by:	re (gjb, glebius)
2016-02-22 20:20:10 +00:00
markj
8c646bef99 MFC r295574:
Clear the cookie pointer on error in tmpfs_readdir().

Approved by:	re (glebius)
2016-02-22 20:18:10 +00:00
gnn
b899cad3fa Revert 295285 which was an MFC of the tryforward work (r290383,295282,295283)
In the IPFW+NAT+divergent MTU case there is a bug in sening ICMP MTU updates.

Approved by:	re (marius, gjb)
Sponsored by:	Rubicon Communications (Netgate)
2016-02-22 19:17:59 +00:00
garga
dbe57635db MFC r286641 (from oshogbo):
Use correct src/dst ports when removing states.

Submitted by:	Milosz Kaniewski <m.kaniewski@wheelsystems.com>,
		UMEZAWA Takeshi <umezawa@iij.ad.jp> (orginal)
Reviewed by:	glebius
Approved by:	re (marius)
Obtained from:	OpenBSD
Sponsored by:	Rubicon Communications (Netgate)
Differential revision:	https://reviews.freebsd.org/D5392
2016-02-22 17:18:36 +00:00
marius
4112d41bd6 MFC: r287299 [1]
Add a gop command to help diagnose VT efifb problems. The gop
command has the following sub-commands:
  list		- list all possible modes (paged)
  get		- return the current mode
  set <mode>	- set the current mode to <mode>

MFC: r287317, r287422, r287475, r287489, r287538 [2]

Add support for the UGA draw protocol. This includes adding a
command called 'uga' to show whether UGA is implemented by the
firmware and what the settings are. It also includes filling
the efi_fb structure from the UGA information when GOP isn't
implemented by the firmware.

PR:		207313 [1], 202730 [2]
Approved by:	re (gjb)
2016-02-22 00:49:35 +00:00
marius
5f93fbd79c MFC: r264565
Do not set M_BESTFIT if a strategy has already been provided.  This
fixes problems when using M_FIRSTFIT.

MFC: r280805

Add four new DDB commands to display vmem(9) statistics.

In particular, such DDB commands were added:
        show vmem <addr>
        show all vmem
        show vmemdump <addr>
        show all vmemdump

As possible usage, that allows to see KVA usage and fragmentation.

Approved by:	re (gjb)
2016-02-21 22:34:09 +00:00
des
26478850ec MFH (r294326): fall back to standard / configured CA store
PR:		193871
Approved by:	re (gjb)
2016-02-20 22:58:33 +00:00
smh
6c628d447c MFC r272785:
Null terminate boot config buffer

PR:		207070
Approved by:	re (gjb)
Sponsored by:	Multiplay
2016-02-20 10:56:46 +00:00
ken
89c964ed8e MFC, r295417:
r295417 | ken | 2016-02-08 15:13:08 -0700 (Mon, 08 Feb 2016) | 9 lines

  Fix the SCSI Extended INQUIRY probe case when an error is returned
  and a retry is scheduled.

  Instead of leaving the device queue frozen, unfreeze the device queue so
  that the retry can happen.

  Sponsored by:   Spectra Logic

Approved by:	re (gjb)
2016-02-19 17:14:34 +00:00
sephe
427bb5d10f MFC [Hyper-V]: r293719-r293722, r293869-r293871, r293873-r293875, r293877
r293719 hyperv/hn: Implement LRO
r293720 hyperv/hn: Implement SIOC[SG]IFMEDIA support
r293721 hyperv/hn: Avoid mbuf cluster allocation, if the packet is small.
r293722 hyperv/hn: Removed unused netvsc_init()
r293869 hyperv/hn: Unbreak LINT-NOIP
r293870 hyperv: use x86 generic code to do the hypervisor detection
r293871 hyperv: remove unused vmbus definitions
r293873 hyperv: implement an event timer
r293874 hyperv: add interrupt counters
r293875 hyperv: set receive buffer size according to NVSP protocol version
r293877 Unbreak `make depend` with sys/modules/hyperv/vmbus after r293870

Approved by:	re (glebius), adrian (mentor)
Sponsored by:	Microsoft OSTC
2016-02-19 02:03:14 +00:00
pfg
bdaba1774d MFC r295616:
ext2fs:	Remove panics for rename() race conditions.

Sync with r84642 from UFS:

The panics are inappropriate because the IN_RENAME flag only fixes a
few of the huge number of race conditions that can result in the
source path becoming invalid even prior to the VOP_RENAME() call.

Approved by:	re (glebius)
2016-02-17 19:09:06 +00:00
jimharris
efd4fe5452 MFC r295022:
nvd: add hw.nvd.delete_max tunable

  The NVMe specification does not define a maximum or optimal delete
  size, so technically max delete size is min(full size of namespace,
  2^32 - 1 LBAs).  A single delete operation for a multi-TB NVMe
  namespace though may take much longer to complete than the nvme(4)
  I/O timeout period.  So choose a sensible default here that is still
  suitably large to minimize the number of overall delete operations.

  This also fixes possible uint32_t overflow on initial TRIM operation
  for zpool create operations for NVMe namespaces with >4G LBAs.

Approved by:	re (glebius)
Sponsored by:	Intel
2016-02-17 15:38:05 +00:00
jimharris
b9d4be0c4e MFC r295532:
nvme: avoid duplicate SET_NUM_QUEUES commands

  nvme(4) issues a SET_NUM_QUEUES command during device
  initialization to ensure enough I/O queues exists for each
  of the MSI-X vectors we have allocated.  The SET_NUM_QUEUES
  command is then issued again during nvme_ctrlr_start(), to
  ensure that is properly set after any controller reset.

  At least one NVMe drive exists which fails this second
  SET_NUM_QUEUES command during device initialization.  So
  change nvme_ctrlr_start() to only issue its SET_NUM_QUEUES
  command when it is coming out of a reset - avoiding the
  duplicate SET_NUM_QUEUES during device initialization.

Approved by:	re (glebius)
Sponsored by:	Intel
2016-02-17 15:36:02 +00:00
des
4aef301951 MFH (r295536): fix double-free error when SSL connection fails
PR:		206774
Submitted by:	Christian Heckendorf <heckendorfc@gmail.com>
Approved by:	re (glebius)
2016-02-17 11:40:03 +00:00
des
b5c4e6d861 MFH (r295535): use insecure-lan-zones option instead of hardcoded list
Approved by:	re (glebius)
Relnotes:	yes
2016-02-17 11:38:43 +00:00
des
259061d27e MFH (r295533): remove broken unbound-control-setup script
Approved by:	re (glebius)
Relnotes:	yes
2016-02-17 11:36:45 +00:00
bapt
86fa46c15a MFC r295455
Fix make universe when running with non POSIX/C locales using a locale sensitive
pattern

Approved by:	re@ (gjb, marius)
2016-02-16 22:37:24 +00:00
jhb
221a97fa10 MFC 295418,295419:
Fix hangs or panics when misbehaved kernel threads return from their
main function.

295418:
Mark proc0 as a kernel process via the P_KTHREAD flag.

All other kernel processes have this flag set and all threads in proc0
(including thread0) have the similar TDP_KTHREAD flag set.

295419:
Call kthread_exit() rather than kproc_exit() for a premature kthread exit.

Kernel threads (and processes) are supposed to call kthread_exit() (or
kproc_exit()) to terminate.  However, the kernel includes a fallback in
fork_exit() to force a kthread exit if a kernel thread's "main" routine
returns.  This fallback was added back when the kernel only had processes
and was not updated to call kthread_exit() instead of kproc_exit() when
threads were added to the kernel.

This mistake was particularly exciting when the errant thread belonged to
proc0.  Due to the missing P_KTHREAD flag the fallback did not kick in
and instead tried to return to userland via whatever garbage was in the
trapframe.  With P_KTHREAD set it tried to terminate proc0 resulting in
other amusements.

PR:		204999
Approved by:	re (glebius)
2016-02-16 21:36:48 +00:00
emaste
faf4c803e3 MFC r295497: Update uefi.8 for ZFS and multi device boot support
Approved by:	re (gjb)
2016-02-16 03:50:56 +00:00
dumbbell
744ea196e5 drm/i915: Restore pci_enable_busmaster() call in the init path
This fixes a GPU hang on i945GM.

While here, merge some minor fixes to DRM core and i915:
  * Remove obsolete drm_agp_*_memory() prototypes
  * Fix comment in drm_fops.c (outisde -> outside)
  * Fix some formatting issues in drm_stub.c (spaces -> tabs)

Approved by:	re (marius)
MFC of:		r288653, r288952, r293851
Submitted by:	<s3erios@gmail.com>
Differential Revision:	https://reviews.freebsd.org/D3413
2016-02-15 07:35:40 +00:00
cy
2cbc922afe MFC r295495 - Update leapsecond file in non-chroot environments.
PR:		207095
Submitted by:	madpilot
Approved by:	re (marius)
2016-02-14 23:04:52 +00:00
emaste
f04c791a3a MFC r295496: Document boot1.efi's handling of /boot.config
Approved by:	re (marius)
2016-02-14 22:31:38 +00:00