]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
6 years agoMFC r325035: MFV r325013,r325034: 640 number_to_scaled_string is duplicated in severa...
avg [Thu, 16 Nov 2017 23:27:27 +0000 (23:27 +0000)]
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.

6 years agoMFC r325228: vdev_geom_close: close errored consumer even if vdev_reopening is set
avg [Thu, 16 Nov 2017 22:58:55 +0000 (22:58 +0000)]
MFC r325228: vdev_geom_close: close errored consumer even if vdev_reopening is set

6 years agoMFC r325608: MFV r325607: 8607 zfs: variable set but not used
avg [Thu, 16 Nov 2017 22:53:36 +0000 (22:53 +0000)]
MFC r325608: MFV r325607: 8607 zfs: variable set but not used

6 years agoMFC r325606: MFV r325605: 8713 Buffer overflow in dsl_dataset_name()
avg [Thu, 16 Nov 2017 22:44:51 +0000 (22:44 +0000)]
MFC r325606: MFV r325605: 8713 Buffer overflow in dsl_dataset_name()

6 years agoMFC r325227,r325272: geom_slice: do not destroy softc until providers are gone
avg [Thu, 16 Nov 2017 22:25:12 +0000 (22:25 +0000)]
MFC r325227,r325272: geom_slice: do not destroy softc until providers are gone

6 years agoMFC r325766
vangyzen [Thu, 16 Nov 2017 21:47:41 +0000 (21:47 +0000)]
MFC r325766

Fix formatting of _umtx_op(2)

Do not use macros in the -width of a .Bl, since mandoc does not support them.

Fix issues reported by igor and mandoc -Tlint.

Use a .Bl for list of clock IDs instead of a comma list.

Sponsored by: Dell EMC

6 years agoMFC r325764
vangyzen [Thu, 16 Nov 2017 21:45:10 +0000 (21:45 +0000)]
MFC r325764

Add __BEGIN_DECLS and __END_DECLS to <sys/umtx.h>

This allows C++ programs to call _umtx_op().

Sponsored by: Dell EMC

6 years agoMFC 319517: Add a cross-reference to sysdecode_socket_protocol(3).
jhb [Thu, 16 Nov 2017 19:07:19 +0000 (19:07 +0000)]
MFC 319517: Add a cross-reference to sysdecode_socket_protocol(3).

6 years agoMFC 325039: Rework pass through changes in r305485 to be safer.
jhb [Thu, 16 Nov 2017 18:22:03 +0000 (18:22 +0000)]
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

6 years agoMFC r320252, r320686, r325769:
gjb [Thu, 16 Nov 2017 15:59:29 +0000 (15:59 +0000)]
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 for RPI3 images 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 the
11-STABLE image fails to boot in my testing.

Sponsored by: The FreeBSD Foundation

6 years agoMFC r325758:
kib [Thu, 16 Nov 2017 12:51:39 +0000 (12:51 +0000)]
MFC r325758:
Style bug.

6 years agoMFC 324993:
jhb [Thu, 16 Nov 2017 06:55:57 +0000 (06:55 +0000)]
MFC 324993:
Add a test for sending a signal while stepping a thread via PT_STEP.

6 years agoMFC r325865
gordon [Wed, 15 Nov 2017 22:34:15 +0000 (22:34 +0000)]
MFC r325865

Properly bzero kldstat structure to prevent kernel information leak.

Security: FreeBSD-SA-17:10.kldstat
Security: CVE-2017-1088

6 years agoMFC r324727 and r325555:
ed [Wed, 15 Nov 2017 15:56:08 +0000 (15:56 +0000)]
MFC r324727 and r325555:

  Import the latest CloudABI definitions, version 0.16.

  The most important change in this release is the removal of the
  poll_fd() system call; CloudABI's equivalent of kevent(). Though I think
  that kqueue is a lot saner than many of its alternatives, our
  experience is that emulating this system call on other systems
  accurately isn't easy. It has become a complex API, even though I'm not
  convinced this complexity is needed. This is why we've decided to take a
  different approach, by looking one layer up.

  We're currently adding an event loop to CloudABI's C library that is API
  compatible with libuv (except when incompatible with Capsicum).
  Initially, this event loop will be built on top of plain inefficient
  poll() calls. Only after this is finished, we'll work our way backwards
  and design a new set of system calls to optimize it.

  Interesting challenges will include integrating asynchronous I/O into
  such a system call API. libuv currently doesn't aio(4) on Linux/BSD, due
  to it being unreliable and having undesired semantics.

  Upgrade to CloudABI v0.17.

  Compared to the previous version, v0.16, there are a couple of minor
  changes:

  - CLOUDABI_AT_PID: Process identifiers for CloudABI processes.

    Initially, BSD process identifiers weren't exposed inside the runtime,
    due to them being pretty much useless inside of a cluster computing
    environment. When jobs are scheduled across systems, the BSD process
    number doesn't act as an identifier. Even on individual systems they
    may recycle relatively quickly.

    With this change, the kernel will now generate a UUIDv4 when executing
    a process. These UUIDs can be obtained within the process using
    program_getpid(). Right now, FreeBSD will not attempt to store this
    value. This should of course happen at some point in time, so that it
    may be printed by administration tools.

  - Removal of some unused structure members for polling.

    With the polling framework being simplified/redesigned, it turns out
    some of the structure fields were not used by the C library. We can
    remove these to keep things nice and tidy.

6 years agoMFC 323588: Recognize NT_PTLWPINFO and NT_ARM_VFP in FreeBSD ELF cores.
jhb [Wed, 15 Nov 2017 15:24:28 +0000 (15:24 +0000)]
MFC 323588: Recognize NT_PTLWPINFO and NT_ARM_VFP in FreeBSD ELF cores.

6 years agoMFC r325553:
kib [Wed, 15 Nov 2017 14:35:42 +0000 (14:35 +0000)]
MFC r325553:
Remove useless DEBUG printfs in i386 sendsig() implementations.

6 years agoMFC r325737:
bapt [Wed, 15 Nov 2017 12:22:56 +0000 (12:22 +0000)]
MFC r325737:

Update to 2017.10.21

6 years agoMFC r325717:
bapt [Wed, 15 Nov 2017 12:20:53 +0000 (12:20 +0000)]
MFC r325717:

Remove __unused attributed on arguments that are actually used

6 years agoMFC r325716:
bapt [Wed, 15 Nov 2017 12:17:51 +0000 (12:17 +0000)]
MFC r325716:

Fix some nroff style issue

6 years agoMFC 323584: Add a NT_ARM_VFP ELF core note to hold VFP registers for each thread.
jhb [Wed, 15 Nov 2017 02:03:38 +0000 (02:03 +0000)]
MFC 323584: Add a NT_ARM_VFP ELF core note to hold VFP registers for each thread.

The core note matches the format and layout of NT_ARM_VFP on Linux.
Debuggers use the AT_HWCAP flags to determine how many VFP registers
are actually used and their format.

6 years agoMFC 323581,323582,323583: Add ptrace operations for VFP registers.
jhb [Tue, 14 Nov 2017 22:18:13 +0000 (22:18 +0000)]
MFC 323581,323582,323583: Add ptrace operations for VFP registers.

323581:
Only mess with VFP state on the CPU for curthread for get/set_vfpcontext.

Future changes will use these functions to fetch and store VFP state for
threads other than curthread.

323582:
Add ptrace operations to fetch and store VFP registers.

323583:
Export get/set_vfpcontext from machdep.c.

Should have been part of the previous commit to add ptrace operations
for VFP registers.

6 years agoMFC r325009:
trasz [Tue, 14 Nov 2017 18:17:23 +0000 (18:17 +0000)]
MFC r325009:

Make gmountver(8) use direct dispatch.

MFC r325101:

Add back missing MTX_DEF, it still needs to be there.

(Although it's defined to be 0, so there's no functional change.)

6 years agoMFC r213931:
trasz [Tue, 14 Nov 2017 18:13:30 +0000 (18:13 +0000)]
MFC r213931:

Make gmountver(8) use G_PF_ACCEPT_UNMAPPED.

6 years agoMFC r324857:
trasz [Tue, 14 Nov 2017 18:07:51 +0000 (18:07 +0000)]
MFC r324857:

Add OID for the vm.overcommit sysctl. This makes it possible to remove
one call to sysctl(2) from jemalloc startup code. (That also requires
changes to jemalloc, but I plan to push those to upstream first.)

6 years agoMFC r324427:
trasz [Tue, 14 Nov 2017 18:01:48 +0000 (18:01 +0000)]
MFC r324427:

Document "tdnam" keyword to ps(1), and add "tdname" alias.

MFC r324429:

Fix long name (used by libxo) for the "tdnam" ps(1) keyword.

MFC r324430:

Undocument "tdnam" (leaving it as an alias), and rename the column
to TDNAME.

6 years agoMFC r324367:
trasz [Tue, 14 Nov 2017 17:57:48 +0000 (17:57 +0000)]
MFC r324367:

Fix kvm_getprocs(3) error reporting in ps(1).

Previously it just didn't work at all - kvm_getprocs(3) doesn't update
the &nentries when it returns NULL.  The end result was that ps(1) showed
garbage data instead of reporting kinfo_proc size mismatch.

6 years agoMFC r324276:
trasz [Tue, 14 Nov 2017 17:56:32 +0000 (17:56 +0000)]
MFC r324276:

Don't destroy gmountver(8) devices on shutdown, unless they are orphaned.
Otherwise we would fail to sync the filesystem on reboot.

6 years agoMFC r324199:
trasz [Tue, 14 Nov 2017 17:54:00 +0000 (17:54 +0000)]
MFC r324199:

Clear G_CF_ORPHAN when attaching. This fixes cases where the same
GEOM consumer can be orphaned, and then reattach to another provider.

From a user point of view, this makes gmountver(4) work again.

6 years agoMFC r320672:
trasz [Tue, 14 Nov 2017 17:05:34 +0000 (17:05 +0000)]
MFC r320672:

Cosmetic tweaks to the default shell rc files, mostly comments.

MFC r320678:

Fix typo introduced in r320672 - check for existence of the right file.

6 years agoMFC r320672:
trasz [Tue, 14 Nov 2017 17:03:56 +0000 (17:03 +0000)]
MFC r320672:

Run "resizewin -z" from the default shell profile files. This makes
the terminal work properly out of the box when logging over a serial
line, which is quite important for the user experience on boards like
Raspberry Pi.  It doesn't affect cases where the terminal size is
already non-zero, such as SSH or vt(4) sessions.

Note that this doesn't handle a scenario pointed out by rgrimes@:
when the terminal is resized after login, the terminal size won't
get updated even after logging out and back in.

6 years agoMFC 323580,323933,323934,324814,324817: Enable AT_HWCAP on arm.
jhb [Tue, 14 Nov 2017 16:03:07 +0000 (16:03 +0000)]
MFC 323580,323933,323934,324814,324817: Enable AT_HWCAP on arm.

I reused the SV_HWCAP stub to cover the sv_hwcap2 field as well.

323580:
Add AT_HWCAP flags for VFP settings for FreeBSD/arm.

These flags match the meaning and value of flags in Linux, though
Linux has many more flags.

323933:
Correct HWCAP_VFP3* values to match Linux.

323934:
Detect NEON and set HWCAP_NEON if present.

324814:
Add AT_HWCAP2 ELF auxiliary vector.
 - allocate value for new AT_HWCAP2 auxiliary vector on all platforms.
 - expand 'struct sysentvec' by new 'u_long *sv_hwcap2', in exactly
   same way as for AT_HWCAP.

324817:
Fullify implementation of AT_HWCAP and AT_HWCAP2 for ARMv6,7.
This makes elf_aux_info(3) useable for ARM ports.

Tested by: mmel

6 years agoMFC r324261:
trasz [Tue, 14 Nov 2017 16:00:21 +0000 (16:00 +0000)]
MFC r324261:

Fix iSCSI target panics on concurrent session teardown and display
(eg removing a target and doing "ctladm islist -v" at the same time).

6 years agoMFC r322401:
gjb [Tue, 14 Nov 2017 15:07:34 +0000 (15:07 +0000)]
MFC r322401:
 Avoid creating kernel-dbg.txz distribution sets and kernel-debug
 packages when MK_DEBUG_FILES is 'no'.

Differential Revision: https://reviews.freebsd.org/D12544 (related)
Sponsored by: The FreeBSD Foundation

6 years agoMFH (r325010): don't bother verifying a password that we know is too long.
des [Tue, 14 Nov 2017 10:48:30 +0000 (10:48 +0000)]
MFH (r325010): don't bother verifying a password that we know is too long.

Reported by: jkim@
Security: CVE-2016-6210

6 years agoMFC r325559: ifconfig_<interface>_descr
eugen [Tue, 14 Nov 2017 09:29:02 +0000 (09:29 +0000)]
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)

6 years agoMFC r325671:
kib [Mon, 13 Nov 2017 09:07:30 +0000 (09:07 +0000)]
MFC r325671:
Check that the pmc index is less than the number of hardware PMCs,
instead of asserting the condition.

6 years agoMFC r324962:
fsu [Sun, 12 Nov 2017 18:06:43 +0000 (18:06 +0000)]
MFC r324962:
Set doreallocblks sysctl value to zero by default because of
possibility of filesystem corruption.

Approved by:    pfg (mentor)

6 years agoMFC r325008
truckman [Sun, 12 Nov 2017 01:26:43 +0000 (01:26 +0000)]
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

6 years agoMFC r325389:
kib [Sat, 11 Nov 2017 12:16:19 +0000 (12:16 +0000)]
MFC r325389:
C++17 requires quick_exit(3) to be async-signal safe.

6 years agoMFC r325388:
kib [Sat, 11 Nov 2017 12:12:26 +0000 (12:12 +0000)]
MFC r325388:
x86: Do not emit unused TD_TID symbols.

6 years agoMFC r325387:
kib [Sat, 11 Nov 2017 12:09:33 +0000 (12:09 +0000)]
MFC r325387:
Eliminate unused load.

6 years agoMFC r325386:
kib [Sat, 11 Nov 2017 12:08:07 +0000 (12:08 +0000)]
MFC r325386:
Convert explicit panic() call to assert.

6 years agoMFC r324795:
kib [Fri, 10 Nov 2017 13:17:40 +0000 (13:17 +0000)]
MFC r324795:
Move swapout code into vm/vm_swapout.c.

6 years agoMFC r303627 (by alc):
kib [Fri, 10 Nov 2017 12:54:33 +0000 (12:54 +0000)]
MFC r303627 (by alc):
Restore the historical behavior of "sysctl vm.swap_idle_enabled=1".

6 years agoMFC r324807:
kib [Fri, 10 Nov 2017 12:45:09 +0000 (12:45 +0000)]
MFC r324807:
Take the vm object lock in read mode in vnode_generic_putpages().

6 years agoMFC r324794:
kib [Fri, 10 Nov 2017 12:42:50 +0000 (12:42 +0000)]
MFC r324794:
Do not overwrite clean blocks on pageout.

6 years agoMFC r325567:
kib [Fri, 10 Nov 2017 12:28:43 +0000 (12:28 +0000)]
MFC r325567:
Zero whole struct ptrace_lwpinfo to not leak kernel stack data.

Security: CVE-2017-1086

6 years agoMFC r325355:
ae [Fri, 10 Nov 2017 11:19:33 +0000 (11:19 +0000)]
MFC r325355:
  Use correct pointer in key_updateaddresses() when updating NAT-T config.

  key_updateaddresses() is used to update SA addresses and NAT-T
  configuration in SADB_UPDATE message. This is done using cloning SA
  content from old SA into new one. But addresses and NAT-T configuration
  are taking from SADB_UPDATE message. Use newsa pointer to set NAT-T
  properties into cloned SA.

  PR: 223382

6 years agoMFC r325362:
hselasky [Fri, 10 Nov 2017 08:42:37 +0000 (08:42 +0000)]
MFC r325362:
Allow CUSE(3) to free all memory mapped memory by using regular SWAP objects
instead of malloc(). The SWAP objects are automagically freed when there are no
more consumers. This greatly simplifies the mmap logic inside CUSE(3) in the
kernel. This change fixes an issue where mmapped memory can accumulate and never
get freed, if many different mmap sizes are needed over time. Further this
change fixes memory leaks when the CUSE(3) kernel module is unloaded.

While at it make sure the CUSE_ALLOC_PAGES_MAX limit is treated as an exclusive
limit. CUSE(3) memory maps must be less than CUSE_ALLOC_PAGES_MAX number of pages.

Reviewed by: kib @
Differential Revision: https://reviews.freebsd.org/D11392
Sponsored by: Mellanox Technologies

6 years agoMerge r323509 and r324994 adding Cavium LiquidIO Driver (lio)
sbruno [Thu, 9 Nov 2017 19:52:56 +0000 (19:52 +0000)]
Merge r323509 and r324994 adding Cavium LiquidIO Driver (lio)
to stable/11.

Submitted by: pkanneganti@cavium.com ((Prasad V Kanneganti)
Sponsored by: Cavium Networks
Differential Revision: https://reviews.freebsd.org/D12425

6 years agoMFC r325278:
hselasky [Thu, 9 Nov 2017 19:08:30 +0000 (19:08 +0000)]
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

6 years agoMFC r324792:
hselasky [Thu, 9 Nov 2017 17:58:57 +0000 (17:58 +0000)]
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

6 years agoMFC r324491:
hselasky [Thu, 9 Nov 2017 17:54:00 +0000 (17:54 +0000)]
MFC r324491:
Use common rdma_ip2gid() function instead of custom mlx5_ip2gid() one.

Sponsored by: Mellanox Technologies

6 years agoMFC r324490:
hselasky [Thu, 9 Nov 2017 17:49:45 +0000 (17:49 +0000)]
MFC r324490:
Add support for parsing and using IPv6 addresses in krping.

Sponsored by: Mellanox Technologies

6 years agoMFC r324492:
hselasky [Thu, 9 Nov 2017 17:47:33 +0000 (17:47 +0000)]
MFC r324492:
Make sure the IPv6 scope ID gets zeroed inside the GID. Else searching for a
valid GID entry based on IPv6 addresses can fail.

Sponsored by: Mellanox Technologies

6 years agoMFC r325277:
kib [Wed, 8 Nov 2017 12:13:25 +0000 (12:13 +0000)]
MFC r325277:
Do not run pmclog_configure_log() without pmc_sx protection.

6 years agoMFC r325276:
kib [Wed, 8 Nov 2017 12:11:54 +0000 (12:11 +0000)]
MFC r325276:
Be protective and check the po_file validity before dropping the ref.

6 years agoMFC r325275:
kib [Wed, 8 Nov 2017 12:10:14 +0000 (12:10 +0000)]
MFC r325275:
In hwpmc, do not double-close the logging file.

6 years agoMFC r325274:
kib [Wed, 8 Nov 2017 12:07:01 +0000 (12:07 +0000)]
MFC r325274:
There is no use for dropping Giant in the pmc syscall.

6 years agoMFC r325273:
kib [Wed, 8 Nov 2017 12:03:11 +0000 (12:03 +0000)]
MFC r325273:
Minor style tweaks.

6 years agoMFC r325271:
kib [Wed, 8 Nov 2017 12:00:49 +0000 (12:00 +0000)]
MFC r325271:
Use designated initializers for pmc sysent and module data.

6 years agoMFC r324972:
kib [Wed, 8 Nov 2017 11:47:00 +0000 (11:47 +0000)]
MFC r324972:
Tweaks to the top swap size calculations.

PR: 223149

6 years agoMFC r325285, r325447:
kib [Wed, 8 Nov 2017 11:44:02 +0000 (11:44 +0000)]
MFC r325285, r325447:
Restore an optimization that was temporary disabled by r324665.

6 years agoMFC r325270:
kib [Wed, 8 Nov 2017 11:25:19 +0000 (11:25 +0000)]
MFC r325270:
Consistently ensure that we do not load MXCSR with reserved bits set.

6 years agoMFC r324195: MFV r323795: 8604 Avoid unnecessary work search in VFS when unmounting...
avg [Wed, 8 Nov 2017 09:36:59 +0000 (09:36 +0000)]
MFC r324195: MFV r323795: 8604 Avoid unnecessary work search in VFS when unmounting snapshots

6 years agoMFC r324757: remove spa_sync_on assert from spa_async_thread_vd
avg [Wed, 8 Nov 2017 09:25:32 +0000 (09:25 +0000)]
MFC r324757: remove spa_sync_on assert from spa_async_thread_vd

6 years agoMFC r324197: MFV r323913: 8600 ZFS channel programs - snapshot
avg [Wed, 8 Nov 2017 09:22:04 +0000 (09:22 +0000)]
MFC r324197: MFV r323913: 8600 ZFS channel programs - snapshot

6 years agoMFC r324196: MFV r323912: 8592 ZFS channel programs - rollback
avg [Wed, 8 Nov 2017 09:16:31 +0000 (09:16 +0000)]
MFC r324196: MFV r323912: 8592 ZFS channel programs - rollback

6 years agoMFC r324170: MFV r323794: 8605 zfs channel programs: zfs.exists undocumented and...
avg [Wed, 8 Nov 2017 09:15:09 +0000 (09:15 +0000)]
MFC r324170: MFV r323794: 8605 zfs channel programs: zfs.exists undocumented and non-working

6 years agoMFC r324168: MFV r323531: 8521 nvlist memory leak in get_clones_stat() and spa_load_b...
avg [Wed, 8 Nov 2017 09:11:49 +0000 (09:11 +0000)]
MFC r324168: MFV r323531: 8521 nvlist memory leak in get_clones_stat() and spa_load_best()

6 years agoMFC r324163: MFV r323530,r323533,r323534: 7431 ZFS Channel Programs, and followups
avg [Wed, 8 Nov 2017 08:53:44 +0000 (08:53 +0000)]
MFC r324163: MFV r323530,r323533,r323534: 7431 ZFS Channel Programs, and followups

Also MFC-ed are the following fixes:
- r324164 Add several new files to the files enabled by ZFS kernel option
- r324178 unbreak kernel builds on sparc64 and powerpc
- r324194 fix incorrect use of getzfsvfs_impl in r324163
- r324292 really unbreak kernel builds on sparc64 and powerpc64

6 years agoMFC r325420: lld: accept EINVAL to indicate posix_fallocate is unsupported
emaste [Wed, 8 Nov 2017 00:39:04 +0000 (00:39 +0000)]
MFC r325420: lld: accept EINVAL to indicate posix_fallocate is unsupported

As of r325320 posix_fallocate on a ZFS filesystem returns EINVAL to
indicate that the operation is not supported. (I think this is a strange
choice of errno on the part of POSIX.)

PR: 223383, 223440
Reported by: Mark Millard
Sponsored by: The FreeBSD Foundation

6 years agoMFC r325232
tijl [Tue, 7 Nov 2017 17:07:45 +0000 (17:07 +0000)]
MFC r325232

Set the return address for stack entry points to zero.

Stack unwinders treat zero as a stop condition.  The value on the stack can
be non-zero because thread stacks may be arbitrary memory provided via
pthread_attr_setstack(3) or may be recycled from previous threads.

Reference:
https://lists.freebsd.org/pipermail/freebsd-current/2017-August/066855.html
https://lists.freebsd.org/pipermail/freebsd-current/2017-October/067254.html

Discussed with: kib

6 years agoMFC r325397:
pfg [Tue, 7 Nov 2017 14:25:09 +0000 (14:25 +0000)]
MFC r325397:
ANSI-fy exec_shell_imgact().

Fix a stray space while here.

PR: 223317

6 years agoMFC r325371
ken [Mon, 6 Nov 2017 20:08:00 +0000 (20:08 +0000)]
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

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

6 years agoMFC r325156:
gjb [Mon, 6 Nov 2017 18:07:23 +0000 (18:07 +0000)]
MFC r325156:
 Set a default hostname for virtual machine images.

Sponsored by: The FreeBSD Foundation

6 years agoDocument issuing 'vagrant up' a second time will boot properly if the
gjb [Mon, 6 Nov 2017 17:27:50 +0000 (17:27 +0000)]
Document issuing 'vagrant up' a second time will boot properly if the
virtual machine does not yet have a MAC address.

PR: 223474 (related)
Sponsored by: The FreeBSD Foundation

6 years agoMFC r325157,325158:
eugen [Mon, 6 Nov 2017 13:56:03 +0000 (13:56 +0000)]
MFC r325157,325158:

  Fix ppp(8) to add RTF_HOST flag to created host route.

Reported by: Mike Tancsa <mike@sentex.net>
Approved by: mav (mentor)

6 years agoMFC r324212:
eugen [Mon, 6 Nov 2017 12:44:26 +0000 (12:44 +0000)]
MFC r324212:

  rsh: introduce new option -N disabling shutdown of socket sending path.

PR: 205144
Approved by: mav (mentor)

6 years agoMFC r324364: ftpd(8): fix user context handling
eugen [Mon, 6 Nov 2017 11:10:43 +0000 (11:10 +0000)]
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)

6 years agoMFC r324928,r324929:
ngie [Sun, 5 Nov 2017 22:36:02 +0000 (22:36 +0000)]
MFC r324928,r324929:

r324928:

Remove dead stores

The return value of various snprintf calls was stored in `len` and not used
in many functions.

r324929:

Clean up trailing whitespace

6 years agoMFC r324862:
ngie [Sun, 5 Nov 2017 22:33:41 +0000 (22:33 +0000)]
MFC r324862:

Clean up trailing whitespace in kdb_thr_ctx(..)

6 years agoMFC r318432:
bdrewery [Sat, 4 Nov 2017 22:23:41 +0000 (22:23 +0000)]
MFC r318432:

  Fix some nroff syntax in rtld.1.

PR: 223420

6 years agoMFC r325051:
markj [Sat, 4 Nov 2017 16:03:48 +0000 (16:03 +0000)]
MFC r325051:
Remove a stale and incorrect comment.

6 years agoMFC r325050:
markj [Sat, 4 Nov 2017 16:03:06 +0000 (16:03 +0000)]
MFC r325050:
Remove workqueue items after updating the workqueue tail pointer.

6 years agoMFC r325067:
pfg [Sat, 4 Nov 2017 14:49:22 +0000 (14:49 +0000)]
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

6 years agoMFC r325066:
pfg [Sat, 4 Nov 2017 14:44:07 +0000 (14:44 +0000)]
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

6 years agoMFC r323547, r323598:
pfg [Sat, 4 Nov 2017 14:35:01 +0000 (14:35 +0000)]
MFC r323547, r323598:
libedit: add missing bracket.

We never hit this because we always build with widechar support.
Raise the warning level to 3.

6 years agoMFC r324824:
kib [Sat, 4 Nov 2017 10:10:34 +0000 (10:10 +0000)]
MFC r324824:
Check that the page which is freed as zeroed, indeed has all-zero content.

6 years agoMFC r325030:
cy [Sat, 4 Nov 2017 05:17:03 +0000 (05:17 +0000)]
MFC r325030:

Remove redundant sys/cdefs.h include.

6 years agoMFC r325017: libnv: Fix strict-aliasing violation with cookie
jilles [Fri, 3 Nov 2017 22:41:31 +0000 (22:41 +0000)]
MFC r325017: libnv: Fix strict-aliasing violation with cookie

In r323851 (MFC'ed to stable/11 as r324831), some casts were adjusted in
calls to nvlist_next() and nvlist_get_pararr() in order to make scan-build
happy. I think these changes just confused scan-build into not reporting
the strict-aliasing violation.

For example, nvlist_xdescriptors() is causing nvlist_next() to write to its
local variable nvp of type nvpair_t * using the lvalue *cookiep of type
void *, which is not allowed. Given the APIs of nvlist_next(),
nvlist_get_parent() and nvlist_get_pararr(), one possible fix is to create a
local void *cookie in nvlist_xdescriptors() and other places, and to convert
the value to nvpair_t * when necessary. This patch implements that fix.

6 years agoMFC: r324774
wulf [Thu, 2 Nov 2017 21:19:17 +0000 (21:19 +0000)]
MFC: r324774
psm(4): Add sanity checks to Synaptics touchpad driver resolution parser.

This fixes "Kernel has only x or y resolution, not both" libinput error.

Reported by: Ivan <bsd@abinet.ru>
Tested by: Ivan <bsd@abinet.ru>
Approved by: gonzo (mentor)

6 years agoMFC: r324770
wulf [Thu, 2 Nov 2017 21:17:05 +0000 (21:17 +0000)]
MFC: r324770
bthidd: Fix leds on multireport keyboards broken after r297217

Reviewed by: emax, gonzo
Approved by: gonzo (mentor)
Differential Revision: https://reviews.freebsd.org/D12214

6 years agoMFC: r324772
wulf [Thu, 2 Nov 2017 21:13:24 +0000 (21:13 +0000)]
MFC: r324772
ums(4): Unreverse evdev Tilt-axis reporting to match Linux.

sysmouse tilt to button mapping remained unchanged.

Reviewed by: hselasky
Approved by: gonzo (mentor)
Differential Revision: https://reviews.freebsd.org/D12671

6 years agoMFC: r324639
rmacklem [Thu, 2 Nov 2017 20:28:53 +0000 (20:28 +0000)]
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.

6 years agoMFC: r325328
jkim [Thu, 2 Nov 2017 18:30:41 +0000 (18:30 +0000)]
MFC: r325328

Merge OpenSSL 1.0.2m.

6 years agoMFC: r307977
jkim [Thu, 2 Nov 2017 18:27:32 +0000 (18:27 +0000)]
MFC: r307977

Prefer ACFLAGS over CFLAGS for compiling aarch64 assembly files.

6 years agoMFC: r318899
jkim [Thu, 2 Nov 2017 18:22:53 +0000 (18:22 +0000)]
MFC: r318899

Merge OpenSSL 1.0.2l.

6 years agoMFC: r316607 (andrew)
jkim [Thu, 2 Nov 2017 18:20:05 +0000 (18:20 +0000)]
MFC: r316607 (andrew)

Fix linking with lld by marking OPENSSL_armcap_P as hidden.

Linking with lld fails as it contains a relative address, however the data
this address is for may be relocated from the shared object to the main
executable.

Fix this by adding the hidden attribute. This stops moving this value to
the main executable. It seems this is implicit upstream as it uses a
version script.

6 years agoMFC: r307976
jkim [Thu, 2 Nov 2017 18:16:01 +0000 (18:16 +0000)]
MFC: r307976

Build OpenSSL assembly sources for aarch64.