]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
6 years agoMFC r326410:
markj [Thu, 21 Dec 2017 22:48:02 +0000 (22:48 +0000)]
MFC r326410:
Document gmirror sysctls.

6 years agoMFC r326409:
markj [Thu, 21 Dec 2017 22:47:04 +0000 (22:47 +0000)]
MFC r326409:
Update gmirror metadata less frequently when synchronizing.

6 years agoMFC r326847:
ae [Thu, 21 Dec 2017 14:09:06 +0000 (14:09 +0000)]
MFC r326847:
  Fix mbuf leak when TCPMD5_OUTPUT() method returns error.

  PR: 223817

6 years agoMFC r326851:
kib [Thu, 21 Dec 2017 13:30:56 +0000 (13:30 +0000)]
MFC r326851:
In devfs_lookupx() dotdot lookup case, avoid dereferencing
dvp->v_mount after dvp is unlocked.

6 years agoMFC r326561: Use strlcpy().
delphij [Wed, 20 Dec 2017 07:55:47 +0000 (07:55 +0000)]
MFC r326561: Use strlcpy().

6 years agoMFC r326560: Create links for xzdiff.
delphij [Wed, 20 Dec 2017 07:43:32 +0000 (07:43 +0000)]
MFC r326560: Create links for xzdiff.

6 years agoMFC r326562: Use strlcpy().
delphij [Wed, 20 Dec 2017 07:16:41 +0000 (07:16 +0000)]
MFC r326562: Use strlcpy().

6 years agoMFC r326030: Install strings unconditionally
emaste [Wed, 20 Dec 2017 00:30:31 +0000 (00:30 +0000)]
MFC r326030: Install strings unconditionally

Previously it was enabled by WITH_/WITHOUT_TOOLCHAIN, but it is commonly
expected to be available and may have non-toolchain consumers.  As it
is now taken from the BSD-licensed ELF Tool Chain project, just install
it unconditionally.

PR: 213665, 223725
Sponsored by: The FreeBSD Foundation

6 years agoMFC r326813:
markj [Tue, 19 Dec 2017 16:20:13 +0000 (16:20 +0000)]
MFC r326813:
MFV r326785: 8880 improve DTrace error checking

6 years agoMFC r326796-r326798:
markj [Tue, 19 Dec 2017 16:16:34 +0000 (16:16 +0000)]
MFC r326796-r326798:
Fix sc_writes tracking, and address a lost wakeup.

6 years agoMFC r326880:
dim [Tue, 19 Dec 2017 11:44:24 +0000 (11:44 +0000)]
MFC r326880:

Pull in r320755 from upstream clang trunk (by me):

  Don't trigger -Wuser-defined-literals for system headers

  Summary:
  In D41064, I proposed adding `#pragma clang diagnostic ignored
  "-Wuser-defined-literals"` to some of libc++'s headers, since these
  warnings are now triggered by clang's new `-std=gnu++14` default:

  $ cat test.cpp
  #include <string>

  $ clang -std=c++14 -Wsystem-headers -Wall -Wextra -c test.cpp
  In file included from test.cpp:1:
  In file included from /usr/include/c++/v1/string:470:
  /usr/include/c++/v1/string_view:763:29: warning: user-defined literal suffixes not starting with '_' are reserved [-Wuser-defined-literals]
      basic_string_view<char> operator "" sv(const char *__str, size_t __len)
                              ^
  /usr/include/c++/v1/string_view:769:32: warning: user-defined literal suffixes not starting with '_' are reserved [-Wuser-defined-literals]
      basic_string_view<wchar_t> operator "" sv(const wchar_t *__str, size_t __len)
                                 ^
  /usr/include/c++/v1/string_view:775:33: warning: user-defined literal suffixes not starting with '_' are reserved [-Wuser-defined-literals]
      basic_string_view<char16_t> operator "" sv(const char16_t *__str, size_t __len)
                                  ^
  /usr/include/c++/v1/string_view:781:33: warning: user-defined literal suffixes not starting with '_' are reserved [-Wuser-defined-literals]
      basic_string_view<char32_t> operator "" sv(const char32_t *__str, size_t __len)
                                  ^
  In file included from test.cpp:1:
  /usr/include/c++/v1/string:4012:24: warning: user-defined literal suffixes not starting with '_' are reserved [-Wuser-defined-literals]
      basic_string<char> operator "" s( const char *__str, size_t __len )
                         ^
  /usr/include/c++/v1/string:4018:27: warning: user-defined literal suffixes not starting with '_' are reserved [-Wuser-defined-literals]
      basic_string<wchar_t> operator "" s( const wchar_t *__str, size_t __len )
                            ^
  /usr/include/c++/v1/string:4024:28: warning: user-defined literal suffixes not starting with '_' are reserved [-Wuser-defined-literals]
      basic_string<char16_t> operator "" s( const char16_t *__str, size_t __len )
                             ^
  /usr/include/c++/v1/string:4030:28: warning: user-defined literal suffixes not starting with '_' are reserved [-Wuser-defined-literals]
      basic_string<char32_t> operator "" s( const char32_t *__str, size_t __len )
                             ^
  8 warnings generated.

  Both @aaron.ballman and @mclow.lists felt that adding this workaround
  to the libc++ headers was the wrong way, and it should be fixed in
  clang instead.

  Here is a proposal to do just that.  I verified that this suppresses
  the warning, even when -Wsystem-headers is used, and that the warning
  is still emitted for a declaration outside of system headers.

  Reviewers: aaron.ballman, mclow.lists, rsmith

  Reviewed By: aaron.ballman

  Subscribers: mclow.lists, aaron.ballman, andrew, emaste, cfe-commits

  Differential Revision: https://reviews.llvm.org/D41080

This will allow to compile some of the libc++ headers in C++14 mode
(which is the default for gcc 6 and higher, and will be the default for
clang 6.0.0 and higher), with -Wsystem-headers and -Werror enabled.

Reported by: andrew

6 years agoMFC r326776:
dim [Tue, 19 Dec 2017 11:39:05 +0000 (11:39 +0000)]
MFC r326776:

Pull in r320396 from upstream clang trunk (by Malcolm Parsons):

  [Sema] Fix crash in unused-lambda-capture warning for VLAs

  Summary:
  Clang was crashing when diagnosing an unused-lambda-capture for a VLA
  because From.getVariable() is null for the capture of a VLA bound.
  Warning about the VLA bound capture is not helpful, so only warn for
  the VLA itself.

Fixes: PR35555
  Reviewers: aaron.ballman, dim, rsmith

  Reviewed By: aaron.ballman, dim

  Subscribers: cfe-commits

  Differential Revision: https://reviews.llvm.org/D41016

This fixes a segfault when building recent audio/zynaddsubfx port
versions.

Reported by: hps

6 years agoMFC: r326544
rmacklem [Mon, 18 Dec 2017 22:55:19 +0000 (22:55 +0000)]
MFC: r326544
Avoid the overhead of acquiring a lock in nfsrv_checkgetattr() when
there are no write delegations issued.

manu@ reported on the freebsd-current@ mailing list that there was
a significant performance hit in nfsrv_checkgetattr() caused by
the acquisition/release of a state lock, even when there were no
write delegations issued.
This patch add a count of outstanding issued write delegations to the
NFSv4 server. This count allows nfsrv_checkgetattr() to return without
acquiring any lock when the count is 0, avoiding the performance hit
for the case where no write delegations are issued.

6 years agoMFC r312914, r322694
manu [Mon, 18 Dec 2017 20:17:54 +0000 (20:17 +0000)]
MFC r312914, r322694

r312914 by imp:
Honor LINKS=x y in dtb modules. We need this for compatibility links
for old, FreeBSD names.

r322694:
RPI DTS: Add value previously set by VideoCore and DTB links

Using latest U-Boot for RPI 1 or 2 the DTB loaded by the firmware is discarded.
The DTB was previously patched by the firmware to contain the DMA channel mask.
DTB provided by the rpi firmware or DTS in the Linux tree contain the raw value
directly. Do the same for our DTS as we cannot switch to the upstream ones yet.
Not having the DMA channel mask setup properly cause mmc not to be detected
(and probably other problems on driver using DMA).

Also, add links for rpi dtb to the name used by u-boot. This way the dtb can be
loaded by ubldr using the U-Boot env variable fdtfile.

Tested On: RPI B Rev2, RPI Zero, RPI 2 v1.1 RPI 2 v1.2

Thanks to Sylvain Garrigues <sylvain@sylvaingarrigues.com> for the help.

PR: 218344

6 years agoMFC (conceptually) r326752, r326754:
ian [Mon, 18 Dec 2017 17:17:07 +0000 (17:17 +0000)]
MFC (conceptually) r326752, r326754:

This is a direct commit to 11-stable, because the code has moved and
the directories have been restructured in 12-current, but it just hand-
applies the same patches to the corresponding files in their old locations.

r326752:
  Save and restore r9 register in arm ubldr.  In old gcc 4.2, r9 was a callee-
  saved register, but in arm EABI it may be either callee-saved or dedicated
  to some special purpose (such as a TLS pointer).  It appears clang does not
  treat it as a callee-saved register (instead using it as another work
  register, similar to r12).

  Another important side effect of these changes is that saving an extra
  register in the push/pop statements keeps the stack aligned to an 8-byte
  boundary during the self_reloc() call, as it always should have been.

  As stated in the PR...

  Essentially the important caller-saved registers are pushed (r0, r1, r9, lr)
  before the relocation call, and popped after.  Then r8/r9 are saved as usual
  for the syscall trampoline, and lr is stored in r8 (now free) as a
  callee-saved value before calling into `main`.

  The call to `main` can no longer be a tail call because we must restore r9
  especially after main returns (although since we have used r8 to hold lr we
  must also restore this).

r326754:
  When building for arm arches, set PKTALIGN to the max cache line size
  supported by the arch, to meet u-boot's requirement that I/O be done
  in cache-aligned chunks.

PR:           223977 224008

6 years agoMFC r326734:
karels [Mon, 18 Dec 2017 05:29:38 +0000 (05:29 +0000)]
MFC r326734:

gifconfig_gif0 no longer works, document replacement

rc.conf(5) documents the gifconfig_<interface> keyword, which is
no longer implemented. Document the replacement, which works with
cloned_interfaces as well.

Reviewed by:    dab
Group Reviwers: manpages
Differential Revision:  https://reviews.freebsd.org/D13130

6 years agoMFC r326438:
markj [Sun, 17 Dec 2017 19:58:48 +0000 (19:58 +0000)]
MFC r326438:
Plug a name cache lock leak.

6 years agoMFC r326731:
markj [Sun, 17 Dec 2017 19:49:37 +0000 (19:49 +0000)]
MFC r326731:
Provide a sysctl to force synchronous initialization of inode blocks.

6 years agoMFC r326732:
markj [Sun, 17 Dec 2017 19:48:35 +0000 (19:48 +0000)]
MFC r326732:
Fix the act_scan_laundry_weight mechanism.

6 years agoMFC r326558, r326566:
cy [Sun, 17 Dec 2017 06:00:49 +0000 (06:00 +0000)]
MFC r326558, r326566:

fdformat is a sysadmin command and thus its man page should be in
volume 8 instead of volume 1.

Reviewed by: imp

6 years agoMFC r326565: Make EC2 instances use Amazon's NTP service for time
cperciva [Sat, 16 Dec 2017 00:47:45 +0000 (00:47 +0000)]
MFC r326565: Make EC2 instances use Amazon's NTP service for time
synchronization.

Relnotes: EC2 instances now keep their clocks synchronized using
the Amazon Time Sync Service (aka. NTP).

6 years agoAdd vfs.nfs.suppress_32bits_warning sysctl which reduces the frequency
cperciva [Sat, 16 Dec 2017 00:44:11 +0000 (00:44 +0000)]
Add vfs.nfs.suppress_32bits_warning sysctl which reduces the frequency
of 'fileid > 32bits' warnings from at most once per minute to at most
once per day.

Direct commit to stable/11 since the relevant code was removed from HEAD
following the switch to 64-bit inodes.

Requested by: Rafal Lukawiecki
Approved by: rmacklem

6 years agoMFC r326738: pw(8): correct expiration period handling
eugen [Thu, 14 Dec 2017 13:06:41 +0000 (13:06 +0000)]
MFC r326738: pw(8): correct expiration period handling
  and command line overrides to preconfigured values for -e, -p and -w flags.

  Use non-negative symbols instead of magic values
  in passwd_val/pw_password functions.

PR: 223431
Submitted by: Yuri Pankov (in part, patch for the manual)
Approved by: mav (mentor)
Relnotes: yes

6 years agoMFC r326657:
kib [Thu, 14 Dec 2017 11:41:12 +0000 (11:41 +0000)]
MFC r326657:
Fix livelock in ufsdirhash_create().

6 years agoMFC r326391: Prevent OOB access on corrupted msdos directories.
delphij [Thu, 14 Dec 2017 07:52:38 +0000 (07:52 +0000)]
MFC r326391: Prevent OOB access on corrupted msdos directories.

Submitted by: Veo Zhang <veo live com>

6 years agoMFC r324248:
cy [Wed, 13 Dec 2017 20:15:23 +0000 (20:15 +0000)]
MFC r324248:

hen building multiple kernels using KERNCONF, non-existent KERNCONF
files will produce an error and buildkernel will fail. Previously missing
KERNCONF files silently failed giving no indication as to why, only to
subsequently discover during installkernel that the desired kernel was
never built in the first place.

This is a rework of r302865.

This is the correct patch.

Reviewed by: ngie (previous version, r302865)
Differential Revision: https://reviews.freebsd.org/D7167

6 years agoMFC r326748:
dim [Wed, 13 Dec 2017 18:38:02 +0000 (18:38 +0000)]
MFC r326748:

Document the existence and precision of the remaining long double
functions for which an imprecise stub implementation was added in
r255294, namely powl(3) and tgammal(3).

Submitted by: Steve Kargl

MFC r326753:

Correct r326748, indicating that tgammal(3) is mapped to tgamma(3), not
to itself.

Noticed by: jilles

6 years agoMFC r326101:
asomers [Wed, 13 Dec 2017 16:22:02 +0000 (16:22 +0000)]
MFC r326101:

Add a test case for cam_get_device with sa(4) devices

sa(4) has some unique behavior that is special-cased in cam_get_device. The
existing tests don't provide coverage for this special case.

Reviewed by: ken
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D13185

6 years agoMFC r326100:
asomers [Wed, 13 Dec 2017 16:20:55 +0000 (16:20 +0000)]
MFC r326100:

Always null-terminate CAM periph_name and dev_name

Reported by: Coverity
CID: 1010039101004010100411010043
Reviewed by: ken, imp
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D13194

6 years agoMFC r326040:
asomers [Wed, 13 Dec 2017 16:17:37 +0000 (16:17 +0000)]
MFC r326040:

Quirk Seagate ST8000AS0003-2HH

Like its predecessor ST8000AS0002, this is a drive-managed SMR drive, but
doesn't declare that in its ATA identify data.

Sponsored by: Spectra Logic Corp

6 years agoMFC r326629:
markj [Wed, 13 Dec 2017 15:20:11 +0000 (15:20 +0000)]
MFC r326629:
Use unique wait messages in the page daemon control loop.

6 years agoMFC r326361: Remove unused include.
delphij [Wed, 13 Dec 2017 06:17:20 +0000 (06:17 +0000)]
MFC r326361: Remove unused include.

6 years agoMFC r326282, r326317:
fsu [Tue, 12 Dec 2017 20:28:54 +0000 (20:28 +0000)]
MFC r326282, r326317:
Remap ENOATTR to ENODATA in the linuxulator.
In the linux ENOADATA is frequently #defined as ENOATTR.
The change is required for an xattrs support implementation.

Sync bsd_to_linux_errno[] table with i386 and amd64 tables in the sys directory.

Discussed with: netchild
Requested by: jhb
Approved by: pfg (mentor)

6 years agoMFC r326311:
kib [Tue, 12 Dec 2017 11:09:46 +0000 (11:09 +0000)]
MFC r326311:
Fix index calculation for the page table pages for efirt 1:1 map.

6 years agoMFC r326597: vnic: apply hardware L3 checksum only for IPv4
emaste [Tue, 12 Dec 2017 01:20:45 +0000 (01:20 +0000)]
MFC r326597: vnic: apply hardware L3 checksum only for IPv4

Previously we set the csum_l3 flag for IPv4 and IPv6, but only IPv4
should have header checksumming applied.

Prompted by Linux commit fa6d7cb5d76cf0467c61420fc9238045aedfd379.

Sponsored by: The FreeBSD Foundation

6 years agoMFC r326547: lld: make -v behave similarly to GNU ld.bfd
emaste [Tue, 12 Dec 2017 01:19:18 +0000 (01:19 +0000)]
MFC r326547: lld: make -v behave similarly to GNU ld.bfd

Previously, lld exited with an error status if the only option given to
the command was -v. GNU linkers gracefully exit in that case. This patch
makes lld behave like GNU.

Note that even with this patch, lld's -v and --version options behave
slightly differently than GNU linkers' counterparts. For example,
if you run ld.bfd -v -v, the version string is printed out twice.
But that is an edge case that I don't think we need to take care of.

Fixes https://bugs.llvm.org/show_bug.cgi?id=31582

Obtained from: LLVM r319717

6 years agoMFC r304443, r326034, r326065
asomers [Mon, 11 Dec 2017 20:47:26 +0000 (20:47 +0000)]
MFC r304443, r326034, r326065

r304443 by imp:
Improve the pattern matching so that internal *'s work, as well as
[set] notation. This fixes pattern matching for recently added drives
that would set the NCQ Trim being broken incorrectly.

PR: 210686
Tested-by: Tomoaki AOKI
r326034:
Fix multiple bugs in cam_strmatch

* Wrongly matches strings that are shorter than the pattern
* Fails to match negative character sets
* Fails to match character sets that aren't at the end of the pattern
* Fails to match character ranges

Reviewed by: imp
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D13173

r326065:
Fix uninitialized variable from 326034

Reported by: Coverity
CID: 1382887
X-MFC-With: 326034
Sponsored by: Spectra Logic Corp

6 years agoMFC r326041:
asomers [Mon, 11 Dec 2017 20:36:01 +0000 (20:36 +0000)]
MFC r326041:

periodic: fix exit status for nonexistent arguments

When called with an absolute pathname, periodic should attempt to execute
every script in that directory. If the directory does not exist, it should
print an error and exit 1. Due to a copy/paste mistake in r231568, it exits
0 in that case.

Reported by: devel/hs-ShellCheck
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D13070

6 years agoMFC r326039:
asomers [Mon, 11 Dec 2017 20:33:11 +0000 (20:33 +0000)]
MFC r326039:

Add ATF tests for head(1)

Submitted by: Fred Schlecter <https://github.com/fjs-github>
Reviewed by: asomers, jilles
Differential Revision: https://github.com/freebsd/freebsd/pull/127

6 years agoMFC r326036:
asomers [Mon, 11 Dec 2017 20:30:58 +0000 (20:30 +0000)]
MFC r326036:

da(4): Short-circuit unnecessary BIO_FLUSH commands

sys/cam/scsi/scsi_da.c
Complete BIO_FLUSH commands immediately if the da(4) device hasn't
been written to since the last flush. If we haven't written to the
device, there is no reason to send a flush.

Submitted by: gibbs
Reviewed by: imp
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D13106

6 years agoMFC r326032:
asomers [Mon, 11 Dec 2017 20:24:29 +0000 (20:24 +0000)]
MFC r326032:

Print ZAC device type in "camcontrol identify" output

ZAC (Zoned-device ATA Command set) is the standard for addressing SMR
(shingled magnetic recording) devices over SATA.  Drives indicate their
support for ZAC in their IDENTIFY block. Print whether and how a drive
supports ZAC in the output of "camcontrol identify".

Reviewed by: ken, imp
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D13171

6 years agoMFC r325959:
asomers [Mon, 11 Dec 2017 20:21:35 +0000 (20:21 +0000)]
MFC r325959:

Add assertion in probedone() that we're holding the device lock.

Submitted by: ken
Reviewed by: asomers
Sponsored by: Spectra Logic Corp

6 years agoMFC r326273: Make ctlstat -n option work reasonably for sparse LUN list.
mav [Mon, 11 Dec 2017 14:38:42 +0000 (14:38 +0000)]
MFC r326273: Make ctlstat -n option work reasonably for sparse LUN list.

6 years agoMFC r326510:
ae [Mon, 11 Dec 2017 12:38:50 +0000 (12:38 +0000)]
MFC r326510:
  Fix format string warning with enabled DEBUGGING.

6 years agoMFC r325723:
delphij [Mon, 11 Dec 2017 05:19:45 +0000 (05:19 +0000)]
MFC r325723:

find(1): Don't treat statfs() error as fatal in f_fstype, which can happen
when a directory is removed in the middle of find.

Instead of a full err(), allow find to continue, plus print a warning with
exitstatus set when appropriate.

Reported by: 100.chksetuid via gordon
Reviewed by: jilles

6 years agoMFC r326244:
delphij [Mon, 11 Dec 2017 05:06:28 +0000 (05:06 +0000)]
MFC r326244:

Don't assign rs as we will assign it later.

6 years agoMFC r326744:
bryanv [Sun, 10 Dec 2017 19:22:43 +0000 (19:22 +0000)]
MFC r326744:

Correctly report the vmxnet3 link down media status

6 years agoMFC r326670:
dim [Sun, 10 Dec 2017 14:49:06 +0000 (14:49 +0000)]
MFC r326670:

Remove an unused incude from lib/msun/bsdsrc/b_log.c.

Submitted by: Steve Kargl

6 years agoMFC r326669:
dim [Sun, 10 Dec 2017 13:58:37 +0000 (13:58 +0000)]
MFC r326669:

Remove the sentence in math(3) about some long double math functions not
being available.

Submitted by: Steve Kargl

6 years agoMFC r326655,326668: correct error handling for graid
eugen [Sun, 10 Dec 2017 13:44:58 +0000 (13:44 +0000)]
MFC r326655,326668: correct error handling for graid
SINGLE/CONCAT/RAID5 volumes.

Approved by:    mav (mentor)

6 years agoMFC r326228 and r326229:
ed [Sun, 10 Dec 2017 12:25:32 +0000 (12:25 +0000)]
MFC r326228 and r326229:

  Use TO_PTR() to convert integers to pointers.

  For FreeBSD/arm64's cloudabi32 support, I'm going to need a TO_PTR() in
  this place. Also use it for all of the other source files, so that the
  difference remains as minimal as possible.

6 years agoMFC r325044:
markj [Fri, 8 Dec 2017 20:04:10 +0000 (20:04 +0000)]
MFC r325044:
Fix a lock leak in g_mirror_destroy().

6 years agoAdd support for IPv6 based addresses as part of the TCP unify portspace feature
hselasky [Fri, 8 Dec 2017 19:19:47 +0000 (19:19 +0000)]
Add support for IPv6 based addresses as part of the TCP unify portspace feature
in ibcore. This resolves an interopability issue when using both iWarp(T6) and
RDMA(CX-4 and CX-5) devices at the same time.

The problem is IPv4 based sockets cannot be bound to an IPv6 based address
causing sobind() to fail preventing all use of IPv6 based addresses with RDMA
when an iWarp device is present.

This is a direct commit.

Tested by: KrishnamRaju ErapaRaju <Krishna2@chelsio.com>
Sponsored by: Mellanox Technologies

6 years agoMFC r326134:
markj [Fri, 8 Dec 2017 18:04:43 +0000 (18:04 +0000)]
MFC r326134:
Duplicate helpers after disabling inherited tracepoints during a fork.

6 years agoMFC r326371:
markj [Fri, 8 Dec 2017 17:16:35 +0000 (17:16 +0000)]
MFC r326371:
Verify the object/vnode association after vget() in vm_pageout_clean().

6 years agoMFC r326286:
markj [Fri, 8 Dec 2017 16:25:05 +0000 (16:25 +0000)]
MFC r326286:
Don't use pcpu_find() to determine if a CPU ID is valid.

6 years agoMFC r302794, r306744, r307691, r307692, r316174, r316681, r316859,
markj [Fri, 8 Dec 2017 16:12:45 +0000 (16:12 +0000)]
MFC r302794, r306744, r307691, r307692, r316174, r316681, r316859,
    r316866, r316867, r316869:
Various gmirror fixes and cleanups.

6 years agoMFC r326362:
hselasky [Fri, 8 Dec 2017 15:23:17 +0000 (15:23 +0000)]
MFC r326362:
Disallow TUN and TAP character device IOCTLs to modify the network device
type to any value. This can cause page faults and panics due to accessing
uninitialized fields in the "struct ifnet" which are specific to the network
device type.

Found by: jau@iki.fi
PR: 223767
Sponsored by: Mellanox Technologies

6 years agoMFC r326633:
bapt [Fri, 8 Dec 2017 10:49:53 +0000 (10:49 +0000)]
MFC r326633:

Update to 2017-12-06

6 years agoMFC r326527:
bapt [Fri, 8 Dec 2017 10:47:24 +0000 (10:47 +0000)]
MFC r326527:

Only skip looking for manpages if both man directory and cat directory
are not existing.

This allows man(1) to read catpages when no man directories are available at all

PR: 223559
Reported by: wosch

6 years agoMFC r326526:
bapt [Fri, 8 Dec 2017 10:42:05 +0000 (10:42 +0000)]
MFC r326526:

In case man(1) found a catpage to display skip looking ".so" which is manpage
only.

In case we are trying to read a catpage, the manpage variable is not defined.
It results in the "cattool" having no arguments.

In case the catpage is compressed, the cattool used is "zcat" which dies if the
standard input is a terminal, meaning the function calling it is exiting as if
there were no ".so"
In case the catpage is uncompressed, the cattool used is "zcat -f" which waits
reading standard input, making the man(1) command hang.

PR: 223560
Reported by: wosch

6 years agoMFC r326429:
kib [Fri, 8 Dec 2017 10:31:02 +0000 (10:31 +0000)]
MFC r326429:
Destroy seltd st_mtx and st_wait in seltdfini().

6 years agoMFC r326422:
ae [Fri, 8 Dec 2017 08:16:36 +0000 (08:16 +0000)]
MFC r326422:
  Do better cleaning in key_destroy() for VIMAGE case.

  SPDB was cleaned using TAILQ_CONCAT() instead of calling key_unlink()
  for each SP, thus we need to properly clean lists in each bucket of
  V_sphashtbl to avoid panic in hashdestroy() when INVARIANTS is enabled.

  Do the same for V_acqaddrhashtbl and V_acqseqhashtbl.

  When we are called in DEFAULT_VNET, destroy also all global locks and
  drain key_timer callout.

  Reported by: kp
  Tested by: kp

6 years agoMFC r326420:
ed [Fri, 8 Dec 2017 05:57:18 +0000 (05:57 +0000)]
MFC r326420:

  Add an mlink for cloudabi32(4).

  We already provide this for cloudabi64(4), so not adding it for
  cloudabi32(4) is fairly inconsistent.

6 years agoMFC r325947:
asomers [Fri, 8 Dec 2017 05:32:17 +0000 (05:32 +0000)]
MFC r325947:

Fix potential NULL pointer dereference of device physical path

In scsi_dev_advinfo(), if the physical path is being stored and there is a
malloc failure (malloc(9) is called with M_NOWAIT), we could wind up in a
situation where the device's physpath_len is set to the length the user
provided, but the physpath itself is NULL.

If another context then comes in to fetch the physical path value, we would
wind up trying to memcpy a NULL pointer into the caller's buffer.

So, set the physpath_len to 0 when we free the physpath on entry into the
store case for the physical path.  Reset the length to a non-zero value only
after we've successfully malloced a buffer to hold it.

Submitted by: ken
Reviewed by: asomers
Sponsored by: Spectra Logic Corp

6 years agoMFC r325946:
asomers [Fri, 8 Dec 2017 05:26:10 +0000 (05:26 +0000)]
MFC r325946:

VOP_LOOKUP.9: update locking info

The old description has been inaccurate since at least 243271, if not
before.

Submitted by: will
Reviewed by: kib
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D13108

6 years agoMFC r325857:
asomers [Fri, 8 Dec 2017 05:24:49 +0000 (05:24 +0000)]
MFC r325857:

Remove a double free(9) in xpt_bus_register

In xpt_bus_register(), remove superfluous call to free().  This was mostly
benign since free(9) checks for NULL before doing anything, and
xpt_create_path() is nice enough to NULL out the pointer on failure.
However, it could've segfaulted if malloc(9) failed during
xpt_create_path().

Submitted by: gibbs
Sponsored by: Spectra Logic Corp

6 years agoMFC r325817, r325827
asomers [Fri, 8 Dec 2017 05:20:54 +0000 (05:20 +0000)]
MFC r325817, r325827

r325817:
AIO tests: increase limits

tests/sys/aio/aio_kqueue_test.c
Instead of using a hard-coded queue depth, use
vfs.aio.max_aio_queue_per_proc

tests/sys/aio/lio_kqueue_test.c
The old, small limit on lio_listio's operation count was lifted by
change 324941.  Raise the operation count as high as possible without
exceeding the process's operation limit.

Sponsored by: Spectra Logic Corp

r325827:
Fix build on arm after r325817

Reported by: rpokala
X-MFC-With: 325817
Sponsored by: Spectra Logic Corp

6 years agoMFC r325812:
asomers [Fri, 8 Dec 2017 04:21:31 +0000 (04:21 +0000)]
MFC r325812:

devd.conf: add mps and mpr to the scsi controllers regex

Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D12744

6 years agoMFC: r326662
jkim [Thu, 7 Dec 2017 18:04:48 +0000 (18:04 +0000)]
MFC: r326662

Merge OpenSSL 1.0.2n.

6 years agoMFC r326094: Fix indentation in bsdinstall-created wpa_supplicant.conf
emaste [Thu, 7 Dec 2017 03:57:11 +0000 (03:57 +0000)]
MFC r326094: Fix indentation in bsdinstall-created wpa_supplicant.conf

r311690 (MFC of r309934) cleaned up some cases in bsdinstall to use
heredocs but broke the indentation of the generated output, because <<-
heredocs strip leading tabs.

PR: 221982

6 years agoMFC: r309361, r322710, r323286, r326378, r326383, r326407
jkim [Wed, 6 Dec 2017 21:39:01 +0000 (21:39 +0000)]
MFC: r309361, r322710, r323286, r326378, r326383, r326407

Sync. hwpstate with head.

r309361 (danfe):

- Mention mismatching numbers in MSR vs. ACPI _PSS count warning.
- Rephrase unsupported AMD CPUs message and wrap as an overly long line.
- Improve readability when reporting resulted P-state transition (debug).

r322710, r323286 (cem):

- Add support for family 17h pstate info from MSRs.
- Yield CPU awaiting frequency change.

r326378, r326383, r326407:

- Fix some style(9) nits.
- Add a tunable "debug.hwpstate_verify" to check P-state after changing it
and turn it off by default.

6 years agoMFC r326518, r326522
bapt [Wed, 6 Dec 2017 10:06:00 +0000 (10:06 +0000)]
MFC r326518, r326522

r326518:
Add Posix 2013 référence for manpages

PR: 223930
Reported by: Mateusz Piotrowski <mpp302@gmail.com>

r326522:
Properly name the 2013 edition

Reported by: ed

6 years agoMFC r325851:
bapt [Wed, 6 Dec 2017 10:01:02 +0000 (10:01 +0000)]
MFC r325851:

remove the poor emulation of the IllumOS needfree global variable to prevent
the ARC reclaim thread running longer than needed.

Update the arc::needfree dtrace probe triggered in arc_lowmem() to also report
the value we may want to free.

Submitted by: Nikita Kozlov <nikita.kozlov at blade-group.com>
Reviewed by: avg
Approved by: avg
Sponsored by: blade
Differential Revision: https://reviews.freebsd.org/D12163

6 years agoMFC r326343:
cy [Wed, 6 Dec 2017 00:00:37 +0000 (00:00 +0000)]
MFC r326343:

Fix fetching ntp leapfile after 325256

Submitted by: Ronald Klop <ronald-lists@klop.ws>
Original commit by:    asomers
MFC PR: 224126

6 years agoMFC r326052: Support SIGINFO.
delphij [Tue, 5 Dec 2017 06:43:58 +0000 (06:43 +0000)]
MFC r326052: Support SIGINFO.

Obtained from: NetBSD

6 years agoMFC r326288: Fix integer overflow in SLOG test.
mav [Tue, 5 Dec 2017 01:54:52 +0000 (01:54 +0000)]
MFC r326288: Fix integer overflow in SLOG test.

6 years agoMFC r326074: filter all passwords (not only changed) from periodic passwd backup
emaste [Tue, 5 Dec 2017 01:35:04 +0000 (01:35 +0000)]
MFC r326074: filter all passwords (not only changed) from periodic passwd backup

The periodic 200.backup-passwd script outputs any differences it finds
in master.passwd, relative to the previous backup.  It intends to elide
the encrypted password field, but previously did so only for changed
lines (i.e., those beginning with - or + in the diff).

Apply the sed expression also to unchanged lines to also elide their
passwords.

PR: 223461
Reported by: Andre Albsmeier
Sponsored by: The FreeBSD Foundation

6 years agoMFC r325295:
wulf [Mon, 4 Dec 2017 21:12:05 +0000 (21:12 +0000)]
MFC r325295:

evdev: Lock Giant around keyboard ioctls
This fixes turning ukbd(4) LEDs on/off with evdev interface as well

MFC r325296:

evdev: Take driver's lock in cdev write handler if necessary

MFC r325297:

sysmouse(4): Fix ums(4)-style T-axis reporting via evdev protocol

- Do not report T-axis wheel events as button presses
- Reverse T-axis to match Linux
- Remove wrong comment. T-axis buttons state should be checked by level not
    by edge to allow continuous wheel tilt reporting

MFC r325298:

evdev: Disable value normalization and state filtering for SND events.

Some events can take sound pitch as a value so can not be represented
as binary on/off events. Tracking for on/off state is left in place
as it is a part of the evdev API.

MFC r325299:

evdev: Do not start/stop softrepeat callout if no clients attached

Approved by: gonzo (mentor)

6 years agoMFC r325269:
wulf [Mon, 4 Dec 2017 20:22:26 +0000 (20:22 +0000)]
MFC r325269:

evdev: Translate KEY_102ND in evdev_scancode2key()

MFC r326020:

Fix evdev codes for slash and asterisk numpad keys of AT-keyboards

MFC r326021:

evdev: change USB scancode 0x54 from KEY_SLASH to KEY_KPSLASH

Submitted by: dumbbell (r325269, r326021)
Approved by: gonzo (mentor)

6 years agoMFC r325294:
wulf [Mon, 4 Dec 2017 20:09:38 +0000 (20:09 +0000)]
MFC r325294:

evdev: Hide "kern.evdev.rcpt_mask" sysctl if kernel is compiled
w/o EVDEV_SUPPORT as it's value has no meaning in this case.

MFC r326019:

evdev: Export EVDEV_SUPPORT kernel option through feature facility

Approved by: gonzo (mentor)

6 years agoMFC r326150: zdb: use a heap allocation instead of a huge array on stack
avg [Mon, 4 Dec 2017 16:47:19 +0000 (16:47 +0000)]
MFC r326150: zdb: use a heap allocation instead of a huge array on stack

6 years agoMFC r326315, r326330, r326331, r326412:
gjb [Mon, 4 Dec 2017 15:28:07 +0000 (15:28 +0000)]
MFC r326315, r326330, r326331, r326412:

 r326315:
  Set DISTDIR and WRKDIRPREFIX when building ports within the
  chroot(8) to avoid mtime changes within the ports checkout,
  which can cause checksum differences.

 r326330:
  Add a comment to release/release.conf.sample documenting
  EMBEDDEDPORTS. [1]

  Remove and update stale documentation from release(7) while here.

 r326331:
  Correct a comment.

 r326412:
  Fix port build flags passed to make(1) after r326315, where
  it was missed for embedded image builds.

PR: 206344 [1]
Sponsored by: The FreeBSD Foundation

6 years agoMFC r326175, r326176:
markj [Mon, 4 Dec 2017 15:22:06 +0000 (15:22 +0000)]
MFC r326175, r326176:
Lockstat fixes for sx locks.

6 years agoMFC r326177:
markj [Mon, 4 Dec 2017 15:20:39 +0000 (15:20 +0000)]
MFC r326177:
Fix the type signature for sx(9) DTrace subroutines.

6 years agoMFC r326178:
markj [Mon, 4 Dec 2017 15:19:50 +0000 (15:19 +0000)]
MFC r326178:
Don't redefine _KERNEL.

6 years agoMFC r326132:
markj [Mon, 4 Dec 2017 15:19:09 +0000 (15:19 +0000)]
MFC r326132:
Allow kern.geom.mirror.debug to be negative.

6 years agoMFC r326234, r326235, r326284:
markj [Mon, 4 Dec 2017 15:18:08 +0000 (15:18 +0000)]
MFC r326234, r326235, r326284:
vm_page_array initialization improvements.

6 years agoMFC r325897:
hselasky [Mon, 4 Dec 2017 09:53:03 +0000 (09:53 +0000)]
MFC r325897:
Improve the library dependencies helper script in src/tools.

Implement double pass of the relevant Makefiles. First make a list of
library names and directories and then scan for all the dependencies.
Spaces in directories in the source tree are not supported.

This avoids using hardcoded mappings between the library name
and the directory containing the library Makefile.

Add support for scanning contrib/ofed .

Bail out on any errors.

Sponsored by: Mellanox Technologies

6 years agoMFC r326058:
hselasky [Mon, 4 Dec 2017 09:51:08 +0000 (09:51 +0000)]
MFC r326058:
Make sure all initialized mutexes are destroyed in the iser module,
else WITNESS will panic. Prefix all mutex names with "iser_" to
prevent future WITNESS issues.

Sponsored by: Mellanox Technologies

6 years agoMFC r326424:
kib [Mon, 4 Dec 2017 09:47:42 +0000 (09:47 +0000)]
MFC r326424:
Add comment for vm_map_find_min().

6 years agoMFC r326161:
hselasky [Mon, 4 Dec 2017 09:41:57 +0000 (09:41 +0000)]
MFC r326161:
Implement atomic_fetchadd_64() for i386. This function is needed by the
atomic64 header file in the LinuxKPI for i386.

Reviewed by: kib
Sponsored by: Mellanox Technologies

6 years agoMFC r326392:
hselasky [Mon, 4 Dec 2017 09:26:12 +0000 (09:26 +0000)]
MFC r326392:
Properly define the VLAN_XXX() function macros to avoid miscompilation when
used inside "if" statements comparing with another value.

Detailed explanation:
"if (a ? b : c != 0)" is not the same like "if ((a ? b : c) != 0)"
which is the expected behaviour of a function macro.

Affects:
toecore, linuxkpi and ibcore.

Reviewed by: kib
Sponsored by: Mellanox Technologies

6 years agoMFC r324369
marcel [Sat, 2 Dec 2017 18:41:01 +0000 (18:41 +0000)]
MFC r324369
Fix alignment of 'last' in autofill.

6 years agoMFC r312450 (by emaste):
dim [Sat, 2 Dec 2017 18:00:01 +0000 (18:00 +0000)]
MFC r312450 (by emaste):

  Remove obsolete /usr/lib/debug/usr/lib/private dir

  Missed in r282420

  Reported by: dim

6 years agoMFC r324703: loader.mk: clean md.o even if MD_IMAGE_SIZE not defined
emaste [Fri, 1 Dec 2017 17:15:13 +0000 (17:15 +0000)]
MFC r324703: loader.mk: clean md.o even if MD_IMAGE_SIZE not defined

We don't normally provide special handling for optionally-included src
files, but md.o depends on both md.c and the value of ${MD_IMAGE_SIZE}.
Previously if one built with MD_IMAGE_SIZE, executed "make clean", and
then built with a different MD_IMAGE_SIZE md.o would not be rebuilt.

Reported by: Zakary Nafziger
Sponsored by: The FreeBSD Foundation

6 years agoMFC r326070: zfs_write: fix problem with writes appearing to succeed when over quota
avg [Fri, 1 Dec 2017 11:13:58 +0000 (11:13 +0000)]
MFC r326070: zfs_write: fix problem with writes appearing to succeed when over quota

The problem happens when the writes have offsets and sizes aligned with
a filesystem's recordsize (maximum block size).  In this scenario
dmu_tx_assign() would fail because of being over the quota, but the uio
would already be modified in the code path where we copy data from the
uio into a borrowed ARC buffer.  That makes an appearance of a partial
write, so zfs_write() would return success and the uio would be modified
consistently with writing a single block.

That bug can result in a data loss because the writes over the quota
would appear to succeed while the actual data is being discarded.

This commit fixes the bug by ensuring that the uio is not changed until
after all error checks are done.  To achieve that the code now uses
uiocopy() + uioskip() as in the original illumos design.  We can do that
now that uiocopy() has been updated in r326067 to use
vn_io_fault_uiomove().

6 years agoMFC r326067: make illumos uiocopy use vn_io_fault_uiomove
avg [Fri, 1 Dec 2017 11:06:51 +0000 (11:06 +0000)]
MFC r326067: make illumos uiocopy use vn_io_fault_uiomove

6 years agoMFC r320696: Allow ipsec to run in vnet jails
kp [Thu, 30 Nov 2017 21:38:09 +0000 (21:38 +0000)]
MFC r320696: Allow ipsec to run in vnet jails

ipsec is usable in vnet jails, so allow it to run there.

PR: 211364
Submitted by: Matthias Meyser <meyser xenet.de>

6 years agoMFC r325850: pfctl: teach route-to to deal with interfaces with multiple addresses
kp [Thu, 30 Nov 2017 21:21:22 +0000 (21:21 +0000)]
MFC r325850: pfctl: teach route-to to deal with interfaces with multiple addresses

The route_host parsing code set the interface name, but only for the first
node_host in the list. If that one happened to be the inet6 address and the
rule wanted an inet address it'd get removed by remove_invalid_hosts() later
on, and we'd have no interface name.

We must set the interface name for all node_host entries in the list, not just
the first one.

PR: 223208