Commit Graph

196045 Commits

Author SHA1 Message Date
Glen Barber
e9e052e809 MFC r325373, r325861:
r325373 (manu):
  release/arm: Do not install ubldr

 r325861 (manu):
  release: Update u-boot and firmware file for RPI-B target.

Sponsored by:	The FreeBSD Foundation
2017-11-20 19:05:53 +00:00
Glen Barber
348be50e14 MFC r325950, r325953:
r325950:
  Sort variables for consistency.

 r325953:
  Add general configuration files used by release/release.sh for
  big-iron installation images.

Sponsored by:	The FreeBSD Foundation
2017-11-20 15:57:56 +00:00
Glen Barber
36149ef35f MFC r325863:
Only copy /etc/resolv.conf to ${CHROOTDIR} if /etc/resolv.conf does
 not already exist within ${CHROOTDIR}.  This allows re-using a build
 chroot with CHROOTBUILD_SKIP set to a non-empty value and CHROOTDIR
 set to '/' in release.conf.

Sponsored by:	The FreeBSD Foundation
2017-11-20 15:46:23 +00:00
Eugene Grosbein
ff942643fd MFC r325436: RTF_PINNED for an interface
Allow a process to assign an IP address to local ppp interface
  even if kernel routing table already has a route to the address in question
  installed by some routing daemon (PR 223129).

  Also, allow loopback route deletion when stopping a VIMAGE jail (PR 222647).

PR:			222647, 223129
Reviewed by:		gnn
Approved by:		mav (mentor)
Differential Revision:	https://reviews.freebsd.org/D12747
2017-11-20 09:24:01 +00:00
Xin LI
997502dcc7 MFC r325383:
Avoid calling get_controller_count() until attaching, this would avoid
costly PCI config space operations that slows down systems without the
hardware.

Many thanks to HighPoint for continued support of FreeBSD!

Submitted by:	Steve Chang
Reported by:	cperciva
2017-11-20 06:49:05 +00:00
Hans Petter Selasky
79f649ed9a MFC r325616:
Make sure sin_zero is zero in ibcore. Else socket address maching using
bcmp() might fail.

Sponsored by:	Mellanox Technologies
2017-11-17 15:49:01 +00:00
Hans Petter Selasky
a2e98b7670 MFC r325615:
Make sure the IPv6 scope ID gets zeroed when exchanging CMA messages in ibcore.
Else the IPv6 address matching might fail. This change adds support for both
embedded and non-embedded IPv6 scope IDs when passing a IPv6 link-local socket
address to RDMA. Prior to this change only global IPv6 addresses would work
with RDMA.

Sponsored by:	Mellanox Technologies
2017-11-17 15:46:45 +00:00
Hans Petter Selasky
afc2f77bf0 MFC r325614:
Multiple fixes for using IPv6 link-local addresses with RDMA.

1) Fail to resolve RDMA address if rtalloc1() returns the loopback
device, lo0, as the gateway interface.

2) Use ip_dev_find() and ip6_dev_find() to lookup network interfaces
with matching IPv4 and IPv6 addresses, respectivly.

3) In addr_resolve() make sure the "ifa" pointer is always set, also when
the "ifp" is NULL. Else a NULL pointer access might happen trying to
read from the "ifa" pointer later on.

Sponsored by:	Mellanox Technologies
2017-11-17 15:43:29 +00:00
Hans Petter Selasky
947ae25870 MFC r325533:
Make the dma_alloc_coherent() function in the LinuxKPI NULL safe with regard
to the "dev" argument.

Submitted by:	Krishnamraju Eraparaju @ Chelsio
Sponsored by:	Chelsio Communications
2017-11-17 15:30:36 +00:00
Andriy Gapon
cc98e8acdc MFC r325610: MFV r325609: 7531 Assign correct flags to prefetched buffers 2017-11-17 10:13:24 +00:00
Andriy Gapon
cd8afce397 MFC r325035: MFV r325013,r325034: 640 number_to_scaled_string is duplicated in several commands
FreeBSD note: of all libcmdutils functionality ZFS (and other illumos
contrib code) currently uses only nicenum() function (which is similar
to humanize_number but has some formatting differences).  For this
reason I decided to not port the whole library.  As a result, nicenum.c
from libcmdutils is compiled into libzfs and libzpool.  This is a bit
ugly, but works.  If one day we are forced to create libillumos, then
the file should be moved to that library.
2017-11-16 23:36:19 +00:00
Andriy Gapon
05d79860aa MFC r325228: vdev_geom_close: close errored consumer even if vdev_reopening is set 2017-11-16 23:02:04 +00:00
Andriy Gapon
d34ccdd9fa MFC r325606: MFV r325605: 8713 Buffer overflow in dsl_dataset_name() 2017-11-16 22:47:41 +00:00
Andriy Gapon
42bcaf4597 MFC r325227,r325272: geom_slice: do not destroy softc until providers are gone
Note: there was a merge conflict, likely because of a missing MFC of an
earlier change.
2017-11-16 22:37:03 +00:00
John Baldwin
0c9545b04c MFC 325039: Rework pass through changes in r305485 to be safer.
Specifically, devices that do not support PCI-e FLR and were not
gracefully shutdown by the guest OS could continue to issue DMA
requests after the VM was terminated.  The changes in r305485 meant
that those DMA requests were completed against the host's memory which
could result in random memory corruption.  Instead, leave ppt devices
that are not attached to a VM disabled in the IOMMU and only restore
the devices to the host domain if the ppt(4) driver is detached from a
device.

As an added safety belt, disable busmastering for a pass-through device
when before adding it to the host domain during ppt(4) detach.

PR:		222937
2017-11-16 18:22:03 +00:00
Glen Barber
f561a44183 MFC r320252, r320686, r325769:
r320252:
  In release/release.sh:
  - Rename chroot_arm_armv6_build_release() to chroot_arm_build_release()
    and make it hardware agnostic (such as armv6 -vs- armv7 -vs- arm64).
  - Evaluate EMBEDDED_TARGET differently so release/tools/arm.subr can
    be used for arm/armv6 and arm64/aarch64.
  - Update comments and copyright.

  In release/tools/arm.subr:
  - In arm_create_disk(), change the default alignment from 63 to 512k,
    fixing a boot issue on arm64 and EFI. [1]
  - Update comments and copyright.

 r320686:
  Fix the ftp-stage target by loosening the constraints on the TARGET
  and TARGET_ARCH variables.

 r325769:
  Update the GUMSTIX image build to use arm/arm TARGET/TARGET_ARCH.
  Update the TARGET/TARGET_ARCH matching in release/release.sh and
  release/Makefile.mirrors for simplification.

Note: The RPI3.conf addition from r320252 is not included, as it is
not supported on 10-STABLE.  Additionally, arm64/aarch64 changes are
also excluded from this commit.

Sponsored by:	The FreeBSD Foundation
2017-11-16 16:00:01 +00:00
Gordon Tetlow
92d61a5a38 MFC r325865
Properly bzero kldstat structure to prevent kernel information leak.

Security:	FreeBSD-SA-17:10.kldstat
Security:	CVE-2017-1088
2017-11-15 22:35:16 +00:00
Baptiste Daroussin
5787fd2f35 MFC r325737:
Update to 2017.10.21
2017-11-15 12:23:01 +00:00
Baptiste Daroussin
2ce7898d74 MFC r325717:
Remove __unused attributed on arguments that are actually used
2017-11-15 12:21:06 +00:00
Baptiste Daroussin
6dae661b8e MFC r325716:
Fix some nroff style issue
2017-11-15 12:19:11 +00:00
Eugene Grosbein
fdaa28afdc Fix breakage in r325799 that removed a bit of code by my mistake.
Approved by:		avg (mentor)
2017-11-14 11:02:46 +00:00
Dag-Erling Smørgrav
32c93197e0 MFH (r325010): don't bother verifying a password that we know is too long.
Reported by:	jkim@
Security:	CVE-2016-6210
2017-11-14 10:49:07 +00:00
Eugene Grosbein
7eaf90d364 MFC r325559: ifconfig_<interface>_descr
Add suitable knob ifconfig_<interface>_descr for static interface description.
Document availability of interface descriptions within rc.conf(5).

Approved by:	avg (mentor)
2017-11-14 09:31:56 +00:00
Jamie Gritton
a6bbfc588c MFC r297935:
Separate POSIX sem/shm objects in jails, by prepending the jail's path
  name to the object's "path".  While the objects don't have real path
  names, it's a filesystem-like namespace, which allows jails to be
  kept to their own space, but still allows the system / jail parent to
  access a jail's IPC.

MFC r297936:

  Separate POSIX mqueue objects in jails; actually, separate them by the
  jail's root, so jails that don't have their own filesystem directory
  also won't have their own mqueue namespace.

MFC r297976:

  Clean up some style(9) violations.

MFC r298567:

   Use the new PR_METHOD_REMOVE to clean up jail handling in POSIX
   message queues.

PR:		208082
Submitted by:	delphij
2017-11-13 23:21:17 +00:00
Konstantin Belousov
d201dff4c4 MFC r325671:
Check that the pmc index is less than the number of hardware PMCs,
instead of asserting the condition.
2017-11-13 09:10:17 +00:00
Pedro F. Giffuni
84bdce81bc MFC r324962 (by fsu@):
Set doreallocblks sysctl value to zero by default because of
possibility of filesystem corruption.

Fedor has found some weird behavior in his tests.
2017-11-13 02:31:25 +00:00
Don Lewis
34b625c6fe MFC r325008
Fix Dummynet AQM packet marking function ecn_mark() and fq_codel /
fq_pie schedulers packet classification functions in layer2 (bridge mode).

Dummynet AQM packet marking function ecn_mark() and fq_codel/fq_pie
schedulers packet classification functions (fq_codel_classify_flow()
and fq_pie_classify_flow()) assume mbuf is pointing at L3 (IP)
packet. However, this assumption is incorrect if ipfw/dummynet is
used to manage layer2 traffic (bridge mode) since mbuf will point
at L2 frame.  This patch solves this problem by identifying the
source of the frame/packet (L2 or L3) and adding ETHER_HDR_LEN
offset when converting an mbuf pointer to ip pointer if the traffic
is from layer2.  More specifically, in dummynet packet tagging
function, tag_mbuf(), iphdr_off is set to ETHER_HDR_LEN if the
traffic is from layer2 and set to zero otherwise. Whenever an access
to IP header is required, mtodo(m, dn_tag_get(m)->iphdr_off) is
used instead of mtod(m, struct ip *) to correctly convert mbuf
pointer to ip pointer in both L2 and L3 traffic.

Submitted by:	lstewart
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D12506
2017-11-12 01:28:20 +00:00
Konstantin Belousov
8e007ba11d MFC r325567:
Zero whole struct ptrace_lwpinfo to not leak kernel stack data.

Security:	CVE-2017-1086
2017-11-10 12:31:58 +00:00
Hans Petter Selasky
73a85c9213 Remove the now obsolete "unify_tcp_port_space" ibcore module parameter.
Missed as part of the MFC of r324792 in r325611.

This is a direct commit.

Sponsored by:	Mellanox Technologies
2017-11-09 19:46:40 +00:00
Hans Petter Selasky
b4b666dcbb MFC r325278:
Unconditionally include "opt_inet6.h" in the LinuxKPI.
This makes sure the INET6 macro gets properly defined,
also for kernel module builds.

Sponsored by:	Mellanox Technologies
2017-11-09 19:15:28 +00:00
Hans Petter Selasky
a81e346f8e MFC r324792:
The remote DMA TCP portspace selector, RDMA_PS_TCP, is used for both
iWarp and RoCE in ibcore. The selection of RDMA_PS_TCP can not be used
to indicate iWarp protocol use. Backport the proper IB device
capabilities from Linux upstream to distinguish between iWarp and
RoCE. Only allocate the additional socket required for iWarp for RDMA
IDs when at least one iWarp device present. This resolves
interopability issues between iWarp and RoCE in ibcore

Reviewed by:		np @
Differential Revision:	https://reviews.freebsd.org/D12563
Sponsored by:		Mellanox Technologies
2017-11-09 19:00:11 +00:00
Hans Petter Selasky
0e131a698e MFC r324490:
Add support for parsing and using IPv6 addresses in krping.

Sponsored by:		Mellanox Technologies
2017-11-09 17:51:55 +00:00
Hans Petter Selasky
bae97c674d Use MAC-based GID format for the GID table entries in mlx5ib(4) to be
compatible with the ibcore module in FreeBSD 10-stable.

This fixes RDMA over VLAN, because the MAC-based GID format embeds
the VLAN ID into the GID itself and this is what ibcore expects when
requesting GID indexes from the GID cache.

RoCE V1.5 and V2 is not supported in 10-stable by mlx5ib(4).
This is a direct commit.

Sponsored by:	Mellanox Technologies
2017-11-09 17:02:20 +00:00
Konstantin Belousov
13ccab15ee MFC r325270:
Consistently ensure that we do not load MXCSR with reserved bits set.
2017-11-08 11:39:42 +00:00
Andriy Gapon
815782e143 MFC r324757: remove spa_sync_on assert from spa_async_thread_vd 2017-11-08 09:35:06 +00:00
Pedro F. Giffuni
87307154bb MFC r325397:
ANSI-fy exec_shell_imgact().

Fix a stray space while here.

PR:	223317
2017-11-07 14:28:10 +00:00
Kenneth D. Merry
13b5259d08 MFC r325371
------------------------------------------------------------------------
  r325371 | ken | 2017-11-03 15:04:22 -0600 (Fri, 03 Nov 2017) | 19 lines

  Add the LTO-8 Type M density code (0x5d, LTO-8M) to libmt and the
  mt(1) man page.

  LTO-8 Type M (also known as M8) is a pristine LTO-7 cartridge
  formatted in a LTO-8 drive in a new, higher density format.  It
  has a separate density code, and is only readable in an LTO-8
  drive.

  lib/libmt/mtlib.c:
  	Add the LTO-8 Type M density code to the density table
  	in libmt.

  usr.bin/mt/mt.1:
  	Add the LTO-8 Type M density code to the density
  	table in the mt(1) man page.

  Sponsored by:	Spectra Logic

  ------------------------------------------------------------------------
2017-11-06 20:08:02 +00:00
Glen Barber
489a7b284e MFC r325156:
Set a default hostname for virtual machine images.

Sponsored by:	The FreeBSD Foundation
2017-11-06 18:07:23 +00:00
Eugene Grosbein
5f6849353d MFC r324212:
rsh: introduce new option -N disabling shutdown of socket sending path.

PR:		205144
Approved by:	mav (mentor)
2017-11-06 12:45:51 +00:00
Eugene Grosbein
0b3b1b320a MFC r324364: ftpd(8): fix user context handling
Apply authenticated user context after update of wtmp(5) at start of session,
so that ftpd process is not killed by kernel with SIGXFSZ when user has
"filesize" limit lower than size of system wtmp file. Same applies
to session finalization: revert to super-user context before update of wtmp.

If ftpd hits limit while writing a file at user request,
do not get killed with SIGXFSZ instantly but apparently ignore the signal,
process error and report it to the user, and continue with the session.

PR:		143570
Approved by:	mav (mentor)
2017-11-06 11:11:44 +00:00
Enji Cooper
60399e335f MFC r324928:
Remove dead stores

The return value of various snprintf calls was stored in `len` and not used
in many functions.
2017-11-05 22:36:32 +00:00
Enji Cooper
729a5c919e MFC r324862:
Clean up trailing whitespace in kdb_thr_ctx(..)
2017-11-05 22:34:27 +00:00
Rick Macklem
d16c8a6970 MFC: r324639
Fix the client IP address reported by nfsdumpstate for 64bit arch and NFSv4.1.

The client IP address was not being reported for some NFSv4 mounts by
nfsdumpstate. Upon investigation, two problems were found for mounts
using IPv4. One was that the code (originally written and tested on i386)
assumed that a "u_long" was a "uint32_t" and would exactly store an
IPv4 host address. Not correct for 64bit arches.
Also, for NFSv4.1 mounts, the field was not being filled in. This was
basically correct, because NFSv4.1 does not use a callback address.
However, it meant that nfsdumpstate could not report the client IP addr.
This patch should fix both of these issues.
For IPv6, the address will still not be reported. The original NFSv4 RFC
only specified IPv4 callback addresses. I think this has changed and, if so,
a future commit to fix reporting of IPv6 addresses will be needed.
2017-11-05 20:28:28 +00:00
Rick Macklem
5940eed86b MFC: r324506
Fix forced dismount when a pNFS mount is hung on a DS.

When a "pnfs" NFSv4.1 mount is hung because of an unresponsive DS,
a forced dismount wouldn't work, because the RPC socket for the DS
was not being closed. This patch fixes this.
This will only affect "pnfs" mounts where the pNFS server's DS
is unresponsive (crashed or network partitioned or...).
Found during testing of the pNFS server.
2017-11-04 21:30:27 +00:00
Pedro F. Giffuni
f650c78740 MFC r325067:
bsnmpd: Only refresh devtree if devd event is a new or removed device.

It makes sense to refresh the tree only when a device is inserted or
removed, otherwise bsnmpd needlessly wastes lots of CPU.

PR:		209368
2017-11-04 14:56:58 +00:00
Pedro F. Giffuni
9bcd95dfb2 MFC r325066:
Fix out-of-bounds read in libc/regex.

The bug is an out-of-bounds read detected with address sanitizer that
happens when 'sp' in p_b_coll_elems() includes NUL byte[s], e.g. if it's
equal to "GS\x00". In that case len will be equal to 4, and the
strncmp(cp->name, sp, len) call will succeed when cp->name is "GS" but the
cp->name[len] == '\0' comparison will cause the read to go out-of-bounds.

Checking the length using strlen() instead eliminates the issue.

The bug was found in LLVM with oss-fuzz:
	https://reviews.llvm.org/D39380

Obtained from:	Vlad Tsyrklevich through posting on openbsd-tech
2017-11-04 14:45:36 +00:00
Cy Schubert
804785977e MFC r325030:
Remove redundant sys/cdefs.h include.
2017-11-04 05:17:03 +00:00
Andrey V. Elsukov
314759e561 MFC r324947:
Add IPv6 support for O_TCPDATALEN opcode.

  PR:		222746
2017-10-31 11:09:39 +00:00
Andriy Gapon
d918d935ce MFC r324957: iscsi_shutdown_post: do nothing if panic-ing 2017-10-31 09:58:51 +00:00
Andriy Gapon
cf15321fa2 MFC r324694: never retry oustanding requests when terminating iscsi session 2017-10-31 09:57:10 +00:00