]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
6 years agoMFC r324547:
mjg [Sun, 31 Dec 2017 03:17:28 +0000 (03:17 +0000)]
MFC r324547:

    xinstall: plug an infinite loop in directory creation

    If stat continues to fail with ENOENT and mkdir with EEXIST the code wont
    finish. In particular this can show up when the target path follows through
    a symlink to a non-existent directory.

6 years agoMFC r324127:
mjg [Sun, 31 Dec 2017 03:15:45 +0000 (03:15 +0000)]
MFC r324127:

    tmpfs: skip zero-sized page count updates

    Such updates consisted of vast majority of modificiations, especially
    in tmpfs_reg_resize.

    For the case where page count did no change and the size grew we only
    need to update tn_size. Use this fact to avoid vm object lock/relock.

6 years agoMFC r323234,r323305,r323306,r324044:
mjg [Sun, 31 Dec 2017 03:06:29 +0000 (03:06 +0000)]
MFC r323234,r323305,r323306,r324044:

    Start annotating global _padalign locks with __exclusive_cache_line

    While these locks are guarnteed to not share their respective cache lines,
    their current placement leaves unnecessary holes in lines which preceeded them.

    For instance the annotation of vm_page_queue_free_mtx allows 2 neighbour
    cachelines (previously separate by the lock) to be collapsed into 1.

    The annotation is only effective on architectures which have it implemented in
    their linker script (currently only amd64). Thus locks are not converted to
    their not-padaligned variants as to not affect the rest.

=============

    Annotate global process locks with __exclusive_cache_line

=============

    Annotate Giant with __exclusive_cache_line

=============

    Annotate sysctlmemlock with __exclusive_cache_line.

6 years agoMFC r321922:
mjg [Sun, 31 Dec 2017 02:48:16 +0000 (02:48 +0000)]
MFC r321922:
    amd64: annotate the syscall return address check with __predict_false

    before:
       0xffffffff80b03ebb <+2059>:      mov    0x460(%r14),%rax
       0xffffffff80b03ec2 <+2066>:      mov    0x98(%rax),%rax
       0xffffffff80b03ec9 <+2073>:      shr    $0x2f,%rax
       0xffffffff80b03ecd <+2077>:      je     0xffffffff80b03edd <amd64_syscall+2093>
       0xffffffff80b03ecf <+2079>:      mov    0x3f8(%r14),%rax
       0xffffffff80b03ed6 <+2086>:      orl    $0x1,0xc8(%rax)
       0xffffffff80b03edd <+2093>:      add    $0xf8,%rsp

    after:
       0xffffffff80b03ebb <+2059>:      mov    0x460(%r14),%rax
       0xffffffff80b03ec2 <+2066>:      mov    0x98(%rax),%rax
       0xffffffff80b03ec9 <+2073>:      shr    $0x2f,%rax
       0xffffffff80b03ecd <+2077>:      jne    0xffffffff80b03eef <amd64_syscall+2111>
       0xffffffff80b03ecf <+2079>:      add    $0xf8,%rsp

6 years agoIn stable/11, support for including config. files is broken and only the
roberto [Fri, 29 Dec 2017 16:48:14 +0000 (16:48 +0000)]
In stable/11, support for including config. files is broken and only the
last one is taken into account.

Code in 12-CURRENT s different and works so commit is in stable/11.

Patch by Alexander Zagrebin <alex@zagrebin.ru> in the PR.

PR: 220884
Relnotes: yes
Submitted by: Dan McGregor <dan.mcgregor@usask.ca>

6 years agoMFC r326876:
ae [Fri, 29 Dec 2017 10:47:24 +0000 (10:47 +0000)]
MFC r326876:
  Follow the RFC6980 and silently ignore following IPv6 NDP messages
  that had the IPv6 fragmentation header:
   o  Neighbor Solicitation
   o  Neighbor Advertisement
   o  Router Solicitation
   o  Router Advertisement
   o  Redirect

  Introduce M_FRAGMENTED mbuf flag, and set it after IPv6 fragment reassembly
  is completed. Then check the presence of this flag in correspondig ND6
  handling routines.

  PR: 224247

6 years agoMFC r327029:
ume [Wed, 27 Dec 2017 14:50:07 +0000 (14:50 +0000)]
MFC r327029:
Don't ignore trailing spaces after numerical IP addresses.

PR: 224403

6 years agoMFC r326613: Update tcpdump to 4.9.2
emaste [Wed, 27 Dec 2017 03:24:24 +0000 (03:24 +0000)]
MFC r326613: Update tcpdump to 4.9.2

It contains many fixes, including bounds checking, buffer overflows (in
SLIP and bittok2str_internal), buffer over-reads, and infinite loops.

One other notable change:
  Do not use getprotobynumber() for protocol name resolution.
  Do not do any protocol name resolution if -n is specified.

Relnotes: Yes
Security: CVE-2017-11108, CVE-2017-11541, CVE-2017-11542
Security: CVE-2017-11543, CVE-2017-12893, CVE-2017-12894
Security: CVE-2017-12895, CVE-2017-12896, CVE-2017-12897
Security: CVE-2017-12898, CVE-2017-12899, CVE-2017-12900
Security: CVE-2017-12901, CVE-2017-12902, CVE-2017-12985
Security: CVE-2017-12986, CVE-2017-12987, CVE-2017-12988
Security: CVE-2017-12989, CVE-2017-12990, CVE-2017-12991
Security: CVE-2017-12992, CVE-2017-12993, CVE-2017-12994
Security: CVE-2017-12995, CVE-2017-12996, CVE-2017-12997
Security: CVE-2017-12998, CVE-2017-12999, CVE-2017-13000
Security: CVE-2017-13001, CVE-2017-13002, CVE-2017-13003
Security: CVE-2017-13004, CVE-2017-13005, CVE-2017-13006
Security: CVE-2017-13007, CVE-2017-13008, CVE-2017-13009
Security: CVE-2017-13010, CVE-2017-13011, CVE-2017-13012
Security: CVE-2017-13013, CVE-2017-13014, CVE-2017-13015
Security: CVE-2017-13016, CVE-2017-13017, CVE-2017-13018
Security: CVE-2017-13019, CVE-2017-13020, CVE-2017-13021
Security: CVE-2017-13022, CVE-2017-13023, CVE-2017-13024
Security: CVE-2017-13025, CVE-2017-13026, CVE-2017-13027
Security: CVE-2017-13028, CVE-2017-13029, CVE-2017-13030
Security: CVE-2017-13031, CVE-2017-13032, CVE-2017-13033
Security: CVE-2017-13034, CVE-2017-13035, CVE-2017-13036
Security: CVE-2017-13037, CVE-2017-13038, CVE-2017-13039
Security: CVE-2017-13040, CVE-2017-13041, CVE-2017-13042
Security: CVE-2017-13043, CVE-2017-13044, CVE-2017-13045
Security: CVE-2017-13046, CVE-2017-13047, CVE-2017-13048
Security: CVE-2017-13049, CVE-2017-13050, CVE-2017-13051
Security: CVE-2017-13052, CVE-2017-13053, CVE-2017-13054
Security: CVE-2017-13055, CVE-2017-13687, CVE-2017-13688
Security: CVE-2017-13689, CVE-2017-13690, CVE-2017-13725

6 years agoMFC r317409 by glebius:
emaste [Wed, 27 Dec 2017 03:18:13 +0000 (03:18 +0000)]
MFC r317409 by glebius:

Cherry-pick 5d3c5151c2b885aab36627bafb8539238da27b2d, it fixes use after free
if tcpdump(1) is run on non-existent interface.

6 years agoMFC r326835: Reduce size of several on-stack string buffers.
mav [Wed, 27 Dec 2017 00:34:13 +0000 (00:34 +0000)]
MFC r326835: Reduce size of several on-stack string buffers.

Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com>

6 years agoMFC r327088:
kib [Tue, 26 Dec 2017 20:56:55 +0000 (20:56 +0000)]
MFC r327088:
Update HISTORY section for the atomic(9) page.

6 years agoMFC r326982
alc [Tue, 26 Dec 2017 20:33:45 +0000 (20:33 +0000)]
MFC r326982
  Document the semantics of atomic_thread_fence operations.

  Add atomic_load_<type> and atomic_store_<type>, and explain why they
  exist.

  Define the synchronizes-with relationship and its effects.

  Reorder and revise some of the existing text.  For example, more
  precisely describe when ordinary accesses are atomic.

6 years agoMFC r326480:
bryanv [Tue, 26 Dec 2017 17:12:16 +0000 (17:12 +0000)]
MFC r326480:

Add if media and link status events to vxlan

6 years agoMFC r326496:
dim [Tue, 26 Dec 2017 14:44:02 +0000 (14:44 +0000)]
MFC r326496:

Upgrade our copies of clang, llvm, lldb and libc++ to r319231 from the
upstream release_50 branch.  This corresponds to 5.0.1 rc2.

MFC r326831:

Pull in r315334 from upstream lld trunk (by Rafael Espindola):

  Don't create a dummy __tls_get_addr.

  We just don't need one with the current setup.

  We only error on undefined references that are used by some
  relocation.

  If we managed to relax all uses of __tls_get_addr, no relocation uses
  it and we don't produce an error.

  This is less code and fixes the case were we fail to relax. Before we
  would produce a broken output, but now we produce an error.

Pull in r320390 from upstream lld trunk (by Rafael Espindola):

  Create reserved symbols early so they can be versioned.

  This fixes pr35570.

  We were creating these symbols after parsing version scripts, so they
  could not be versioned.

  We cannot move the version script parsing later because we need it for
  lto.

  One option is to move both addReservedSymbols and
  createSyntheticSections earlier. The disadvantage is that some
  sections created by createSyntheticSections replace other input
  sections. For example, gdb index replaces .debug_gnu_pubnames, so it
  wants to run after gc sections so that it can set S->Live to false.

  What this patch does instead is to move just the ElfHeader creation
  early.

Pull in r320412 from upstream lld trunk (by Rafael Espindola):

  Handle symbols pointing to output sections.

  Now that gc sections runs after linker defined symbols are added it
  can see symbols that point to an OutputSection.

  Should fix a bot failure.

Pull in r320431 from upstream lld trunk (by Peter Collingbourne):

  ELF: Do not follow relocation edges to output sections during GC.

  This fixes an assertion error introduced by r320390.

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

Together these fix handling of reserved symbols, in particular _end,
which is needed to make brk(2) and sbrk(2) work correctly.  This
unbreaks the emacs ports on amd64, and also appears to unbreak most of
world on i386.

Differential Revision: https://reviews.freebsd.org/D13466

MFC r326879 (by emaste):

lld: Simplify a boolean expression by De Morgan's laws.

Cherry-pick lld r315653 by Rui Ueyama:
    I don't really understand what exactly this expression means,
    but at least I can mechanically transform it.

Obtained from: LLVM r315653

MFC r326897 (by emaste):

lld: Slightly simplify code and add comment.

Cherry-pick lld r315658 by Rui Ueyama:
    This is not a mechanical transformation. Even though I believe this
    patch is correct, I'm not 100% sure if lld with this patch behaves
    exactly the same way as before on all edge cases. At least all tests
    still pass.

    I'm submitting this patch because it took almost a day to understand
    this function, and I don't want to lose it.

This fixes jemalloc assertion failures observed at startup with i386
binaries and an lld-linked libc.so.

Reviewed by: dim
Obtained from: LLVM r315658
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D13503

MFC r326909:

Upgrade our copies of clang, llvm, lld, lldb, compiler-rt and libc++ to
5.0.1 release (upstream r320880).

Relnotes: yes

MFC r326957 (by emaste):

lld: Don't write preemptible symbol values to the .got.

It is not necessary and matches what bfd and gold do.

This was a regression from [LLVM] r315658.

Obtained from: LLVM r321023 by Rafael EspĂ­ndola

6 years agoMFC r324536 (by emaste):
dim [Tue, 26 Dec 2017 14:26:15 +0000 (14:26 +0000)]
MFC r324536 (by emaste):

libunwind: use upstream patch to disable executable stacks

arm uses '@' as a comment character, and cannot use @progbits in the
.section directive. Apply the upstream noexec stach change which avoids
this issue.

Obtained from: LLVM r277868

6 years agoMFC r326973:
kib [Tue, 26 Dec 2017 10:09:18 +0000 (10:09 +0000)]
MFC r326973:
Use atomic_load(9) to read ppsinfo sequence numbers.

6 years agoMFC r326971, r327047 (by ian), r327053 (by marius), r327074, r327097:
kib [Tue, 26 Dec 2017 10:07:17 +0000 (10:07 +0000)]
MFC r326971, r327047 (by ian), r327053 (by marius), r327074, r327097:
Add atomic_load(9) and atomic_store(9) operations.

6 years agoMFC r327118:
kib [Tue, 26 Dec 2017 09:57:15 +0000 (09:57 +0000)]
MFC r327118:
Add missed AVX512VL (128 and 256 bit vector length) extension
identification bit.

6 years agoMFC r326977:
kib [Tue, 26 Dec 2017 09:55:36 +0000 (09:55 +0000)]
MFC r326977:
mlx5en: Avoid SFENCe on x86.

6 years agoMFC r326791: Close the correct file descriptor.
delphij [Tue, 26 Dec 2017 08:32:02 +0000 (08:32 +0000)]
MFC r326791: Close the correct file descriptor.

6 years agoMFC r326401:
asomers [Tue, 26 Dec 2017 04:02:35 +0000 (04:02 +0000)]
MFC r326401:

Fix assertion when ZFS fails to open certain devices

"panic: vdev_geom_close_locked: cp->private is NULL"
This panic will result if ZFS fails to open a device due to either of the
following reasons:

1) The device's sector size is greater than 8KB.
2) ZFS wants to open the device RW, but it can't be opened for writing.

The solution is to change the initialization order to ensure that the
assertion will be satisfied.

PR: 221066
Reported by: David NewHamlet <wheelcomplex@gmail.com>
Reviewed by: avg
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D13278

6 years agoMFC r326290:
asomers [Tue, 26 Dec 2017 04:00:30 +0000 (04:00 +0000)]
MFC r326290:

diskinfo(8): Delete dead code in slog test

Reported by: Coverity
CID: 1377556
Reviewed by: mav
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D13275

6 years agoMFC r326289:
asomers [Tue, 26 Dec 2017 03:59:49 +0000 (03:59 +0000)]
MFC r326289:

Add basic tests for ctfconvert(1), fold(1) and rs(1)

Add basic command line parsing test coverage for these utilities.  The tests
were automatically generated based on their man pages.  These tests can be
expanded by hand for more thorough coverage.  The aim is to generate very
basic amount of test coverage for all the utilities in the base system.

Tests generated via: https://github.com/shivansh/smoketestsuite/

Submitted by: shivansh
Reviewed by: asomers
Differential Revision: https://reviews.freebsd.org/D12424

6 years agoMFC r326185: Set errno to EFTYPE instead of EINVAL to be more consistent
delphij [Mon, 25 Dec 2017 04:32:15 +0000 (04:32 +0000)]
MFC r326185: Set errno to EFTYPE instead of EINVAL to be more consistent
with the rest of code.

6 years agoMFC r326186: Slightly fix bidirectional stream number allocation.
mav [Mon, 25 Dec 2017 00:25:15 +0000 (00:25 +0000)]
MFC r326186: Slightly fix bidirectional stream number allocation.

This logic is still imperfect, since it allows at most 15 bidirectional
streams out of 30 allowed by specification, but at least now those should
work better.  On the other side I don't remember I ever saw controller
supporting the bidirectional streams, so this is likely a nop change.

6 years agoMFC r326898:
ae [Sun, 24 Dec 2017 02:05:19 +0000 (02:05 +0000)]
MFC r326898:
  Fix possible memory leak.

  vxlan_ftable entries are sorted in descending order, due to wrong arguments
  order it is possible to stop search before existing element will be found.
  Then new element will be allocated in vxlan_ftable_update_locked() and can
  be inserted in the list second time or trigger MPASS() assertion with
  enabled INVARIANTS.

  PR: 224371

6 years agoMFC r326872: fix expiration arithmetic after r326738 and MFC.
eugen [Fri, 22 Dec 2017 18:14:55 +0000 (18:14 +0000)]
MFC r326872: fix expiration arithmetic after r326738 and MFC.

Approved by: mav (mentor)

6 years agoMFC r326808, r326824:
fsu [Fri, 22 Dec 2017 17:19:08 +0000 (17:19 +0000)]
MFC r326808, r326824:
Move buffer size checks outside of the vnode locks.

Reviewed by:    kib, cem, pfg (mentor)
Approved by:    pfg (mentor)

Differential Revision:    https://reviews.freebsd.org/D13405

6 years agoMFC r326878:
markj [Fri, 22 Dec 2017 16:15:44 +0000 (16:15 +0000)]
MFC r326878:
Mark uctf/err.user64mode.ksh as EXFAIL for now.

6 years agoMFC r326877:
markj [Fri, 22 Dec 2017 16:15:00 +0000 (16:15 +0000)]
MFC r326877:
Skip gnop tests if the corresponding kernel module isn't available.

6 years agoMFC r326881, r326882:
markj [Fri, 22 Dec 2017 16:14:20 +0000 (16:14 +0000)]
MFC r326881, r326882:
Minor cleanup.

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