]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agoMFC r313653:
ngie [Tue, 21 Feb 2017 02:24:45 +0000 (02:24 +0000)]
MFC r313653:

Use SRCTOP instead of .CURDIR relative paths with ".."

This simplifies pathing in make/displayed output

7 years agoMFC r313656:
ngie [Tue, 21 Feb 2017 02:23:57 +0000 (02:23 +0000)]
MFC r313656:

Use SRCTOP to define .include with usr.bin/Makefile.inc

7 years agoMFC 312250
sephe [Tue, 21 Feb 2017 02:19:19 +0000 (02:19 +0000)]
MFC 312250

    alc: Add Killer E2500 support

    Reviewed by:    jhb, yongari
    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D9058

7 years agoMFC 311743
sephe [Tue, 21 Feb 2017 02:15:58 +0000 (02:15 +0000)]
MFC 311743

    hyperv: Add method to read 64bit Hyper-V specific time value.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D9057

7 years agoMFC 311475
sephe [Tue, 21 Feb 2017 02:10:02 +0000 (02:10 +0000)]
MFC 311475

    if: Defer the if_up until the ifnet.if_ioctl is called.

    This ensures the interface is initialized by the interface driver
    before it can be used by the rest of the system.

    Reviewed by:    jhb, karels, gnn
    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8905

7 years agoMFC 313895:
ken [Mon, 20 Feb 2017 20:12:02 +0000 (20:12 +0000)]
MFC 313895:

  ------------------------------------------------------------------------
  r313895 | ken | 2017-02-17 13:15:27 -0700 (Fri, 17 Feb 2017) | 9 lines

  Make ctl(4) build with CTL_IO_DELAY defined.

  sys/cam/ctl/ctl.c:
   In ctl_datamove(), inside CTL_IO_DELAY, add a lun variable and fill
   it in before trying to dereference it.

  Sponsored by: Spectra Logic

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

7 years agoMFC r313693:
kib [Mon, 20 Feb 2017 10:49:04 +0000 (10:49 +0000)]
MFC r313693:
Remove MPSAFE and ARGUSED annotations, ANSI-fy syscall handlers.

7 years agoMFC r313345:
kib [Mon, 20 Feb 2017 10:44:24 +0000 (10:44 +0000)]
MFC r313345:
Update arm and arm64 counters MD bits.

MFC r313394 (by manu):
subr_sfbus.c need sys/proc.h for struct thread definition.

7 years agoMFC r312997, r313002:
pfg [Mon, 20 Feb 2017 03:33:59 +0000 (03:33 +0000)]
MFC r312997, r313002:
Re-import libedit 2016-02-27 and update libedit with changes from NetBSD's
2016-03-21.

Obtained from: NetBSD

7 years agoMFC r312992:
pfg [Mon, 20 Feb 2017 03:26:19 +0000 (03:26 +0000)]
MFC r312992:
MFV r312970, 313160:
openresolv: update to version 3.9.0.

It is now possible to drop the _WITH_ARG vars thanks to a change to the
pdns_recursor upstreamed by Guy Yur.

7 years agoMFC r313819:
pfg [Sun, 19 Feb 2017 21:08:10 +0000 (21:08 +0000)]
MFC r313819:
Remove outdated claim.

Despite wishful thinking the removal of these old functions hasn't
happened yet.

7 years agoMFC r313867, r313869-r313870
bapt [Sun, 19 Feb 2017 17:35:14 +0000 (17:35 +0000)]
MFC r313867, r313869-r313870

r313867:
Add history and Authors section in the manpage

Submitted by: dteske
MFC after: 2 days
Differential Revision: https://reviews.freebsd.org/D9419

r313869:
Also add vsevolod@ in the authors

r313870:
Use full name for the month

Reported by: brueffer

7 years agoMFC r313797:
kib [Sun, 19 Feb 2017 03:11:14 +0000 (03:11 +0000)]
MFC r313797:
Minor style fixes.

7 years agoMFC r313572,313782
mm [Sat, 18 Feb 2017 21:58:56 +0000 (21:58 +0000)]
MFC r313572,313782
Sync libarchive with vendor.

MFC r313572:
  Vendor bugfixes:
    cpio reader sanity fix (OSS-Fuzz 504)
    WARC reader sanity fixes (OSS-Fuzz 511, 526, 532, 552)
    mtree reader time parsing fix (OSS-Fuzz 538)
    XAR reader memleak fix (OSS-Fuzz 551)

MFC r313782:
  Vendor changes:
    Make SCHILY.acl.ace header more compact (NFSv4 ACLs)

  Vendor bugfixes:
    zip reader integer parsing fix (OSS-Fuzz 556)
    spelling fixes (issue #863)

7 years agoMFC r313694:
avos [Sat, 18 Feb 2017 19:19:08 +0000 (19:19 +0000)]
MFC r313694:
iwi: add 12-14 2GHz channels into channel list.

Return full channel list via iwi_getradiocaps() method
(ieee80211_init_channels() was replaced with iwi_getradiocaps()
to be consistent with other drivers).

PR: 216923
Submitted and tested by: ds@ukrhub.net (original patch)

7 years agoMFC r313659-r313673
bapt [Fri, 17 Feb 2017 11:20:55 +0000 (11:20 +0000)]
MFC r313659-r313673

r313659:
Remove space at and of line

Reported by: make manlint
MFC after: 2 days

r313660:
Remove empty Li

Reported by: make manlint
MFC after: 2 days

r313661:
Escape Ss to avoid confusion by mdoc parser with the Ss macro

Reported by: make manlint
MFC after: 2 days

r313662:
Add missing -width after -Bl -tag

Reported by: make manlint
MFC after: 2 days

r313663:
Add missing section after .Xr reference

r313664:
Escape No to avoid confusion with the No macro

r313665:
Remove useless .Pp after the .Sh macro and remove empty line

r313666:
Remove empty space at EOL and escept Ed

r313667:
Remove spaces at EOL and sort correctly the SEE ALSO section

r313668:
Add missing section in manpage reference

r313669:
Properly use .An macro before Authors name

r313670:
Escape Sm to avoid confusion with Sm macro

r313671:
Use correct date format

r313672:
Remove useless Li macro

r313673:
Remove spaces at end of line

Reported by: make manlint

7 years agoMFC r312952:
jah [Fri, 17 Feb 2017 07:08:37 +0000 (07:08 +0000)]
MFC r312952:

Implement get_pcpu() for i386 and use it to replace pcpu_find(curcpu)
in the i386 pmap.

The curcpu macro loads the per-cpu data pointer as its first step,
so the remaining steps of pcpu_find(curcpu) are circular.

7 years agoMFC r313133:
markj [Fri, 17 Feb 2017 00:50:00 +0000 (00:50 +0000)]
MFC r313133:
Sync the x86 dis_tables.c with upstream.

7 years agoMFC r313563: kldxref: bump MAXSEGS to 3
emaste [Fri, 17 Feb 2017 00:46:16 +0000 (00:46 +0000)]
MFC r313563: kldxref: bump MAXSEGS to 3

ld.bfd generates two PT_LOAD segments, but certain linkers or linker
configurations generate three PT_LOAD segments (one additional for
RELRO).

PR: 216975

7 years agoMFC r313562: kldxref: s/sections/segments/ in warning message
emaste [Fri, 17 Feb 2017 00:44:48 +0000 (00:44 +0000)]
MFC r313562: kldxref: s/sections/segments/ in warning message

The message refers to program header segments, not sections.

PR: 216975

7 years agoMFC r313715:
kib [Fri, 17 Feb 2017 00:36:12 +0000 (00:36 +0000)]
MFC r313715:
Order alphabetically.

7 years agoMFC r311702
grehan [Thu, 16 Feb 2017 17:07:20 +0000 (17:07 +0000)]
MFC r311702
  Use correct PCI device id for virtio-rng.
  This prevented the device from attaching with a
  Windows guest (most other guests use the device type
  for matching)

  PR:   212711

7 years agoMFC r313477:
garga [Thu, 16 Feb 2017 09:12:36 +0000 (09:12 +0000)]
MFC r313477:

Cleanup on usr.sbin/arp/arp.c

* 'blackhole' and 'reject' are mutually exclusive, replace printf() by errx()
  when both are selected.
* 'trail' option is no longer supported since first import of arp from 4.4BSD.
  XXX message was added 13 years ago in r128192. I believe it's time to remove
  it.
* Use warnx() to print some informative messages instead of printf()
* Replace strncmp() by strcmp() when validating parameters and exit when invalid
  parameter is found

Reviewed by: allanjude, vangyzen, cem
Approved by: allanjude
MFC after: 1 week
Sponsored by: Rubicon Communications (Netgate)
Differential Revision: https://reviews.freebsd.org/D9504

7 years agoMFC r311285,312335: zlib 1.2.11.
delphij [Thu, 16 Feb 2017 06:16:23 +0000 (06:16 +0000)]
MFC r311285,312335: zlib 1.2.11.

7 years agoMFC r313692:
kib [Thu, 16 Feb 2017 05:57:58 +0000 (05:57 +0000)]
MFC r313692:
Style: wrap long line.

7 years agoMFC r313162: Replace Cyrillic characters with Latin (normal) ones.
wblock [Wed, 15 Feb 2017 16:55:24 +0000 (16:55 +0000)]
MFC r313162: Replace Cyrillic characters with Latin (normal) ones.

7 years agoMFC r313458: lld: Allow arbitrary code alignment in .eh_frame
emaste [Wed, 15 Feb 2017 15:18:43 +0000 (15:18 +0000)]
MFC r313458: lld: Allow arbitrary code alignment in .eh_frame

According to the specification, CIE code alignment factor is an
arbitrary unsigned LEB128 encoded value.

PR: 216908

7 years agoMFC r312610, r312792
jah [Wed, 15 Feb 2017 10:35:46 +0000 (10:35 +0000)]
MFC r312610, r312792

r312610:
 Like r310481 for i386, move the objects used to create temporary
 mappings for armv6 pmap zero and copy operations to the MD PCPU region.
 Change sysmap initialization to only allocate KVA pages for CPUs that
 are actually present.

 While here, collapse CMAP3 into CMAP2 (their use was mutually exclusive
 anyway) and "recover" some space in PCPU padding that has always been
 available due to 64-byte cacheline padding.

r312792:
 Further cleanup of per-CPU armv6 pmap data:

 - Replace pcpu_find(curcpu) with get_pcpu(), which is much more direct.

 - Remove armv4 pcpu fields which I added in r286296 but never needed
   to use.

 - armv6 pc_qmap_addr was leftover from the old armv6 pmap
   implementation.  Rename it and put it to use in the new one.

7 years agoMFC r313457:
garga [Wed, 15 Feb 2017 08:49:28 +0000 (08:49 +0000)]
MFC r313457:

Fix style(9)

Reviewed by: vangyzen, allanjude, cem
Approved by: allanjude
MFC after: 1 week
Sponsored by: Rubicon Communications (Netgate)
Differential Revision: https://reviews.freebsd.org/D9494

7 years agoMFC r313448:
garga [Wed, 15 Feb 2017 08:43:26 +0000 (08:43 +0000)]
MFC r313448:

bsdinstall: Make sure chroot filesystems are umounted after use

* DISTDIR_IS_UNIONFS is set every time BSDINSTALL_DISTDIR is mounted inside
  BSDINSTALL_CHROOT. Use this flag to decide if it needs to be umounted
* BSDINSTALL_CHROOT/dev is mounted when 'bsdinstall mount' is called, there is
  no need to mount it again when user goes to shell after installation

Reviewed by: allanjude
Obtained from: pfSense
MFC after: 1 week
Sponsored by: Rubicon Communications (Netgate)
Differential Revision: https://reviews.freebsd.org/D8573

7 years agoMFC r311893, r313008, r313081
asomers [Wed, 15 Feb 2017 00:15:24 +0000 (00:15 +0000)]
MFC r311893, r313008, r313081

r311893:
ATFify the geom gate tests.

This ensures their cleanup routines will be run even if they should timeout.

tests/sys/geom/class/gate/ggate_test.sh
tests/sys/geom/class/gate/Makefile
Add an ATF test with three testcases, one for each TAP test. Use
ATF-style cleanup functions, and convert sleeps to polling loops.

ObsoleteFiles.inc
tests/sys/geom/class/gate/conf.sh
tests/sys/geom/class/gate/1_test.sh
tests/sys/geom/class/gate/2_test.sh
tests/sys/geom/class/gate/3_test.sh
Delete TAP test files

Reviewed by: ngie
MFC after: 4 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D8891

r313008:
Wait for /dev/ggate* to appear after calling `ggatel create` in :ggatel_{file,md}

The test assumed that `ggatel create` created a device on completion, but that's
incorrect. This squashes the race by waiting for the device to appear, as
`ggatel create` daemonizes before issuing an ioctl to geom_gate(4) if not called
with `-v`.

Discussed with: asomers
MFC after: 1 week
PR: 204616
Sponsored by: Dell EMC Isilon

r313081:
Replace for/retry loops with "wait_for_ggate_device" calls and check
results of commands

As noted in r313008, the underlying issue was that geom_gate device
creation wasn't created at ggatel command completion, but some short
time after. ggatec(8) employs similar logic when creating geom_gate(4)
devices.

Switch from retry loops (after the ggatec/dd write calls) to
wait_for_ggate_device function calls after calling ggatec(8) instead
to detect the presence of the /dev/ggate* device, as this function is
sufficient for determining whether or not the character device is ready
for testing

While here, use atf_check consistently with all dd calls to ensure that
data output is as expected.

MFC after: 1 week
Reviewed by: asomers
Differential Revision: D9409
Sponsored by: Dell EMC Isilon

7 years agoMFC r311349, r311445
asomers [Tue, 14 Feb 2017 21:02:17 +0000 (21:02 +0000)]
MFC r311349, r311445

r311349:
tabs -> spaces in etc/mtree

MFC after: 4 weeks

r311445:
Fix typo from r311349

Reported by: lwhsu
Pointy-hat-to: asomers
MFC after: 4 weeks
X-MFC-with: 311349

7 years agoMFC r312991: put very expensive sanity checks of advisory locks under DIAGNOSTIC
avg [Tue, 14 Feb 2017 13:45:20 +0000 (13:45 +0000)]
MFC r312991: put very expensive sanity checks of advisory locks under DIAGNOSTIC

Sponsored by: Panzura

7 years agoMFC r313356:
ngie [Tue, 14 Feb 2017 04:52:16 +0000 (04:52 +0000)]
MFC r313356:

Fix typos in comments (returing -> returning)

7 years agoMFC r313374:
ngie [Tue, 14 Feb 2017 04:51:21 +0000 (04:51 +0000)]
MFC r313374:

hcreate(3): fix the ERRORS section and bump .Dd

- Add missing comma between functions that trigger ENOMEM error.
- Fix the description for ESRCH. The action that triggers this error is
  FIND, not SEARCH (SEARCH does not exist).

7 years agoMFC r313378,r313379:
ngie [Tue, 14 Feb 2017 04:49:06 +0000 (04:49 +0000)]
MFC r313378,r313379:

r313378:

Wrap strcmp/wcscmp calls with ATF_CHECK_MSG and drop atf_tc_fail use

The reasoning here was the same as what was done in r313376:
- Gather as many results as possible instead of failing early and
  not testing the rest of the cases.
- Simplify logic when checking test inputs vs outputs and printing
  test result.

r313379:

Expect :int_within_limits to fail when ptrdiff_t/*intmax_t differ in base type

The %t{d,u} (ptrdiff_t) tests fail for the following reasons:
- ptrdiff_t is by definition int32_t on !LP64 architectures and int64_t on
  LP64 architectures.
- intmax_t is by definition fixed to int64_t on all architectures.
- Some of the code in lib/libc/stdio/... is promoting ptrdiff_t to *intmax_t
  when parsing/representing the value.

PR: 191674

7 years agoMFC r313376:
ngie [Tue, 14 Feb 2017 04:47:13 +0000 (04:47 +0000)]
MFC r313376:

Fix :hexadecimal_floating_point on i386

Don't exclude i386 from LDBL_MANT_DIG == 64; it works properly in
that case.

While here, replace strcmp + atf_tc_fail with ATF_CHECK_MSG for 2
reasons:
- Gather as many results as possible instead of failing early and
  not testing the rest of the cases.
- Simplify logic when checking test inputs vs outputs and printing
  test result.

Tested on: amd64, i386

7 years agoMFC r313377:
ngie [Tue, 14 Feb 2017 04:43:03 +0000 (04:43 +0000)]
MFC r313377:

Expect :floatunditf to fail on FreeBSD/i386

The precision error on FreeBSD/i386 doesn't match the expected output in
long double form.

7 years agoMFC r313358,r313360:
ngie [Tue, 14 Feb 2017 04:38:39 +0000 (04:38 +0000)]
MFC r313358,r313360:

r313358:

Sort sys/ #includes and zap an unnecessary trailing space nearby

r313360:

Sort sys/ #includes some more

7 years agoMFC r313052:
dim [Mon, 13 Feb 2017 18:39:21 +0000 (18:39 +0000)]
MFC r313052:

Pull in r293536 from upstream compiler-rt trunk:

  Recommit: Stop intercepting some malloc-related functions on FreeBSD
  and macOS

  Summary:
  In https://bugs.freebsd.org/215125 I was notified that some configure
  scripts attempt to test for the Linux-specific `mallinfo` and
  `mallopt` functions by compiling and linking small programs which
  references the functions, and observing whether that results in
  errors.

  FreeBSD and macOS do not have the `mallinfo` and `mallopt` functions,
  so normally these tests would fail, but when sanitizers are enabled,
  they incorrectly succeed, because the sanitizers define interceptors
  for these functions.  This also applies to some other malloc-related
  functions, such as `memalign`, `pvalloc` and `cfree`.

  Fix this by not intercepting `mallinfo`, `mallopt`, `memalign`,
  `pvalloc` and `cfree` for FreeBSD and macOS, in all sanitizers.

  Also delete the non-functional `cfree` wrapper for Windows, to fix the
  test cases on that platform.

  Reviewers: emaste, kcc, rnk

  Subscribers: timurrrr, eugenis, hans, joerg, llvm-commits, kubamracek

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

This prevents autoconf scripts from incorrectly detecting that functions
like mallinfo, mallopt, memalign, pvalloc and cfree are supported.

PR: 215125, 215455

7 years agoMFC r313568:
ken [Mon, 13 Feb 2017 16:06:38 +0000 (16:06 +0000)]
MFC r313568:

  ------------------------------------------------------------------------
  r313568 | ken | 2017-02-10 15:02:45 -0700 (Fri, 10 Feb 2017) | 68 lines

  Change the isp(4) driver to not adjust the tag type for REQUEST SENSE.

  The isp(4) driver was changing the tag type for REQUEST SENSE
  commands to Head of Queue, when the CAM CCB flag
  CAM_TAG_ACTION_VALID was NOT set.  CAM_TAG_ACTION_VALID is set
  when the tag action in the XPT_SCSI_IO is not CAM_TAG_ACTION_NONE
  and when the target has tagged queueing turned on.

  In most cases when CAM_TAG_ACTION_VALID is not set, it is because
  the target is not doing tagged queueing.  In those cases, trying to
  send a Head of Queue tag may cause problems.  Instead, default to
  sending a simple tag.

  IBM tape drives claim to support tagged queueing in their standard
  Inquiry data, but have the DQue bit set in the control mode page
  (mode page 10).  CAM correctly detects that these drives do not
  support tagged queueing, and clears the CAM_TAG_ACTION_VALID flag
  on CCBs sent down to the drives.

  This caused the isp(4) driver to go down the path of setting the
  tag action to a default value, and for Request Sense commands only,
  set the tag action to Head of Queue.

  If an IBM tape drive does get a Head of Queue tag, it rejects it with
  Invalid Message Error (0x49,0x00).  (The Qlogic firmware translates that
  to a Transport Error, which the driver translates to an Unrecoverable
  HBA Error, or CAM_UNREC_HBA_ERROR.) So, by default, it wasn't possible
  to get a good response from a REQUEST SENSE to an FC-attached IBM
  tape drive with the isp(4) driver.

  IBM tape drives (tested on an LTO-5 with G9N1 firmware and a TS1150
  with 4470 firmware) also have a bug in that sending a command with a
  non-simple tag attribute breaks the tape drive's Command Reference
  Number (CRN) accounting and causes it to ignore all subsequent
  commands because it and the initiator disagree about the next
  expected CRN.  The drives do reject the initial command with a head
  of queue tag with an Invalid Message Error (0x49,0x00), but after that
  they ignore any subsequent commands.  IBM confirmed that it is a bug,
  and sent me test firmware that fixes the bug.  However tape drives in
  the field will still exhibit the bug until they are upgraded.

  Request Sense is not often sent to targets because most errors are
  reported automatically through autosense in Fibre Channel and other
  modern transports.  ("Modern" meaning post SCSI-2.)  So this is not
  an error that would crop up frequently.  But Request Sense is useful on
  tape devices to report status information, aside from error reporting.

  This problem is less serious without FC-Tape features turned on,
  specifically precise delivery of commands (which enables Command
  Reference Numbers), enabled on the target and initiator.  Without
  FC-Tape features turned on, the target would return an error and
  things would continue on.

  And it also does not cause problems for targets that do tagged
  queueing, because in those cases the isp(4) driver just uses the
  tag type that is specified in the CCB, assuming the
  CAM_TAG_ACTION_VALID flag is set, and defaults to sending a Simple
  tag action if it isn't an ordered or head of queue tag.

  sys/dev/isp/isp.c:
   In isp_start(), don't try to send Request Sense commands
   with the Head of Queue tag attribute if the CCB doesn't
   have a valid tag action.  The tag action likely isn't valid
   because the target doesn't support tagged queueing.

  Sponsored by: Spectra Logic

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

7 years agoMFC r313185:
ae [Mon, 13 Feb 2017 12:07:08 +0000 (12:07 +0000)]
MFC r313185:
  Check that primary GPT header is valid before wiping partitioning.

  This allows safely destroy corrupted GPT when primary header was
  rewritten by some data, that do not want to destroy.

7 years agoMFC r313273:
ngie [Sun, 12 Feb 2017 09:27:27 +0000 (09:27 +0000)]
MFC r313273:

style(9) cleanup

- Delete trailing whitespace
- Fix alignment/variable sorting
- Delete single-line enclosing braces

7 years agoMFC r312008:
ngie [Sun, 12 Feb 2017 09:24:18 +0000 (09:24 +0000)]
MFC r312008:

Upgrade NetBSD tests to 01.11.2017_23.20 snapshot

This contains some new testcases in /usr/tests/...:

- .../lib/libc
- .../lib/libthr
- .../lib/msun
- .../sys/kern

Tested on: amd64, i386

7 years agoMFC r311850:
ian [Sat, 11 Feb 2017 20:02:39 +0000 (20:02 +0000)]
MFC r311850:

  Use the post-reset hook to force the controller to host mode.  This will
  make both usb ports work on imx6 systems (the OTG port of course will only
  work in host mode).

7 years agoMFC r313194:
kib [Sat, 11 Feb 2017 02:00:56 +0000 (02:00 +0000)]
MFC r313194:
Define the vm_ooffset_t and vm_pindex_t types as machine-independend.

7 years agoMFC r310866,310868,310870,311903,313074:
mm [Sat, 11 Feb 2017 00:54:16 +0000 (00:54 +0000)]
MFC r310866,310868,310870,311903,313074:
Sync libarchive with vendor.

MFC r310866:
  PR #771: Add NFSv4 ACL support to pax and restricted pax

  NFSv4 ACL information may now be stored to and restored from tar archives.
  ACL must be non-trivial and supported by the underlying filesystem, e.g.
  natively by ZFS or by UFS with the NFSv4 ACL enable flag set.

MFC r310868:
  PR #843: Fix memory leak of struct archive_entry in cpio/cpio.c
  PR #851: Spelling fixes
  Fix two protoypes in manual page archive_read_disk.3

MFC r310870:
  Use __LA_DEPRECATED macro with functions deprecated in 379867e

MFC r311903:
  #691: Support for SCHILY.xattr extended attributes
  #854: Spelling fixes

  Multiple fixes in ACL code:
  - prefer acl_set_fd_np() to acl_set_fd()
  - if acl_set_fd_np() fails, do no fallback to acl_set_file()
  - do not warn if trying to write ACLs to a filesystem without ACL support
  - fix id handling in archive_acl_(from_to)_text*() for NFSv4 ACLs

MFC r313074:
  - support extracting NFSv4 ACLs from Solaris tar archives
  - bugfixes and optimizations in the ACL code
  - multiple fixes in the test suite
  - typo and other small bugfixes

  Security fixes:
  - cab reader: endless loop when parsing MSZIP signature (OSS-Fuzz 335)
  - LHA reader: heap-buffer-overflow in lha_read_file_header_1()
    (CVE-2017-5601)
  - LZ4 reader: null-pointer dereference in lz4_filter_read_legacy_stream()
    (OSS-Fuzz 453)
  - mtree reader: heap-buffer-overflow in detect_form() (OSS-Fuzz 421, 443)
  - WARC reader: heap-buffer-overflow in xstrpisotime() (OSS-Fuzz 382, 458)

  Memory leak fixes:
  - ACL support: free memory allocated by acl_get_qualifier()
  - disk writer: missing free in create_filesystem_object()
  - file reader: fd leak (Coverity 1016755)
  - gnutar writer: fix free in archive_write_gnutar_header()
    (Coverity 101675)
  - iso 9660 reader: missing free in parse_file_info()
    (partial Coverity 1016754)
  - program reader: missing free in __archive_read_program()
  - program writer: missing free in __archive_write_program_free()
  - xar reader: missing free in xar_cleanup()
  - xar reader: missing frees in expat_xmlattr_setup()
    (Coverity 1229979-1229981)
  - xar writer: missing free in file_free()
  - zip reader: missing free in zip_read_local_file_header()

List of all libarchive issues at OSS-Fuzz:
https://bugs.chromium.org/p/oss-fuzz/issues/list?can=1&q=libarchive

Security: CVE-2017-5601

7 years agoMFC 311568,311584,312387:
jhb [Fri, 10 Feb 2017 19:49:42 +0000 (19:49 +0000)]
MFC 311568,311584,312387:
Set MORETOCOME for AIO write requests on a socket.

311568:
Set MORETOCOME for AIO write requests on a socket.

Add a MSG_MOREOTOCOME message flag.  When this flag is set, sosend*
set PRUS_MOREOTOCOME when invoking the protocol send method.  The aio
worker tasks for sending on a socket set this flag when there are
additional write jobs waiting on the socket buffer.

311584:
Unbreak lib/libsysdecode after r311568 by decoding MSG_MORETOCOME flag
in msgflags

(Actually, this change excludes MSG_MORETOCOME from being decoded)

312387:
Fix regression from r311568: collision of MSG_NOSIGNAL with MSG_MORETOCOME
lead to delayed send of data sent with sendto(MSG_NOSIGNAL).

Sponsored by: Chelsio Communications

7 years agoMFC r313174: Clean up documentation of AF_UNIX control messages.
jilles [Fri, 10 Feb 2017 15:03:54 +0000 (15:03 +0000)]
MFC r313174: Clean up documentation of AF_UNIX control messages.

Document AF_UNIX control messages in unix(4) only, not split between unix(4)
and recv(2).

Also, warn about LOCAL_CREDS effective uid/gid fields, since the write could
be from a setuid or setgid program (with the explicit SCM_CREDS and
LOCAL_PEERCRED, the credentials are read at such a time that it can be
assumed that the process intends for them to be used in this context).

7 years agoMFC r308312: vidcontrol: improve error handling in vt(4) font loading
emaste [Fri, 10 Feb 2017 14:58:24 +0000 (14:58 +0000)]
MFC r308312: vidcontrol: improve error handling in vt(4) font loading

PR: 209078

7 years agoMFC r304430: vt: fix old keyboard release in CONS_SETKBD
emaste [Fri, 10 Feb 2017 14:54:20 +0000 (14:54 +0000)]
MFC r304430: vt: fix old keyboard release in CONS_SETKBD

On the first switch we previously released the newly allocated keyboard
instead of the old one. Keyboard state was very confused afterwards for
further keyboard switches.

Submitted by: bde

7 years agoMFC r312520:
ngie [Fri, 10 Feb 2017 07:59:41 +0000 (07:59 +0000)]
MFC r312520:

Integrate contrib/netbsd-tests/usr.bin/sed/t_sed.sh into the FreeBSD test
suite as usr.bin/sed/sed_test

Don't expect :emptybackref to fail -- it succeeds on FreeBSD

7 years agoMFC r312514:
ngie [Fri, 10 Feb 2017 07:58:45 +0000 (07:58 +0000)]
MFC r312514:

Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones

This simplifies pathing in make/displayed output

7 years agoMFC r312513:
ngie [Fri, 10 Feb 2017 07:57:14 +0000 (07:57 +0000)]
MFC r312513:

Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones

This simplifies pathing in make/displayed output

7 years agoMFC r312523:
ngie [Fri, 10 Feb 2017 07:55:39 +0000 (07:55 +0000)]
MFC r312523:

Add some basic -s flag testcases for cut(1)

The remaining functionality seems to be covered in one form or
another via the NetBSD ATF testcase.

7 years agoMFC r312418,r312422:
ngie [Fri, 10 Feb 2017 07:38:39 +0000 (07:38 +0000)]
MFC r312418,r312422:

r312418:

Conditionalize hyperv support in gettimeofday(2) based on MK_HYPERV

The effect at runtime is negligible as the hyperv timer isn't available
except when hyperv is loaded.

This is a prerequisite for conditionalizing the header build/install out
of the build

r312422:

Only conditionally add in hyperv support if we're building amd64

This unbreaks the build because the assembly is written for x64.

Pointyhat to: ngie

7 years agoMFC r312452-r312512:
ngie [Fri, 10 Feb 2017 07:32:40 +0000 (07:32 +0000)]
MFC r312452-r312512:

r312452-r312512:

- Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones

  This simplifies pathing in make/displayed output

- Use .CURDIR:H instead of .CURDIR to simplify pathing in output, etc

7 years agoMerge r309649, r313048, r313083, r313104:
glebius [Fri, 10 Feb 2017 07:22:12 +0000 (07:22 +0000)]
Merge r309649, r313048, r313083, r313104:

  tcpdump 4.9.0

7 years agoMFC r306349:
ngie [Fri, 10 Feb 2017 06:31:31 +0000 (06:31 +0000)]
MFC r306349:
r306349 (by pfg):

hash(3): protect in-memory page when using cross-endianness.

When writing out pages in the "other endian" format, make a copy
instead of trashing the in-memory one.

Obtained from: NetBSD (CVS rev. 1.29)

7 years agoMFC r313401
vangyzen [Fri, 10 Feb 2017 05:14:19 +0000 (05:14 +0000)]
MFC r313401

Fix garbage IP addresses in UDP log_in_vain messages

If multiple threads emit a UDP log_in_vain message concurrently,
or indeed call inet_ntoa() for any other reason,
the IP addresses could be garbage due to concurrent usage of a
single string buffer inside inet_ntoa().  Use inet_ntoa_r() with
two stack buffers instead.

Relnotes: yes
Sponsored by: Dell EMC

7 years agoMFC r308430, r309782: libelftc: add elf{32,64}-trad{big,little}mips
emaste [Fri, 10 Feb 2017 02:27:48 +0000 (02:27 +0000)]
MFC r308430, r309782: libelftc: add elf{32,64}-trad{big,little}mips

7 years agoMFC r311946: readelf: add S390 relocation types
emaste [Fri, 10 Feb 2017 01:18:15 +0000 (01:18 +0000)]
MFC r311946: readelf: add S390 relocation types

From https://refspecs.linuxfoundation.org/ELF/zSeries/lzsabi0_zSeries.html

7 years agoMFC r313109:
kib [Thu, 9 Feb 2017 04:42:21 +0000 (04:42 +0000)]
MFC r313109:
Use ANSI definitions for some i386 functions.

7 years agoMFC r312791:
cy [Thu, 9 Feb 2017 02:08:42 +0000 (02:08 +0000)]
MFC r312791:

Use normal KNF cuddling of elses.

Reported by: bde

7 years agoMFC r311901:
markj [Thu, 9 Feb 2017 00:28:03 +0000 (00:28 +0000)]
MFC r311901:
Do not set BIO_DONE if the BIO specifies a completion handler.

7 years agoMFC r313180
vangyzen [Wed, 8 Feb 2017 20:08:38 +0000 (20:08 +0000)]
MFC r313180

PCIe HotPlug: remove tests for DL active link capability

As of r313097, the HotPlug code requires the link to support
reporting of the data-link status.  Remove tests for this capability
from code that can now assume its presence.

Sponsored by: Dell EMC

7 years agoRegen after r313450.
jhb [Wed, 8 Feb 2017 18:33:00 +0000 (18:33 +0000)]
Regen after r313450.

7 years agoMFC 310638:
jhb [Wed, 8 Feb 2017 18:32:35 +0000 (18:32 +0000)]
MFC 310638:
Rename the 'flags' argument to getfsstat() to 'mode' and validate it.

This argument is not a bitmask of flags, but only accepts a single value.
Fail with EINVAL if an invalid value is passed to 'flag'.  Rename the
'flags' argument to getmntinfo(3) to 'mode' as well to match.

This is a followup to r308088.

7 years agoMFC r312767: Partially workaround ASMedia HBA error recovery.
mav [Wed, 8 Feb 2017 16:06:19 +0000 (16:06 +0000)]
MFC r312767: Partially workaround ASMedia HBA error recovery.

Taking closer look on my ASM1062 I found that it has bunch of issues around
error recovery: reported wrong CCS, failed commands reported as completed,
READ LOG EXT times out after NCQ error.  This patch workarounds first two
problems, that were making ATAPI devices close to unusable on these HBAs.

7 years agoMFC r312750: Add Timeout and Protect mode page description from MMC-6.
mav [Wed, 8 Feb 2017 16:00:40 +0000 (16:00 +0000)]
MFC r312750: Add Timeout and Protect mode page description from MMC-6.

7 years agoMFC r312777, r312780:
cy [Wed, 8 Feb 2017 13:37:57 +0000 (13:37 +0000)]
MFC r312777, r312780:

Issue an error message when an incorrect flush argument is encountered
(and style fixup).

7 years agoMFC r312392:
ngie [Wed, 8 Feb 2017 08:34:59 +0000 (08:34 +0000)]
MFC r312392:

Use SRCTOP instead of .CURDIR-relative path in .PATH directive

7 years agoMFC 313097: Require Data Layer Active reporting for native PCI-e HotPlug.
jhb [Tue, 7 Feb 2017 22:40:38 +0000 (22:40 +0000)]
MFC 313097: Require Data Layer Active reporting for native PCI-e HotPlug.

Some PCI-e bridges report that they support HotPlug in the slot
capabilities but do not report support for Data Layer Active events
in the link capabilities register.  These bridges do not work correctly
when HotPlug is used.  Further, while the description of HotPlug in
the spec does not mention that DL active events are required, the
description of the link capabilities register says that DL active is
required for HotPlug.  Thanks to Dave Baukus for finding that language
in the spec.

PR: 211699

7 years agoMFC r312544
rstone [Tue, 7 Feb 2017 15:13:19 +0000 (15:13 +0000)]
MFC r312544

  Fix reference to free memory in ixgbe/if_media.c

  When ixgbe receives an interrupt indicating that a new optical module
  may have been inserted, it discards all of its current media types
  by calling ifmedia_removeall() and then creates a new set of media
  types for the supported media on the new module.  However,
  ifmedia_removeall() was maintaining a pointer to whatever the
  current media type was before the call to ifmedia_removealL().
  The result of this was that any attempt to read the current media
  type of the interface (e.g. via ifconfig) would return potentially
  garbage data from free memory (or if one were particularly unlucky
  on an architecture that does not malloc() from a direct map, page
  fault the kernel).

  Fix this by NULL'ing out the current media field in if_media.c,
  and have ixgbe update the current media type after recreating
  them.

  Submitted by: Matt Joras <matt.joras AT gmail DOT com>
  Reviewed by:  sbruno, erj
  MFC after:    1 week
  Sponsored by: Dell EMC Isilon
  Differential Revision:        https://reviews.freebsd.org/D9164

7 years agoMFC r313249:
kib [Tue, 7 Feb 2017 08:31:07 +0000 (08:31 +0000)]
MFC r313249:
Style, use tab after #define.

7 years agoMFC r313182:
ngie [Tue, 7 Feb 2017 05:44:13 +0000 (05:44 +0000)]
MFC r313182:

Fix typo in variable name (_REDUNDENT_LIB_DIRS -> _REDUNDANT_LIB_DIRS)

7 years agoMFC r312694: Make CTL ramdisk backend a real RAM disk.
mav [Tue, 7 Feb 2017 01:57:29 +0000 (01:57 +0000)]
MFC r312694: Make CTL ramdisk backend a real RAM disk.

If "capacity" LU option is set, ramdisk backend now implements featured
thin provisioned disk, storing data in malloc(9) allocated memory blocks
of pblocksize bytes (default PAGE_SIZE or 4KB).  Additionally ~0.2% of LU
size is used for indirection tree (bigger pblocksize reduce the overhead).
Backend supports all unmap and anchor operations.  If configured capacity
is overflowed, proper error conditions are reported.

If "capacity" LU option is not set, the backend operates mostly the same
as before without allocating real storage: writes go to nowhere, reads
return zeroes, reporting that all LBAs are unmapped.

This backend is still mostly oriented on testing and benchmarking (it is
still a volatile RAM disk), but now it should allow to run real FS tests,
not only simple dumb dd.

7 years agoMFC r312603: Add initial support for CTL module unloading.
mav [Tue, 7 Feb 2017 01:55:48 +0000 (01:55 +0000)]
MFC r312603: Add initial support for CTL module unloading.

It is only a first step and not perfect, but better then nothing.
The main blocker is CAM target frontend, that can not be unloaded,
since CAM does not have mechanism to unregister periph driver now.

7 years agoMFC r312348: Remove writing 'residual' field of struct ctl_scsiio.
mav [Tue, 7 Feb 2017 01:43:45 +0000 (01:43 +0000)]
MFC r312348: Remove writing 'residual' field of struct ctl_scsiio.

This field has no practical use and never readed.  Initiators already
receive respective residual size from frontends.  Removed field had
different semantics, which looks useless, and was never passed through
by any frontend.

While there, fix kern_data_resid field support in case of HA, missed in
r312291.

7 years agoMFC r312291, r312669:
mav [Tue, 7 Feb 2017 01:42:13 +0000 (01:42 +0000)]
MFC r312291, r312669:
Make CTL frontends report kern_data_resid for under-/overruns.

It seems like kern_data_resid was never really implemented.  This change
finally does it.  Now frontends update this field while transferring data,
while CTL/backends getting it can more flexibly handle the result.
At this point behavior should not change significantly, still reporting
errors on write overrun, but that may be changed later, if we decide so.

CAM target frontend still does not properly handle overruns due to CAM API
limitations.  We may need to add some fields to struct ccb_accept_tio to
pass information about initiator requested transfer size(s).

7 years agoMFC r312343: Improve error message on duplicate iSCSI port.
mav [Tue, 7 Feb 2017 01:38:48 +0000 (01:38 +0000)]
MFC r312343: Improve error message on duplicate iSCSI port.

7 years agoMFC r309369,310850,310853:
tsoome [Mon, 6 Feb 2017 22:03:07 +0000 (22:03 +0000)]
MFC r309369,310850,310853:

libstand: dosfs cstyle cleanup for return keyword.
dosfs support in libstand is broken since r298230

PR: 214423
Submitted by: Mikhail Kupchik
Reported by: Mikhail Kupchik
Approved by: imp (mentor)

7 years agoMFC r310845: boot2 will deadlock if extended keys are used on text input
tsoome [Mon, 6 Feb 2017 20:57:17 +0000 (20:57 +0000)]
MFC r310845: boot2 will deadlock if extended keys are used on text input

Approved by: imp (mentor)
Differential Revision: https://reviews.freebsd.org/D8608

7 years agoMFC r312982:
cy [Mon, 6 Feb 2017 13:32:22 +0000 (13:32 +0000)]
MFC r312982:

Correct comment grammar and make it easier to understand.

7 years agoMFC r312663: When creating record file, use umask 077 instead of the default.
delphij [Mon, 6 Feb 2017 05:29:35 +0000 (05:29 +0000)]
MFC r312663: When creating record file, use umask 077 instead of the default.

7 years agoMFC r312664: Always initialize 'c'.
delphij [Mon, 6 Feb 2017 05:22:55 +0000 (05:22 +0000)]
MFC r312664: Always initialize 'c'.

7 years agoMFC r303802:
bcr [Sun, 5 Feb 2017 22:18:45 +0000 (22:18 +0000)]
MFC r303802:
Update with the members of the 9th core team.

7 years agoMFC r308583:
bcr [Sun, 5 Feb 2017 21:56:36 +0000 (21:56 +0000)]
MFC r308583:
Fix a broken link to the USB audio class specs.

PR: 214240
Submitted by: Tobias Kortkamp t@tobik.me

7 years agoMFC r310096: reaper: Make REAPER_KILL_SUBTREE actually work.
jilles [Sun, 5 Feb 2017 20:55:01 +0000 (20:55 +0000)]
MFC r310096: reaper: Make REAPER_KILL_SUBTREE actually work.

7 years agoMFC r312721: skel: Remove reference to deleted part in previous commit
jilles [Sun, 5 Feb 2017 14:25:31 +0000 (14:25 +0000)]
MFC r312721: skel: Remove reference to deleted part in previous commit
to this file.

7 years agoMFC r312954:
kib [Sun, 5 Feb 2017 00:39:44 +0000 (00:39 +0000)]
MFC r312954:
Do not leave stale 4K TLB entries on pde (superpage) removal or
protection change.

7 years agoMFC r311585:
ngie [Sat, 4 Feb 2017 17:26:28 +0000 (17:26 +0000)]
MFC r311585:

Conditionalize building libwrap support into sshd

Only build libwrap support into sshd if MK_TCP_WRAPPERS != no

This will unbreak the build if libwrap has been removed from the system

PR: 210141

7 years agoMFC r311174:
ngie [Sat, 4 Feb 2017 17:21:17 +0000 (17:21 +0000)]
MFC r311174:

Make /usr/lib/libbsnmptools.so.0 into an INTERRNALLIB

Although it increases the size of the bsnmp{get,set,walk} binaries by
four on my [amd64] system, it removes the need for producing .debug
files, profiled libraries, and for installing the library itself,
reducing the overall size use on disk by the utilities noted
previously.

Plus, it guards against ABI/API compatibility issues with the library
as it's only used internal to the tools themselves.

7 years agoMFC r311394:
ngie [Sat, 4 Feb 2017 17:18:49 +0000 (17:18 +0000)]
MFC r311394:

op_usm_users: don't deref uusers if it's NULL when SETting the value

Add an XXX comment to note that the conditional seems suspect given
how it's handled elsewhere in the SNMP_OP_SET case.

CID: 1008573

7 years agoMFC r312332,r312446,r312451:
ngie [Sat, 4 Feb 2017 17:17:38 +0000 (17:17 +0000)]
MFC r312332,r312446,r312451:

r312332:

Use SRCTOP where possible and use :H to manipulate .CURDIR to get rid of
unnecessarily long relative path .PATH values with make

r312446 (by emaste):

libc: remove reference to nonexistent lib/locale directory

As far as I can tell this was introduced in r72406 and updated in several
subsequent revisions, but the lib/locale directory it referenced never
existed.

r312451:

Replace dot-dot relative pathing with SRCTOP-relative paths where possible

This reduces build output, need for recalculating paths, and makes it clearer
which paths are relative to what areas in the source tree. The change in
performance over a locally mounted UFS filesystem was negligible in my testing,
but this may more positively impact other filesystems like NFS.

LIBC_SRCTOP was left alone so Juniper (and other users) can continue to
manipulate lib/libc/Makefile (and other Makefile.inc's under lib/libc) as
include Makefiles with custom options.

Discussed with: marcel, sjg

7 years agoMFC r311744,r312328,r312329,r312330:
ngie [Sat, 4 Feb 2017 17:10:19 +0000 (17:10 +0000)]
MFC r311744,r312328,r312329,r312330:

r311744:

Document bsd.snmpmod.mk from a high-level

r312328:

Add a make target (smilint) for running smilint tool against BMIBS

Running smilint against MIB definitions is useful in finding
functional problems with MIB definitions/descriptions.

This is inspired by the smilint targets defined in
usr.sbin/bsnmpd/modules/{snmp_hostres,snmp_mibII}/Makefile

Document all of the variables that are involved in running the
smilint target, as well as all of the prerequisites to running
it.

r312329:

Remove ad hoc smilint targets made standard in bsd.snmpmod.mk in r312328

r312330:

Add smilint target to subdir targets so "make smilint" here will run
the smilint target in subdirs

While here, convert a path that's .CURDIR relative to SRCTOP

7 years agoMFC r310467:
ngie [Sat, 4 Feb 2017 17:08:21 +0000 (17:08 +0000)]
MFC r310467:

Provide some guidance when dealing with sections and variables contained
within them

For example, using variables designated for %usm requires uncommenting
%usm section header

7 years agoMFC r303841,r312012,r312213:
ngie [Sat, 4 Feb 2017 17:06:51 +0000 (17:06 +0000)]
MFC r303841,r312012,r312213:

r303841 (by bdrewery):

Revert r298434 which should be fixed by r301287, r301394, and r301403.

PR: 208703, 208963

r312012:

fmaxmin_test still fails with clang 3.9.x.. bypass the test

PR: 208703

r312213:

Turn COMPILER_VERSION/COMPILER_TYPE make check into a compile-time check
of the clang version

This works around breakage on ^/stable/10 when running installworld from
a ^/stable/10 host where the test wouldn't be compiled on the first
go-around and would be missing when make installworld is run.

PR: 208703

7 years agoMFC r312114:
ngie [Sat, 4 Feb 2017 17:02:54 +0000 (17:02 +0000)]
MFC r312114:

Enable WARNS?= 6 across all of tests/sys

7 years agoMFC r312120:
ngie [Sat, 4 Feb 2017 17:01:53 +0000 (17:01 +0000)]
MFC r312120:

Fix warnings

- Staticize test_num
- Promote i to size_t to deal with -Wsign-compare issues

Tested with: clang, gcc, gcc49