102488 Commits

Author SHA1 Message Date
kevlo
84e0e9dfe4 MFC r285623:
Fix typo in register definition.

Submitted by:	James Hung
Reviewed by:	sbruno
2015-07-31 03:35:27 +00:00
gjb
d83a2c49a3 MFC r285999 (kp):
pf: Always initialise pf_fragment.fr_flags

  When we allocate the struct pf_fragment in pf_fillup_fragment() we
  forgot to initialise the fr_flags field. As a result we sometimes
  mistakenly thought the fragment to not be a buffered fragment.
  This resulted in panics because we'd end up freeing the pf_fragment
  but not removing it from V_pf_fragqueue (believing it to be part of
  V_pf_cachequeue).  The next time we iterated V_pf_fragqueue we'd use
  a freed object and panic.

  While here also fix a pf_fragment use after free in pf_normalize_ip().
  pf_reassemble() frees the pf_fragment, so we can't use it any more.

X-MFS-To:	releng/10.2
Sponsored by:	The FreeBSD Foundation
2015-07-30 16:06:13 +00:00
marius
c3199153b4 MFC: r285843
- Since r253161, uart_intr() abuses FILTER_SCHEDULE_THREAD for signaling
  uart_bus_attach() during its test that 20 iterations weren't sufficient
  for clearing all pending interrupts, assuming this means that hardware
  is broken and doesn't deassert interrupts. However, under pressure, 20
  iterations also can be insufficient for clearing all pending interrupts,
  leading to a panic as intr_event_handle() tries to schedule an interrupt
  handler not registered. Solve this by introducing a flag that is set in
  test mode and otherwise restores pre-r253161 behavior of uart_intr(). The
  approach of additionally registering uart_intr() as handler as suggested
  in PR 194979 is not taken as that in turn would abuse special pccard and
  pccbb handling code of intr_event_handle(). [1]
- Const'ify uart_driver_name.
- Fix some minor style bugs.

PR:		194979 [1]
Reviewed by:	marcel (earlier version)
2015-07-30 02:23:09 +00:00
marius
27f38bb436 MFC: r285839
o Revert the other functional half of r239864, i. e. the merge of r134227
  from x86 to use smp_ipi_mtx spin lock not only for smp_rendezvous_cpus()
  but also for the MD cache invalidation, TLB demapping and remote register
  reading IPIs due to the following reasons:
  - The cross-IPI SMP deadlock x86 otherwise is subject to can't happen on
    sparc64. That's because on sparc64, spin locks don't disable interrupts
    completely but only raise the processor interrupt level to PIL_TICK. This
    means that IPIs still get delivered and direct dispatch IPIs such as the
    cache invalidation etc. IPIs in question are still executed.
  - In smp_rendezvous_cpus(), smp_ipi_mtx is held not only while sending an
    IPI_RENDEZVOUS, but until all CPUs have processed smp_rendezvous_action().
    Consequently, smp_ipi_mtx may be locked for an extended amount of time as
    queued IPIs (as opposed to the direct ones) such as IPI_RENDEZVOUS are
    scheduled via a soft interrupt. Moreover, given that this soft interrupt
    is only delivered at PIL_RENDEZVOUS, processing of smp_rendezvous_action()
    on a target may be interrupted by f. e. a tick interrupt at PIL_TICK, in
    turn leading to the target in question trying to send an IPI by itself
    while IPI_RENDEZVOUS isn't fully handled, yet, and, thus, resulting in a
    deadlock.
o As mentioned in the commit message of r245850, on least some sun4u platforms
  concurrent sending of IPIs by different CPUs is fatal. Therefore, hold the
  reintroduced MD ipi_mtx also while delivering cross-traps via MI helpers,
  i. e. ipi_{all_but_self,cpu,selected}().
o Akin to x86, let the last CPU to process cpu_mp_bootstrap() set smp_started
  instead of the BSP in cpu_mp_unleash(). This ensures that all APs actually
  are started, when smp_started is no longer 0.
o In all MD and MI IPI helpers, check for smp_started == 1 rather than for
  smp_cpus > 1 or nothing at all. This avoids races during boot causing IPIs
  trying to be delivered to APs that in fact aren't up and running, yet.
  While at it, move setting of the cpu_ipi_{selected,single}() pointers to
  the appropriate delivery functions from mp_init() to cpu_mp_start() where
  it's better suited and allows to get rid of the global isjbus variable.
o Given that now concurrent IPI delivery no longer is possible, also nuke
  the delays before completely disabling interrupts again in the CPU-specific
  cross-trap delivery functions, previously giving other CPUs a window for
  sending IPIs on their part. Actually, we now should be able to entirely get
  rid of completely disabling interrupts in these functions. Such a change
  needs more testing, though.
o In {s,}tick_get_timecount_mp(), make the {s,}tick variable static. While not
  necessary for correctness, this avoids page faults when accessing the stack
  of a foreign CPU as {s,}tick now is locked into the TLBs as part of static
  kernel data. Hence, {s,}tick_get_timecount_mp() always execute as fast as
  possible, avoiding jitter.

PR:		201245
2015-07-30 02:06:29 +00:00
marius
eecea0503f MFC: r284447, r284552
Merge from NetBSD:
o rev. 1.10: Nuke trailing whitespace.
o rev. 1.15: Fix typo in comment.
o rev. 1.16: Add the following registers from IEEE 802.3-2009 Clause 22:
 - PSE control register (0x0b)
 - PSE status register (0x0c)
 - MMD access control register (0x0d)
 - MMD access address data register (0x0e)
o rev. 1.17 (comments only): The bit location of link ability is different
  between 1000Base-X and others (see Annex 28B.2 and 28D).
o rev. 1.18: Nuke dupe word.

Obtained from:	NetBSD
Sponsored by:	genua mbh
2015-07-30 00:28:27 +00:00
marius
528b5a9fee MFC: r281752
Make a comment reflect reality.
2015-07-30 00:24:21 +00:00
eri
3082d2efe1 MFC 285325
Correct issue presented in r285051 by properly initializing variable.

Differential Revision:	 https://reviews.freebsd.org/D3036
2015-07-29 17:50:14 +00:00
eri
b2cc8257fa MFC r285051
Avoid doing multiple route lookups for the same destination IP during forwarding.

Differential Revision:	https://reviews.freebsd.org/D2964
2015-07-29 17:46:16 +00:00
glebius
cbda56cb99 Merge r285944: fix typo: delete nsn if we were the last reference. 2015-07-29 11:12:56 +00:00
delphij
d3ecbb9019 Fix patch(1) shell injection vulnerability. [SA-15:14]
Fix resource exhaustion in TCP reassembly. [SA-15:15]

Fix OpenSSH multiple vulnerabilities. [SA-15:16]
2015-07-28 19:58:44 +00:00
cem
87ad559404 MFC r285483: pipe_direct_write: Fix mismatched pipelock/unlock
If a signal is caught in pipelock, causing it to fail, pipe_direct_write
should not try to pipeunlock.

Approved by:	markj (mentor)
Sponsored by:	EMC / Isilon Storage Division
2015-07-28 18:37:23 +00:00
kib
07af41892f MFC r284956:
Do not calculate the stack's bottom address twice.
2015-07-28 17:12:41 +00:00
kib
3205c5b7b0 MFC r285039:
Remove asserts which might reference freed memory.
2015-07-28 17:08:32 +00:00
kib
8a59bb0b0a MFC r285134 (by mjg):
fd: de-k&r-ify functions + some whitespace fixes

MFC r285269:
Handle copyout for the fcntl(F_OGETLK) using oflock structure.
2015-07-28 16:39:36 +00:00
emaste
c18b3c3a79 MFC r285246: Avoid creating invalid UEFI device path
The UEFI loader on the 10.1 release install disk (disc1) modifies an
existing EFI_DEVICE_PATH_PROTOCOL instance in an apparent attempt to
truncate the device path.  In doing so it creates an invalid device
path.

Perform the equivalent action without modification of structures
allocated by firmware.

PR:		197641
Submitted by:	Chris Ruffin <chris.ruffin at intel.com>
2015-07-28 12:45:08 +00:00
glebius
70de52445f Merge r283106:
During module unload unlock rules before destroying UMA zones, which
  may sleep in uma_drain(). It is safe to unlock here, since we are already
  dehooked from pfil(9) and all pf threads had quit.
2015-07-28 09:21:19 +00:00
dim
859189d7ec MFC r285340:
Fix swapped copyin(9) arguments in cxgb's iwch_arm_cq() function.
Detected by clang 3.7.0 with the warning:

sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_provider.c:309:18: error: variable
'rptr' is uninitialized when used here [-Werror,-Wuninitialized]
		chp->cq.rptr = rptr;
			       ^~~~
2015-07-28 09:19:04 +00:00
glebius
c3133372cb Merge r283061, r283063: don't dereference NULL is pf_get_mtag() fails.
PR:		200222
2015-07-28 09:16:54 +00:00
glebius
2a5be58b24 Merge 280169: always lock the hash row of a source node when updating
its 'states' counter.

PR:		182401
2015-07-28 09:13:55 +00:00
glebius
93ef51db74 Merge r271458:
- Provide a sleepable lock to protect against ioctl() vs ioctl() races.
  - Use the new lock to protect against simultaneous DIOCSTART and/or
    DIOCSTOP ioctls.
2015-07-28 09:09:01 +00:00
whu
c78f4c18f7 MFC r285785 Do not enable UDP checksum offloading when running on the
Hyper-V on Windows Server 2012 and earlier hosts.

Submitted by: whu
Reviewed by: royger
Approved by: royger
Relnotes: No
Sponsored by: Microsoft OSTC
Differential Revision:  https://reviews.freebsd.org/D3217
2015-07-28 05:46:37 +00:00
jimharris
bc6d158afc MFC r285816:
nvme: ensure csts.rdy bit is cleared before returning from nvme_ctrlr_disable

Sponsored by:	Intel
2015-07-27 15:37:02 +00:00
jimharris
6f14ca5382 MFC r285815:
nvme: properly handle case where pci_alloc_msix does not alloc all vectors

Sponsored by:	Intel
2015-07-27 15:35:36 +00:00
jimharris
6e669fcd5f MFC r285767:
nvd: set d_delmaxsize to full capacity of NVMe namespace

  The NVMe specification has no ability to specify a maximum delete size
  that is less than the full capacity of the namespace - so just using the
  namespace size is the correct value here.

  This fixes reported issues where ZFS trim on init looked like it was
  hanging the system - previously the default I/O max size (128KB on
  Intel NVMe controllers) was used for delete operations which worked out
  to only about 8MB/s.  With this patch I can add an 800GB DC P3700
  drive to a ZFS pool in about 15-20 seconds.

Sponsored by:	Intel
2015-07-27 15:32:37 +00:00
rmacklem
9c93ec1f0b MFC: r285066
Alex Burlyga reported a POLA violation for the new NFS client as
compared to the old NFS client via email to the freebsd-fs@ mailing list.
For the new client, when multiple clients attempted to create a symbolic
link concurrently, more that one client would report success instead of
EEXIST. This was caused by code in the new client that mapped EEXIST to
OK assuming it was caused by a retried RPC request.
Since the old client did not do this, the patch defaults to the old
behaviour and permits the new behaviour to be enabled via a sysctl.
2015-07-27 00:28:51 +00:00
jhb
dc79e09c5b Partially revert r284034. In particular, revert the final change in this
MFC (281874).  It broke suspend and resume on several Thinkpads (though not
all) in 10 even though it works fine on the same laptops in HEAD.

PR:		201239
Reported by:	Kevin Oberman and several others
2015-07-25 00:14:02 +00:00
gjb
27addd8a72 - Reset stable/10 back to -PRERELEASE status now that releng/10.2
has been branched.
- Update __FreeBSD_version to reflect the new -STABLE branch.

Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2015-07-23 23:35:20 +00:00
hrs
b037e0b55c MFC r282805:
- Remove ND6_IFF_IGNORELOOP.  This functionality was useless in practice
  because a link where looped back NS messages are permanently observed
  does not work with either NDP or ARP for IPv4.

- draft-ietf-6man-enhanced-dad is now RFC 7527.

Approved by:	re (gjb)
2015-07-23 19:58:56 +00:00
hrs
123cf5c769 MFC r279538:
Fix group membership of cloned interfaces when one is moved by
if_vmove().

In if_vmove(), if_detach_internal() and if_attach_internal() were
called in series to detach and reattach the interface.  When
detaching, if_delgroup() was called and the interface leaves all of
the group membership.  And then upon attachment, if_addgroup(ifp,
IFG_ALL) was called and it joined only "all" group again.

This had a problem. Normally, a cloned interface automatically joins
a group whose name is ifc_name of the cloner in addition to "all"
upon creation.  However, if_vmove() removed the membership and did
not restore upon attachment.

Approved by:	re (gjb)
2015-07-23 19:57:47 +00:00
hrs
1bf10917ef MFC r273992:
Fix a bug which prevented ND6_IFF_IFDISABLED flag from clearing when
the newly-added IPv6 address was /128.

Approved by:	re (gjb)
2015-07-23 19:54:42 +00:00
arybchik
d5e30036e4 MFC r285798
sfxge: added fallbacks for pre 4.2.1 firmware support

Driver must be able to start against older firmware that is missing
recently added MCDI calls, otherwise firmware upgrade will not be
possible.

Submitted by:   Richard Houldsworth <rhouldsworth at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Approved by:    re (gjb)
2015-07-23 15:08:21 +00:00
brueffer
d85d061a9a MFC: r285628
Actually recognize all Intel Lynx Point devices we have device IDs for.

PR:		195851
Submitted by:	ftigeot@wolfpond.org
Approved by:	re (gjb)
2015-07-23 13:22:13 +00:00
scottl
ab97a72940 Merge driver for PMC Sierra's range of SAS/SATA HBAs.
Submitted by:   Achim Leubner <Achim.Leubner@pmcs.com>
Approved by: re
2015-07-23 05:26:09 +00:00
hiren
141df3ac09 MFC r284941:
Avoid a situation where we do not set persist timer after a zero window
condition.
If you send a 0-length packet, but there is data is the socket buffer, and
neither the rexmt or persist timer is already set, then activate the persist
timer.

PR:		192599
Approved by:	re (delphij)
2015-07-22 15:05:45 +00:00
delphij
457165363e Fix resource exhaustion due to sessions stuck in LAST_ACK state.
Security:	CVE-2015-5358
Security:	SA-15:13.tcp
Submitted by:	Jonathan Looney (Juniper SIRT)
Approved by:	re (so blanket)
2015-07-21 23:42:17 +00:00
hiren
e21e1ce198 Partial MFC of r285528 as full RSS support is not available in FreeBSD 10.
Expose full 32bit RSS hash from card regardless of whether RSS is defined or
not. When doing multiqueue, we are all setup to have full 32bit RSS hash from
the card. We do not need to hide that under "ifdef RSS" and should expose that
by default so others like lagg(4) can use that and avoid hashing the traffic by
themselves.

Approved by:	    re (gjb)
Sponsored by:	    Limelight Networks
2015-07-21 19:41:39 +00:00
pkelsey
04fd70b7f2 MFC r285567:
Check TCP timestamp option flag so that the automatic receive buffer
scaling code does not use an uninitialized timestamp echo reply value
from the stack when timestamps are not enabled.

Approved by: re (gjb)
2015-07-21 18:38:31 +00:00
markj
84c91edd53 MFC r285663, r285664, r285667:
Ensure that locstat_nsecs() has no effect when lockstat probes are not
enabled or when the profiled lock carries the LO_NOPROFILE flag.

PR:		201642, 201517
Approved by:	re (gjb)
Tested by:	Jason Unovitch
2015-07-21 17:16:37 +00:00
allanjude
10c80a84da MFC: r285594
New partition flag for gpart, writes the 0xee partition in the pmbr in the second slot, rather than the first.
	Works around Lenovo legacy GPT boot issue

PR:		184910
Approved by:	re (gjb), marcel
Relnotes:	yes
Sponsored by:	ScaleEngine Inc.
Differential Revision:	https://reviews.freebsd.org/D3140
2015-07-21 15:50:14 +00:00
kib
90d01ac9ea Revert r284178 and r284256.
Approved by:	re (gjb)
2015-07-21 15:06:22 +00:00
royger
0dafb147a9 MFC: r284296
xen-blk{front/back}: remove broken FreeBSD extensions

Approved by: re (gjb)
2015-07-21 07:22:18 +00:00
royger
1266acc975 MFC: r285089
netfront: preserve configuration across migrations

Approved by: re (gjb)
2015-07-21 07:20:02 +00:00
hiren
2fc2987135 Fix a typo in r285668. Replace hw.ixgbe.* with correct hw.ix.* for a couple of
sysctls.

Approved by:	re (gjb)
Sponsored by:	Limelight Networks
2015-07-21 00:31:13 +00:00
allanjude
e644fa27a1 MFC: r277949:
New function smbios_match to detect BIOS versions during boot

MFC: r277957:
	Fix order of functions in smbios.c (corrects r277949)

MFC: r281138:
	SMBIOS support for EFI

r281138 makes changes to the new unified EFI loader (r280950), which has not been merged to stable/10 (and likely won't be).
These changes were manually applied to the amd64 EFI loader (sys/boot/amd64/efi).
The changes to sys/boot/amd64/efi are a direct commit.

Reviewed by:	stas
Approved by:	re (gjb), marcel
Sponsored by:	ScaleEngine Inc.
Differential Revision:	https://reviews.freebsd.org/D3129
2015-07-20 22:14:55 +00:00
jpaetzel
91cc8a35f0 MFC 278040:
Prevent inlining txg_quiesce

This allows dtrace to monitor the calls to txg_quiesce which can be
really helpful.

Also standardize __noinline order for arc_kmem_reap_now.

Sponsored by:	Multiplay

Approved by:	re
2015-07-20 14:38:40 +00:00
hiren
a22599dcad Loader tunable fetching has been broken on stable/10 since ix(4) rewrite
introduced by r280182. FreeBSD-head doesn't need TUNABLE_INT() now with
SYSCTL_INT() but stable/10 still does.
Note: This is a direct commit to stable/10.

PR:		201644
Reviewed by:	erj
Approved by:	re (gjb)
Sponsored by:	Limelight Networks
2015-07-18 04:49:36 +00:00
gjb
752b1ca18b Update stable/10 to BETA2 in preparation for 10.2-BETA2 builds.
Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2015-07-17 00:00:04 +00:00
kib
dfb797a5f0 MFC r284207 (by alc):
Correct a type error in kmem_unback().

Requested by:	alc
Approved by:	re (gjb)
2015-07-16 15:13:17 +00:00
kib
83cf60b07d MFC r276439 (by alc):
Make the creation of the free lists dynamic, i.e., it is based on the
available physical memory at boot time. For amd64 systems with 64 GB
or more of physical memory, create free lists for managing pages with
physical addresses below 4 GB.

PR:	185727
Requested by:	alc
Approved by:	re (gjb)
2015-07-16 14:41:58 +00:00
ae
1392531c0f MFC r285204:
Fill the port and protocol information in the SADB_ACQUIRE message
  in case when security policy has it as required by RFC 2367.

  PR:		192774

Approved by:	re (delphij)
2015-07-15 21:09:38 +00:00