]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/log
FreeBSD/stable/10.git
8 years agoMFC r287148: sh: Fix out of bounds read when there is no ] after a [:class:].
jilles [Sun, 13 Sep 2015 13:58:46 +0000 (13:58 +0000)]
MFC r287148: sh: Fix out of bounds read when there is no ] after a [:class:].

The initial check for a matching ] was incorrect if a ] may be consumed by a
[:class:]. The subsequent loop assumed that there must be a ].

Remove the initial check and make the loop cope with a missing ].

Found with afl-fuzz.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287752 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r278826,279330: sh: Various cleanups to expand.c:
jilles [Sun, 13 Sep 2015 13:52:54 +0000 (13:52 +0000)]
MFC r278826,279330: sh: Various cleanups to expand.c:

* Remove some gotos.
* Remove unused parameter.
* Remove duplicate code.

This MFC is to avoid conflicts in the MFC of r287148.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287751 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r272575: sh: Eliminate some gotos.
jilles [Sun, 13 Sep 2015 13:43:08 +0000 (13:43 +0000)]
MFC r272575: sh: Eliminate some gotos.

This MFC is to avoid conflicts in the MFC of r287148.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287750 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287081: sh: Don't create bad parse result when postponing a bad
jilles [Sun, 13 Sep 2015 13:31:51 +0000 (13:31 +0000)]
MFC r287081: sh: Don't create bad parse result when postponing a bad
substitution error.

An invalid substitution like ${var@} does not cause a parse error but is
stored in the intermediate representation, to be written as part of the
error message. If there is a CTL* byte in the stored part, this confuses
some code such as the code to skip an unused alternative such as in
${var-alternative}.

To keep things simple, do not store CTL* bytes.

Found with afl-fuzz.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287749 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC: r287522
bapt [Sun, 13 Sep 2015 07:15:45 +0000 (07:15 +0000)]
MFC: r287522

Prefer pciids database from ports if present

Given the pciids database on ports is updated more often than the one in base
prefer this version if present, otherwise read the one from base.

Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D3391

git-svn-id: svn://svn.freebsd.org/base/stable/10@287746 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC 287615:
hrs [Sun, 13 Sep 2015 04:05:27 +0000 (04:05 +0000)]
MFC 287615:

Use read to parse a line instead of set.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287739 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC 287614:
hrs [Sun, 13 Sep 2015 04:02:52 +0000 (04:02 +0000)]
MFC 287614:

- Add uid check.
- Report delay<0 as a warning.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287738 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC 287613:
hrs [Sun, 13 Sep 2015 03:59:29 +0000 (03:59 +0000)]
MFC 287613:

Update only static routes when an interface is specified.  This fixed
a bad side-effect reported in PR 202144.

PR: 202144

git-svn-id: svn://svn.freebsd.org/base/stable/10@287737 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC 287349,287404:
hrs [Sun, 13 Sep 2015 03:15:37 +0000 (03:15 +0000)]
MFC 287349,287404:

- Print sdl->sdl_data when sdl->sdl_nlen > 0 && sdl->sdl_alen == 0
  as link_ntoa(3) does.

- snprintf() returns at most size-1 of the chars printed into
  the buffer.  (n == hostlen) also means the buffer length was
  too short.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287736 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC 259169, 259176, 287097:
hrs [Sun, 13 Sep 2015 03:09:21 +0000 (03:09 +0000)]
MFC 259169, 259176, 287097:

- Ansify function definitions.

- Change the type of addr argument in dump() function to be able
  disambiguate link-local addresses from different zones.

- Add static and remove unused variables.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287735 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC 287094:
hrs [Sun, 13 Sep 2015 02:09:06 +0000 (02:09 +0000)]
MFC 287094:

- Deprecate IN6_IFF_NODAD.  It was used to prevent DAD on a loopback
  interface but in6if_do_dad() already had a check for IFF_LOOPBACK.

- Remove in6if_do_dad() check in in6_broadcast_ifa().  An address
  which needs DAD always has IN6_IFF_TENTATIVE there.

- in6if_do_dad() now returns EAGAIN when the interface is not ready
  since DAD callout handler ignores such an interface.

- In DAD callout handler, mark an address as IN6_IFF_TENTATIVE
  when the interface has ND6_IFF_IFDISABLED.  And Do IFF_UP and
  IFF_DRV_RUNNING check consistently when DAD is required.

- draft-ietf-6man-enhanced-dad is now published as RFC 7527.

- Fix some typos.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287734 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC 287095, 287610, 287611, 287617:
hrs [Sun, 13 Sep 2015 01:59:50 +0000 (01:59 +0000)]
MFC 287095, 287610, 287611, 287617:

Remove obsolete API (SIOCGDRLST_IN6 and SIOCGPRLST_IN6) support.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287733 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC 287609:
hrs [Sun, 13 Sep 2015 01:44:30 +0000 (01:44 +0000)]
MFC 287609:

Do not add IN6_IFF_TENTATIVE when ND6_IFF_NO_DAD.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287732 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC 287608:
hrs [Sun, 13 Sep 2015 01:39:37 +0000 (01:39 +0000)]
MFC 287608:

Remove IN6_IFF_NOPFX.  This flag was no longer used.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287731 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC 287607:
hrs [Sun, 13 Sep 2015 01:35:40 +0000 (01:35 +0000)]
MFC 287607:

- Remove GIF_{SEND,ACCEPT}_REVETHIP.
- Simplify EADDRNOTAVAIL and EAFNOSUPPORT conditions.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287730 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC 287595:
hrs [Sun, 13 Sep 2015 01:31:17 +0000 (01:31 +0000)]
MFC 287595:

- Fix SIGSEGV when sa == NULL.  NULL check in getnameinfo_inet()
  did not work as expected.

- Simplify afdl table lookup.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287729 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC 272159,272161,272386,272446,272547,272548,273210:
hrs [Sat, 12 Sep 2015 20:36:39 +0000 (20:36 +0000)]
MFC 272159,272161,272386,272446,272547,272548,273210:

- Make lagg protos a enum.

- When reconfiguring protocol on a lagg, first set it to LAGG_PROTO_NONE,
  then drop lock, run the attach routines, and then set it to specific
  proto. This removes tons of WITNESS warnings.

- Make lagg protocol attach handlers not failing and allocate memory
  with M_WAITOK.

- Virtualize lagg(4) cloner.  This change fixes a panic when tearing down
  if_lagg(4) interfaces which were cloned in a vnet jail.

  Sysctl nodes which are dynamically generated for each cloned interface
  (net.link.lagg.N.*) have been removed, and use_flowid and flowid_shift
  ifconfig(8) parameters have been added instead.  Flags and per-interface
  statistics counters are displayed in "ifconfig -v".

- Separate option handling from SIOC[SG]LAGG to SIOC[SG]LAGGOPTS for
  backward compatibility with old ifconfig(8).

- Move L2 addr configuration for the primary port to a taskqueue.  This fixes
  LOR of softc rmlock in iflladdr_event handlers.

- Call if_delmulti_ifma() after LACP_UNLOCK().  This fixes another LOR.

- Fix a panic in lacp_transit_expire().

- Fix a panic in lagg_input() upon shutting down a port.

- Use printb() for boolean flags in ro_opts and actor_state for LACP.

- Fix lladdr configuration which could prevent LACP mode from working.

- Fix LORs when a laggport interface has an IPv6 LLA.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287723 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287468, turn on RAWDCF by default.
cy [Sat, 12 Sep 2015 02:36:17 +0000 (02:36 +0000)]
MFC r287468, turn on RAWDCF by default.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287700 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287376
kp [Fri, 11 Sep 2015 17:19:24 +0000 (17:19 +0000)]
MFC r287376

pf: Fix misdetection of forwarding when net.link.bridge.pfil_bridge is set

If net.link.bridge.pfil_bridge is set we can end up thinking we're forwarding
in pf_test6() because the rcvif and the ifp (output interface) are different.
In that case we're bridging though, and the rcvif the the bridge member on
which the packet was received and ifp is the bridge itself.
If we'd set dir to PF_FWD we'd end up calling ip6_forward() which is
incorrect.

Instead check if the rcvif is a member of the ifp bridge. (In other words, the
if_bridge is the ifp's softc). If that's the case we're not forwarding but
bridging.

PR:   202351

git-svn-id: svn://svn.freebsd.org/base/stable/10@287680 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287564:
jimharris [Fri, 11 Sep 2015 17:06:57 +0000 (17:06 +0000)]
MFC r287564:

  isci: check return value of pci_alloc_msix()

  Certain VM guest types (VMware, Xen) do not support MSI, so pci_alloc_msix()
  always fails.  isci(4) was not properly detecting the allocation failure,
  and would try to proceed with MSIx resource initialization rather than
  reverting to INTx.

Sponsored by: Intel

git-svn-id: svn://svn.freebsd.org/base/stable/10@287678 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287563:
jimharris [Fri, 11 Sep 2015 17:01:01 +0000 (17:01 +0000)]
MFC r287563:

  isci: explicitly enable/disable PCI busmaster

  BIOS always enables PCI busmaster on the isci device, which effectively
  worked around this omission.  But when passing the isci device through
  to a guest VM, the hypervisor will disable busmaster and isci will not
  work without calling pci_enable_busmaster().

Sponsored by: Intel

git-svn-id: svn://svn.freebsd.org/base/stable/10@287677 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r286043:
jimharris [Fri, 11 Sep 2015 16:59:04 +0000 (16:59 +0000)]
MFC r286043:

  nvme: do not notify a consumer about failures that occur during initialization

Sponsored by: Intel

git-svn-id: svn://svn.freebsd.org/base/stable/10@287676 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287100: spa_import_rootpool: prevent lock and resource leak
avg [Fri, 11 Sep 2015 13:32:19 +0000 (13:32 +0000)]
MFC r287100: spa_import_rootpool: prevent lock and resource leak

PR: 198563

git-svn-id: svn://svn.freebsd.org/base/stable/10@287667 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287099: account for ashift when gathering buffers to be written to l2arc device
avg [Fri, 11 Sep 2015 12:58:41 +0000 (12:58 +0000)]
MFC r287099: account for ashift when gathering buffers to be written to l2arc device

The change differs from that in head because of other changes that have not
been MFC-ed yet.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287665 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287354: callout_reset: fix a reversed check for cc_exec_cancel
avg [Fri, 11 Sep 2015 12:45:56 +0000 (12:45 +0000)]
MFC r287354: callout_reset: fix a reversed check for cc_exec_cancel

Relnotes: potential erratum

git-svn-id: svn://svn.freebsd.org/base/stable/10@287663 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r285021: zfs_mount(MS_REMOUNT): protect zfs_(un)register_callbacks calls
avg [Fri, 11 Sep 2015 12:41:59 +0000 (12:41 +0000)]
MFC r285021: zfs_mount(MS_REMOUNT): protect zfs_(un)register_callbacks calls

git-svn-id: svn://svn.freebsd.org/base/stable/10@287661 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r286985: try to fix lor between z_teardown_lock and spa_namespace_lock
avg [Fri, 11 Sep 2015 12:39:13 +0000 (12:39 +0000)]
MFC r286985: try to fix lor between z_teardown_lock and spa_namespace_lock

git-svn-id: svn://svn.freebsd.org/base/stable/10@287660 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r286985: try to fix lor between z_teardown_lock and spa_namespace_lock
avg [Fri, 11 Sep 2015 12:37:50 +0000 (12:37 +0000)]
MFC r286985: try to fix lor between z_teardown_lock and spa_namespace_lock

git-svn-id: svn://svn.freebsd.org/base/stable/10@287658 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r284513: l2arc: pass correct size to trim requests
avg [Fri, 11 Sep 2015 12:34:23 +0000 (12:34 +0000)]
MFC r284513: l2arc: pass correct size to trim requests

git-svn-id: svn://svn.freebsd.org/base/stable/10@287656 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287574:
garga [Fri, 11 Sep 2015 10:45:28 +0000 (10:45 +0000)]
MFC r287574:

- Fix Sierra MC7354 ID from a bad copy/paste, correct ID is 68C0

MFC r287575:

- Remove duplicate entry for Sierra Wireless Aircard 875

Approved by: loos
Obtained from: pfSense (r287574)
Sponsored by: Rubicon Communications (Netgate)

git-svn-id: svn://svn.freebsd.org/base/stable/10@287655 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r274569, r276848, r287234:
markj [Fri, 11 Sep 2015 02:53:22 +0000 (02:53 +0000)]
MFC r274569, r276848, r287234:
Only compare visitation counters if they've both been set for the current
type graph walk.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287639 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC 287440:
jhb [Fri, 11 Sep 2015 00:20:15 +0000 (00:20 +0000)]
MFC 287440:
Currently the Linux character device mmap handling only supports mmap
operations that map a single page that has an associated vm_page_t.
This does not permit mapping larger regions (such as a PCI memory
BAR) and it does not permit mapping addresses beyond the top of RAM
(such as a 64-bit BAR located above the top of RAM).

Instead of using a single OBJT_DEVICE object and passing the physaddr via
the offset as a hack, create a new sglist and OBJT_SG object for each
mmap request. The requested memory attribute is applied to the object
thus affecting all pages mapped by the request.

Sponsored by: Chelsio

git-svn-id: svn://svn.freebsd.org/base/stable/10@287637 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC 283281,283282,283562,283647,283836,284000,286158:
jhb [Wed, 9 Sep 2015 23:39:30 +0000 (23:39 +0000)]
MFC 283281,283282,283562,283647,283836,284000,286158:
Various fixes to orphan handling which also fix issues with following
forks.

283281:
Always set p_oppid when attaching to an existing process via procfs
tracing.  This matches the behavior of ptrace(PT_ATTACH).  Also,
the procfs detach request assumes p_oppid is always set.

283282:
Only reparent a traced process to its old parent if the tracing process is
not the old parent. Otherwise, proc_reap() will leave the zombie in place
resulting in the process' status being returned twice to its parent.

Add test cases for PT_TRACE_ME and PT_ATTACH which are fixed by
this change.

283562:
Do not allow a process to reap an orphan (a child currently being
traced by another process such as a debugger). The parent process does
need to check for matching orphan pids to avoid returning ECHILD if an
orphan has exited, but it should not return the exited status for the
child until after the debugger has detached from the orphan process
either explicitly or implicitly via wait().

Add two tests for for this case: one where the debugger is the direct
child (thus the parent has a non-empty children list) and one where
the debugger is not a direct child (so the only "child" of the parent
is the orphan).

283647:
Tweak the description of when waitpid() doesn't return any status for a
non-blocking wait to avoid the word "empty".

283836:
Consistently only use one end of the pipe in the parent and debugger
processes and do not rely on EOF due to a close() in the debugger.

284000:
Add a CHILD_REQUIRE macro similar to ATF_REQUIRE for use in child processes
of the main test process.

286158:
Clear P_TRACED before reparenting a detached process back to its
original parent. Otherwise the debugee will be set as an orphan of
the debugger.

Add tests for tracing forks via PT_FOLLOW_FORK.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287604 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287151,r287152,r287153,r287155:
bdrewery [Wed, 9 Sep 2015 17:15:13 +0000 (17:15 +0000)]
MFC r287151,r287152,r287153,r287155:

  r287151:
    Move common locking for filemon_inuse and struct filemon* to
    filemon_pid_check().
  r287152:
    Remove unneeded inuse list locking in filemon_comment().
  r287153:
    Avoid taking proctree_lock and searching parents in wrappers if not needed.
  r287155:
    Fix filemon locking races.

 Relnotes: yes (race fixes)
 Sponsored by: EMC / Isilon Storage Division

git-svn-id: svn://svn.freebsd.org/base/stable/10@287598 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r272889 and r287402:
hrs [Wed, 9 Sep 2015 08:52:39 +0000 (08:52 +0000)]
MFC r272889 and r287402:

- Virtualize if_epair(4).  An if_xname check for both "a" and "b" interfaces
  is added to return EEXIST when only "b" interface exists---this can happen
  when epair<N>b is moved to a vnet jail and then "ifconfig epair<N> create"
  is invoked there.

- Fix a panic which was reproducible by an infinite loop of
  "ifconfig epair0 create && ifconfig epair0a destroy".
  This was caused by an uninitialized function pointer in
  softc->media.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287594 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287406:
hrs [Wed, 9 Sep 2015 08:40:17 +0000 (08:40 +0000)]
MFC r287406:

Divide statistics in the number of packets with 1000 instead of 1024
in human-readable form.

PR: 183598

git-svn-id: svn://svn.freebsd.org/base/stable/10@287593 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC: r287405:
imp [Tue, 8 Sep 2015 18:37:16 +0000 (18:37 +0000)]
MFC: r287405:

Make out of memory behavior less pathological.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287569 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMerge r286649:
rodrigc [Tue, 8 Sep 2015 17:54:31 +0000 (17:54 +0000)]
Merge r286649:

Fix and re-enable UTF-8 tests.

X-Merge with: r287393

git-svn-id: svn://svn.freebsd.org/base/stable/10@287568 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287437
sbruno [Tue, 8 Sep 2015 17:20:12 +0000 (17:20 +0000)]
MFC r287437

r249170 was just plain wrong.  The effect of the change is to always
delete a logic volume on status change which is NOT what we want here.

The original code is correct in that when the volume changes status
the driver will only delete the volume if the status is one of the
fatal errors.  A drive failure in a mirrored volume is NOT a situtation
where the volume should dissapear.

Reported on freebsd-scsi@:
https://lists.freebsd.org/pipermail/freebsd-scsi/2015-September/006800.html

git-svn-id: svn://svn.freebsd.org/base/stable/10@287566 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287369:
andrew [Tue, 8 Sep 2015 12:00:13 +0000 (12:00 +0000)]
MFC r287369:
Ensure we use calculate_first_tls_offset, even if the main program doesn't
have TLS program header. This is needed on architectures with Variant I
tls, that is arm, arm64, mips, and powerpc. These place the thread control
block at the start of the buffer and, without this, this data may be
trashed.

This appears to not be an issue on mips or powerpc as they include a second
adjustment to move the thread local data, however this is on arm64 (with a
future change to fix placing this data), and should be on arm. I am unable
to trigger this on arm, even after changing the code to move the data
around to make it more likely to be hit. This is most likely because my
tests didn't use the variable in offset 0.

Reviewed by: kib
MFC after: 1 week
Sponsored by: ABT Systems Ltd

git-svn-id: svn://svn.freebsd.org/base/stable/10@287560 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287360:
kib [Tue, 8 Sep 2015 07:15:10 +0000 (07:15 +0000)]
MFC r287360:
Fix t_spawnattr test for attributes handling by posix_spawn(3).
Connect it to the build.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287551 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287123:
delphij [Tue, 8 Sep 2015 02:02:08 +0000 (02:02 +0000)]
MFC r287123:

Finish r89633 and completely remove the remaining of VERSION.

PR: bin/202308
Submitted by: John Hein <z7dr6ut7gs snkmail com>

git-svn-id: svn://svn.freebsd.org/base/stable/10@287549 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287093:
delphij [Tue, 8 Sep 2015 01:44:37 +0000 (01:44 +0000)]
MFC r287093:

Instead of doing an no-op (|= 0), actually clear the flags in
acl_clear_flags_np.

Reported by: Pascal Drecker <pascal freebsd drecker com>

git-svn-id: svn://svn.freebsd.org/base/stable/10@287547 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287021:
delphij [Tue, 8 Sep 2015 00:43:40 +0000 (00:43 +0000)]
MFC r287021:

Fix build when LEAPSECONDS is enabled.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287546 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287020: MFV r287019: leapseconds from tzdata2015f.
delphij [Tue, 8 Sep 2015 00:34:38 +0000 (00:34 +0000)]
MFC r287020: MFV r287019: leapseconds from tzdata2015f.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287545 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287310:
kib [Sun, 6 Sep 2015 17:36:09 +0000 (17:36 +0000)]
MFC r287310:
Use P1B_PRIO_MAX to designate max posix priority for the RR/FIFO
scheduler types.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287508 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287309:
kib [Sun, 6 Sep 2015 17:32:33 +0000 (17:32 +0000)]
MFC r287309:
Remove single-use macros obfuscating malloc(9) and free(9) calls.
Style.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287507 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287432: Fix copy-paste bug introduced in r275458.
mav [Sun, 6 Sep 2015 09:41:08 +0000 (09:41 +0000)]
MFC r287432: Fix copy-paste bug introduced in r275458.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287498 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287292:
kib [Sat, 5 Sep 2015 08:55:51 +0000 (08:55 +0000)]
MFC r287292:
Switch libc from using _sig{procmask,action,suspend} symbols, which
are aliases for the syscall stubs and are plt-interposed, to the
libc-private aliases of internally interposed sigprocmask() etc.

MFC r287300:
Use libthr interposed functions instead of syscalls, in posix_spawn()'
child.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287480 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r277853
sbruno [Fri, 4 Sep 2015 15:45:42 +0000 (15:45 +0000)]
MFC r277853

Check for invalid length or more than max length for the interpreter, instead
of the validity of the string pointer holding the interpreter.

Submitted by: sson

git-svn-id: svn://svn.freebsd.org/base/stable/10@287463 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r276834
sbruno [Fri, 4 Sep 2015 15:40:19 +0000 (15:40 +0000)]
MFC r276834

Update Features2 to display SDBG capability of processor.  This is
showing up on Haswell-class CPUs

From the Intel SDM, "Table 3-20. Feature Information Returned in the
ECX Register"

11 | SDBG | A value of 1 indicates the processor supports
IA32_DEBUG_INTERFACE MSR for silicon debug.

Submitted by: jiashiun@gmail.com

git-svn-id: svn://svn.freebsd.org/base/stable/10@287462 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r286238
sbruno [Fri, 4 Sep 2015 15:34:27 +0000 (15:34 +0000)]
MFC r286238

A misplaced #endif in ixgbe_ioctl() causes interface MTU to become
zero when INET and INET6 are undefined.

PR: 162028
Submitted by: hoomanfazaeli@gmail.com pluknet

git-svn-id: svn://svn.freebsd.org/base/stable/10@287461 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287368:
gjb [Fri, 4 Sep 2015 01:13:40 +0000 (01:13 +0000)]
MFC r287368:
 Remove '-' separating OSRELEASE and SNAPSHOT_DATE for vagrant
 builds, and prepend it to SNAPSHOT_DATE to prevent a trailing '-'
 in the final box name for a release build.

Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@287449 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287345:
delphij [Fri, 4 Sep 2015 00:41:29 +0000 (00:41 +0000)]
MFC r287345:

Drop group privileges after opening the kvm descriptor, otherwise, the code
would not drop privileges as expected.

While there also add checks for the drop and bail out immediately if we
failed.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287446 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoPut timeout directory in correct place
rodrigc [Thu, 3 Sep 2015 20:47:13 +0000 (20:47 +0000)]
Put timeout directory in correct place

git-svn-id: svn://svn.freebsd.org/base/stable/10@287443 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r286964
asomers [Thu, 3 Sep 2015 19:42:56 +0000 (19:42 +0000)]
MFC r286964

Add ATF functional tests for fstyp(8).  No ZFS or GELI tests yet.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287441 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC 283622:
jhb [Thu, 3 Sep 2015 18:23:07 +0000 (18:23 +0000)]
MFC 283622:
Add <sys/user.h> to the SYNOPSIS of the kinfo_get*() functions since these
functions all return types that are defined in that header.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287439 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC: r287183, r287264, r287265
imp [Thu, 3 Sep 2015 18:14:31 +0000 (18:14 +0000)]
MFC: r287183, r287264, r287265

Export kern.features.invariants when kernel is compiled with invariants.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287438 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC 281941:
jhb [Thu, 3 Sep 2015 16:43:35 +0000 (16:43 +0000)]
MFC 281941:
Watchdog drivers need to support rearming the watchdog in contexts which
are not permitted to sleep.  Only use the IPMI watchdog with backends
which poll driver-initiated requests to meet this requirement.

In practice this means that watchdogs will no longer be used on systems
that use the SSIF backend.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287435 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287208, r287216:
ume [Thu, 3 Sep 2015 11:33:33 +0000 (11:33 +0000)]
MFC r287208, r287216:
  Make it buildable with WITH_OPENLDAP, again.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287428 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC: r286490,r286491,r287125
bapt [Wed, 2 Sep 2015 05:55:57 +0000 (05:55 +0000)]
MFC: r286490,r286491,r287125

Per rfc3629 value greater than 0x10ffff should be rejected (r286490,r286491)

Make UTF-8 parsing and generation more strict. (r287125  by ed)

- in mbrtowc() we need to disallow codepoints above 0x10ffff.
- In wcrtomb() we need to disallow codepoints between 0xd800 and 0xdfff.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287393 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC: r268745,r268746,r268747,r268748,r268749,r268861,r268750,r268751,r268763
bapt [Wed, 2 Sep 2015 05:45:47 +0000 (05:45 +0000)]
MFC: r268745,r268746,r268747,r268748,r268749,r268861,r268750,r268751,r268763
     r273769,r273771,r276771,r278810

New BSDL timeout(1) utility compatible with GNU timeout

Relnotes: yes

git-svn-id: svn://svn.freebsd.org/base/stable/10@287392 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r286887: Using the error return code documented in the comment.
avatar [Tue, 1 Sep 2015 22:35:53 +0000 (22:35 +0000)]
MFC r286887: Using the error return code documented in the comment.

Though there is no direct midi_uninit() caller amongst existing drivers
at this moment, a quick experiment indicates that EBUSY gives users more
precise error message once drivers start to honour this result.  For example,
emu_midi_detach() should check the result of mpu401_uninit() and block
module unloading if there is any MIDI I/O in progress.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287388 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r286892
asomers [Tue, 1 Sep 2015 18:57:57 +0000 (18:57 +0000)]
MFC r286892

Serve /etc/eui64 via NIS.

The C library already knows how to lookup eui64 entries from NIS. For
example, fwcontrol(8) does it. But /var/yp/Makefile.dist doesn't build the
eui64 maps, and ypinit(8) doesn't push them to slaves. This change fixes
that.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287375 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r286910:
delphij [Tue, 1 Sep 2015 01:03:45 +0000 (01:03 +0000)]
MFC r286910:

 - ANSIfy
 - Remove the redundant _PATH_RSH definition (paths.h at r96194);
 - Use pid_t for PIDs
 - Note that we are at the same level of OpenBSD's counterpart of
   revision 1.7 (r94757).

git-svn-id: svn://svn.freebsd.org/base/stable/10@287339 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r286894:
delphij [Tue, 1 Sep 2015 01:01:35 +0000 (01:01 +0000)]
MFC r286894:

Set curvnet context inside the RPC code in more places.

Reviewed by: melifaro

git-svn-id: svn://svn.freebsd.org/base/stable/10@287338 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r272282,r272363,r272383:
bdrewery [Mon, 31 Aug 2015 20:44:52 +0000 (20:44 +0000)]
MFC r272282,r272363,r272383:

  r272282:
    Search for the nearest PORTSDIR where Mk/bsd.ports.mk exists, from .CURDIR.
    This will only take effect if PORTSDIR is not set, as previously supported.

  r272363:
    Always resolve PORTSDIR to absolute paths using realpath(1).

  r272383:
    Revise r272363 by collapsing the tests into a for loop.

Relnotes: yes

git-svn-id: svn://svn.freebsd.org/base/stable/10@287334 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r282551: Remove historical GNUC test
emaste [Mon, 31 Aug 2015 19:20:18 +0000 (19:20 +0000)]
MFC r282551: Remove historical GNUC test

The requirement is for a GCC-compatible compiler and not necessarily
GCC itself. However, we currently expect any compiler used for building
the whole of FreeBSD to be GCC-compatible and many things will break if
not; there's no longer a need to have an explicit test for this in rtld.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287331 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r286836:
delphij [Mon, 31 Aug 2015 18:58:53 +0000 (18:58 +0000)]
MFC r286836:

so_vnet is constant after creation and no locking is necessary,
document this fact.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287329 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r286834:
delphij [Mon, 31 Aug 2015 18:53:41 +0000 (18:53 +0000)]
MFC r286834:

Use arc4random_buf().  While there, unifdef the code for !HAVE_ARC4RANDOM.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287328 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r285844: ar: add -U (unique) option to disable -D (deterministic) mode
emaste [Mon, 31 Aug 2015 17:30:13 +0000 (17:30 +0000)]
MFC r285844: ar: add -U (unique) option to disable -D (deterministic) mode

This is required in order for us to support deterministic mode by
default.  If multiple -D or -U options are specified on the command
line, the final one takes precedence.  GNU ar also uses -U for this.

PR: 196929
Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@287326 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r279084,280713: setmode(): Use sysctl kern.proc.umask instead of umask()
jilles [Sat, 29 Aug 2015 20:41:09 +0000 (20:41 +0000)]
MFC r279084,280713: setmode(): Use sysctl kern.proc.umask instead of umask()
if possible.

The kern.proc.umask.<pid> sysctl allows querying the umask without
temporarily modifying it.

r280713 is the actual change, while r279084 is a whitespace change.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287298 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r286888: Using consistent coding style to deal with error inside the loop.
avatar [Sat, 29 Aug 2015 11:15:54 +0000 (11:15 +0000)]
MFC r286888: Using consistent coding style to deal with error inside the loop.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287287 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287025: Remove some code duplication by using biofinish().
mav [Sat, 29 Aug 2015 10:53:53 +0000 (10:53 +0000)]
MFC r287025: Remove some code duplication by using biofinish().

git-svn-id: svn://svn.freebsd.org/base/stable/10@287286 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r286814, r286816: Remove UMA allocation of ATA requests.
mav [Sat, 29 Aug 2015 10:52:16 +0000 (10:52 +0000)]
MFC r286814, r286816: Remove UMA allocation of ATA requests.

After CAM replaced old ATA stack, this driver processes no more then one
request at a time per channel.  Using UMA after that is overkill, so
replace it with simple preallocation of one request per channel.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287285 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r286773:
hselasky [Sat, 29 Aug 2015 06:23:40 +0000 (06:23 +0000)]
MFC r286773:
Improve the realtime properties of USB transfers for embedded systems
like RPI-B and RPI-2.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287274 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r286799:
hselasky [Sat, 29 Aug 2015 06:11:50 +0000 (06:11 +0000)]
MFC r286799:
Fix race in USB PF which can happen if we stop tracing exactly when
the kernel is tapping an USB transfer. This leads to a NULL pointer
access. The solution is to only trace while the USB bus lock is
locked.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287272 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283067, r286118, r285638, r285935, r286778, r286780 and r286802:
hselasky [Sat, 29 Aug 2015 06:07:55 +0000 (06:07 +0000)]
MFC r283067, r286118, r285638, r285935, r286778, r286780 and r286802:
- Make the FIFO configuration a bit more flexible for the DWC OTG in
device side mode.
- Limit the number of times we loop inside the DWC OTG poll handler to
avoid starving other fast interrupts. Fix a comment while at it.
- Optimise the DWC OTG host mode driver's transmit path
- Optimise the DWC OTG host mode driver's receive path
- Minor code refactor to avoid duplicating code.
- Handle NYET high speed tokens and predict NAK'ing is up next.
- Fixes for HIGH speed ISOCHRONOUS traffic.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287271 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287012:
jamie [Sat, 29 Aug 2015 02:41:59 +0000 (02:41 +0000)]
MFC r287012:

  Make pkill/pgrep -j ARG take jname, not just jid.

PR: 201588
Submitted by: Daniel Shahaf <danielsh at apache.org>

git-svn-id: svn://svn.freebsd.org/base/stable/10@287269 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC: r286790
rmacklem [Fri, 28 Aug 2015 22:42:37 +0000 (22:42 +0000)]
MFC: r286790
For the case where an NFSv4.1 ExchangeID operation has the client identifier
that already has a confirmed ClientID, the nfsrv_setclient() function would
not fill in the clientidp being returned. As such, the value of ClientID
returned would be whatever garbage was on the stack.
This patch fixes the problem by filling in these fields.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287267 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r286344: find: Fix segfault with very long path in -exec/-ok ... {} \;.
jilles [Fri, 28 Aug 2015 20:53:08 +0000 (20:53 +0000)]
MFC r286344: find: Fix segfault with very long path in -exec/-ok ... {} \;.

If the resulting argument is longer than MAXPATHLEN, realloc() was called to
extend the space, but the new pointer was not correctly stored.

Different from what OpenBSD has done, rewrite brace_subst() to calculate the
necessary space first and realloc() at most once.

As before, the e_len fields are not updated in case of a realloc.
Therefore, a following long argument will do another realloc.

PR: 201750

git-svn-id: svn://svn.freebsd.org/base/stable/10@287266 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r286720:
ae [Fri, 28 Aug 2015 11:56:20 +0000 (11:56 +0000)]
MFC r286720:
  Use g_conf_printf_escaped() to escape illegal symbols in file name.

  PR: 202289

git-svn-id: svn://svn.freebsd.org/base/stable/10@287251 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r285252:
markj [Fri, 28 Aug 2015 00:06:31 +0000 (00:06 +0000)]
MFC r285252:
Fix an incorrect assertion in witness.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287231 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r286167:
markj [Thu, 27 Aug 2015 23:55:46 +0000 (23:55 +0000)]
MFC r286167:
Avoid dereferencing curthread->td_proc->p_cred in DTrace probe context.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287230 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r286418:
markj [Thu, 27 Aug 2015 23:52:53 +0000 (23:52 +0000)]
MFC r286418:
ipv4_is_zeronet() and ipv4_is_loopback() expect an address in network
order, but IN_ZERONET and IN_LOOPBACK expect it in host order.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287229 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r286169:
markj [Thu, 27 Aug 2015 23:46:11 +0000 (23:46 +0000)]
MFC r286169:
Perform bounds checking when constructing a format string.

PR: 201657

git-svn-id: svn://svn.freebsd.org/base/stable/10@287226 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r281800 (pfg):
delphij [Thu, 27 Aug 2015 21:52:09 +0000 (21:52 +0000)]
MFC r281800 (pfg):

patch(1): small include changes.

Mostly to match OpenBSD, no functional change.

MFC r286601 + 286617:

use posix_spawn(3) instead of fork() and exec() manually as suggested
by jmg@.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287223 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r286966:
bdrewery [Thu, 27 Aug 2015 16:36:39 +0000 (16:36 +0000)]
MFC r286966:

  Add link for rw_unlock(9) to rwlock(9).

git-svn-id: svn://svn.freebsd.org/base/stable/10@287215 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoDocument SA-15:21, SA-15:22, EN-15:15.
gjb [Thu, 27 Aug 2015 15:21:58 +0000 (15:21 +0000)]
Document SA-15:21, SA-15:22, EN-15:15.

Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@287210 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287119:
loos [Thu, 27 Aug 2015 14:07:28 +0000 (14:07 +0000)]
MFC r287119:

  Reapply r196551 which was accidentally reverted by r223637 (update to
  OpenBSD pf 4.5).

  Fix argument ordering to memcpy as well as the size of the copy in the
  (theoretical) case that pfi_buffer_cnt should be greater than ~_max.

  This fix the failure when you hit the self table size and force it to be
  resized.

  Sponsored by: Rubicon Communications (Netgate)

git-svn-id: svn://svn.freebsd.org/base/stable/10@287207 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC, r286965:
ken [Thu, 27 Aug 2015 13:17:05 +0000 (13:17 +0000)]
MFC, r286965:

  ------------------------------------------------------------------------
  r286965 | ken | 2015-08-20 10:07:51 -0600 (Thu, 20 Aug 2015) | 297 lines

  Revamp camcontrol(8) fwdownload support and add the opcodes subcommand.

  The significant changes and bugs fixed here are:

  1. Fixed a bug in the progress display code:

     When the user's filename is too big, or his terminal width is too
     small, the progress code could wind up using a negative number for
     the length of the "stars" that it uses to indicate progress.

     This negative value was assigned to an unsigned variable, resulting
     in a very large positive value.

     The result is that we wound up writing garbage from memory to the
     user's terminal.

     With an 80 column terminal, a file name length of more than 35
     characters would generate this problem.

     To address this, we now set a minimum progress bar length, and
     truncate the user's file name as needed.

     This has been tested with large filenames and small terminals, and
     at least produces reasonable results.  If the terminal is too
     narrow, the progress display takes up an additional line with each
     update, but this is more user friendly than writing garbage to the
     tty.

  2. SATA drives connected via a SATA controller didn't have SCSI Inquiry
     data populated in struct cam_device.  This meant that the code in
     fw_get_vendor() in fwdownload.c would try to match a zero-length
     vendor ID, and so return the first entry in the vendor table.  (Which
     used to be HITACHI.)  Fixed by grabbing identify data, passing the
     identify buffer into fw_get_vendor(), and matching against the model
     name.

  3. SATA drives connected via a SAS controller do have Inquiry data
     populated.  The table included a couple of entries -- "ATA ST" and
     "ATA HDS", intended to handle Seagate and Hitachi SATA drives attached
     via a SAS controller.  SCSI to ATA translation layers use a vendor
     ID of "ATA" (which is standard), and then the model name from the ATA
     identify data as the SCSI product name when they are returning data on
     SATA disks.  The cam_strmatch code will match the first part of the
     string (because the length it is given is the length of the vendor,
     "ATA"), and return 0 (i.e. a match).  So all SATA drives attached to
     a SAS controller would be programmed using the Seagate method
     (WRITE BUFFER mode 7) of SCSI firmware downloading.

  4. Issue #2 above covered up a bug in fw_download_img() -- if the
     maximum packet size in the vendor table was 0, it tried to default
     to a packet size of 32K.  But then it didn't actually succeed in
     doing that, because it set the packet size to the value that was
     in the vendor table (0).  Now that we actually have ATA attached
     drives fall use the VENDOR_ATA case, we need a reasonable default
     packet size.  So this is fixed to properly set the default packet size.

  5. Add support for downloading firmware to IBM LTO drives, and add a
     firmware file validation method to make sure that the firmware
     file matches the drive type.  IBM tape drives include a Load ID and
     RU name in their vendor-specific VPD page 0x3.  Those should match
     the IDs in the header of the firmware file to insure that the
     proper firmware file is loaded.

  6. This also adds a new -q option to the camcontrol fwdownload
     subcommand to suppress informational output.  When -q is used in
     combination with -y, the firmware upgrade will happen without
     prompting and without output except if an error condition occurs.

  7. Re-add support for printing out SCSI inquiry information when
     asking the user to confirm that they want to download firmware, and
     add printing of ATA Identify data if it is a SATA disk.  This was
     removed in r237281 when support for flashing ATA disks was added.

  8. Add a new camcontrol(8) "opcodes" subcommand, and use the
     underlying code to get recommended timeout values for drive
     firmware downloads.

     Many SCSI devices support the REPORT SUPPORTED OPERATION CODES
     command, and some support the optional timeout descriptor that
     specifies nominal and recommended timeouts for the commands
     supported by the device.

     The new camcontrol opcodes subcommand allows displaying all
     opcodes supported by a drive, information about which fields
     in a SCSI CDB are actually used by a given SCSI device, and the
     nominal and recommended timeout values for each command.

     Since firmware downloads can take a long time in some devices, and
     the time varies greatly between different types of devices, take
     advantage of the infrastructure used by the camcontrol opcodes
     subcommand to determine the best timeout to use for the WRITE
     BUFFER command in SCSI device firmware downloads.

     If the device recommends a timeout, it is likely to be more
     accurate than the default 50 second timeout used by the firmware
     download code.  If the user specifies a timeout, it will override
     the default or device recommended timeout.  If the device doesn't
     support timeout descriptors, we fall back to the default.

  9. Instead of downloading firmware to SATA drives behind a SAS controller
     using WRITE BUFFER, use the SCSI ATA PASS-THROUGH command to compose
     an ATA DOWNLOAD MICROCODE command and it to the drive.  The previous
     version of this code attempted to send a SCSI WRITE BUFFER command to
     SATA drives behind a SAS controller.  Although that is part of the
     SAT-3 spec, it doesn't work with the parameters used with LSI
     controllers at least.

  10.Add a new mechanism for making common ATA passthrough and
     ATA-behind-SCSI passthrough commands.

     The existing camcontrol(8) ATA command mechanism checks the device
     type on every command executed.  That works fine for individual
     commands, but is cumbersome for things like a firmware download
     that send a number of commands.

     The fwdownload code detects the device type up front, and then
     sends the appropriate commands.

  11.In simulation mode (-s), if the user specifies the -v flag, print out
     the SCSI CDB or ATA registers that would be sent to the drive.  This will
     aid in debugging any firmware download issues.

  sbin/camcontrol/fwdownload.c:
   Add a device type to the fw_vendor structure, so that we can
   specify different download methods for different devices from the
   same vendor.  In this case, IBM hard drives (from when they
   still made hard drives) and tape drives.

   Add a tur_status field to the fw_vendor structure so that we can
   specify whether the drive to be upgraded should be ready, not
   ready, or whether it doesn't matter.  Add the corresponding
   capability in fw_download_img().

   Add comments describing each of the vendor table fields.

   Add HGST and SmrtStor to the supported SCSI vendors list.

   In fw_get_vendor(), look at ATA identify data if we have a SATA
   device to try to identify what the drive vendor is.

   Add IBM firmware file validation.  This gets VPD page 0x3, and
   compares the Load ID and RU name in the page to the values
   included in the header.  The validation code will refuse to load
   a firmware file if the values don't match.  This does allow the
   user to attempt a downgrade; whether or not it succeeds will
   likely depend on the drive settings.

   Add a -q option, and disable all informative output
   (progress bars, etc.) when this is enabled.

   Re-add the inquiry in the confirmation dialog so the user has
   a better idea of which device he is talking to.  Add support for
   displaying ATA identify data.

   Don't automatically disable confirmation in simulation (-s) mode.
   This allows the user to see the inquiry or identify data in the
   dialog, and see exactly what they would see when the command
   actually runs.  Also, in simulation mode, if the user specifies
   the -v flag, print out the SCSI CDB or ATA registers that would
   be sent to the drive.  This will aid in debugging any firmware
   download issues.

   Add a timeout field and timeout type to the firmware download
   vendor table.  This allows specifying a default timeout and allows
   specifying whether we should attempt to probe for a recommended
   timeout from the drive.

   Add a new fuction, fw_get_timeout(), that will determine
   which timeout to use for the WRITE BUFFER command.  If the
   user specifies a timeout, we always use that.  Otherwise,
   we will use the drive recommended timeout, if available,
   and fall back to the default when a drive recommended
   timeout isn't available.

   When we prompt the user, tell him what timeout we're going
   to use, and the source of the timeout.

   Revamp the way SATA devices are handled.

   In fwdownload(), use the new get_device_type() function to
   determine what kind of device we're talking to.

   Allow firmware downloads to any SATA device, but restrict
   SCSI downloads to known devices.  (The latter is not a
   change in behavior.)

   Break out the "ready" check from fw_download_img() into a
   new subfunction, fw_check_device_ready().  This sends the
   appropriate command to the device in question -- a TEST
   UNIT READY or an IDENTIFY.  The IDENTIFY for SATA devices
    a SAT layer is done using the SCSI ATA PASS-THROUGH
   command.

   Use the new build_ata_cmd() function to build either a SCSI or
   ATA I/O CCB to issue the DOWNLOAD MICROCODE command to SATA
   devices.  build_ata_cmd() figures looks at the devtype argument
   and fills in the correct CCB type and CDB or ATA registers.

   Revamp the vendor table to remove the previous
   vendor-specific ATA entries and use a generic ATA vendor
   placeholder.  We currently use the same method for all ATA
   drives, although we may have to add vendor-specific
   behavior once we test this with more drives.

  sbin/camcontrol/progress.c:
   In progress_draw(), make barlength a signed value so that
   we can easily detect a negative value.

   If barlength (the length of the progress bar) would wind up
   negative due to a small TTY width or a large filename,
   set the bar length to the new minimum (10 stars) and
   truncate the user's filename.  We will truncate it down to
   0 characters if necessary.

   Calculate a new prefix_len variable (user's filename length)
   and use it as the precision when printing the filename.

  sbin/camcontrol/camcontrol.c:
   Implement a new camcontrol(8) subcommand, "opcodes".  The
   opcodes subcommand allows displaying the entire list of
   SCSI commands supported by a device, or details on an
   individual command.  In either case, it can display
   nominal and recommended timeout values.

   Add the scsiopcodes() function, which calls the new
   scsigetopcodes() function to fetch opcode data from a
   drive.

   Add two new functions, scsiprintoneopcode() and
   scsiprintopcodes(), which print information about one
   opcode or all opcodes, respectively.

   Remove the get_disk_type() function.  It is no longer used.

   Add a new function, dev_has_vpd_page(), that fetches the
   supported INQUIRY VPD list from a device and tells the
   caller whether the requested VPD page is available.

   Add a new function, get_device_type(), that returns a more
   precise device type than the old get_disk_type() function.
   The get_disk_type() function only distinguished between
   SCSI and ATA devices, and SATA devices behind a SCSI to ATA
   translation layer were considered to be "SCSI".

   get_device_type() offers a third type, CC_DT_ATA_BEHIND_SCSI.
   We need to know this to know whether to attempt to send ATA
   passthrough commands.  If the device has the ATA
   Information VPD page (0x89), then it is an ATA device
   behind a SCSI to ATA translation layer.

   Remove the type argument from the fwdownload() subcommand.

   Add a new function, build_ata_cmd(), that will take one set
   of common arguments and build either a SCSI or ATA I/O CCB,
   depending on the device type passed in.

  sbin/camcontrol/camcontrol.h:
   Add a prototype for scsigetopcodes().

   Add a new enumeration, camcontrol_devtype.

   Add prototypes for dev_has_vpd_page(), get_device_type()
   and build_ata_cmd().

   Remove the type argument from the fwdownload() subcommand.

  sbin/camcontrol/camcontrol.8
   Explain that the fwdownload subcommand will use the drive
   recommended timeout if available, and that the user can
   override the timeout.

   Document the new opcodes subcommand.

   Explain that we will attempt to download firmware to any
   SATA device.

   Document supported SCSI vendors, and models tested if known.

   Explain the commands used to download firmware for the
   three different drive and controller combinations.

   Document that the -v flag in simulation mode for the fwdownload
   subcommand will print out the SCSI CDBs or ATA registers that would
   be used.

  sys/cam/scsi/scsi_all.h:
   Add new bit definitions for the one opcode descriptor for
   the REPORT SUPPORTED OPCODES command.

   Add a function prototype for scsi_report_supported_opcodes().

  sys/cam/scsi/scsi_all.c:
   Add a new CDB building function, scsi_report_supported_opcodes().

Sponsored by: Spectra Logic

git-svn-id: svn://svn.freebsd.org/base/stable/10@287203 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r286975:
kib [Thu, 27 Aug 2015 09:06:14 +0000 (09:06 +0000)]
MFC r286975:
Remove the wrong asserts.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287199 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r286737:
delphij [Thu, 27 Aug 2015 01:02:01 +0000 (01:02 +0000)]
MFC r286737:

Plug a memory leak.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287184 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r286886: Fixing typo as well as improving readability of a few comments.
avatar [Wed, 26 Aug 2015 22:59:58 +0000 (22:59 +0000)]
MFC r286886: Fixing typo as well as improving readability of a few comments.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287180 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r286926:
np [Wed, 26 Aug 2015 01:41:55 +0000 (01:41 +0000)]
MFC r286926:

cxgbe(4):  Save the flags for the last adapter-wide synchronized
operation that was initiated successfully.  (The caller and thread are
already recorded).

git-svn-id: svn://svn.freebsd.org/base/stable/10@287149 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC: Fix OpenSSH multiple vulnerabilities.
delphij [Tue, 25 Aug 2015 20:48:44 +0000 (20:48 +0000)]
MFC: Fix OpenSSH multiple vulnerabilities.

Security: FreeBSD-SA-15:22.openssh

git-svn-id: svn://svn.freebsd.org/base/stable/10@287144 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC: r286265, r286293, r286328
jkim [Tue, 25 Aug 2015 19:18:38 +0000 (19:18 +0000)]
MFC: r286265, r286293, r286328

Always define __va_list for amd64 and restore pre-r232261 behavior for i386.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287139 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r286808, r286809, r286867, r286868
marcel [Tue, 25 Aug 2015 15:14:50 +0000 (15:14 +0000)]
MFC r286808, r286809, r286867, r286868

-   Improve support for Macs that have a stride not equal to the
    horizonal resolution (width).
-   Support frame buffers that are larger than the default screen
    size.
-   Support large frame buffers: add 24 more page table pages we
    allocate on boot-up.

PR: 193745

git-svn-id: svn://svn.freebsd.org/base/stable/10@287128 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r286667 & r286723
marcel [Tue, 25 Aug 2015 14:39:40 +0000 (14:39 +0000)]
MFC r286667 & r286723

Better support memory mapped console devices, such as VGA and EFI
frame buffers and memory mapped UARTs.

PR: 191564, 194952, 202276

git-svn-id: svn://svn.freebsd.org/base/stable/10@287126 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r286660, r286419, r286417, r286395, r286215, r284883
marcel [Tue, 25 Aug 2015 04:03:51 +0000 (04:03 +0000)]
MFC r286660, r286419, r286417, r286395, r286215, r284883

-   Add the ntfs alias
-   Fix the dynamic VHD format to work with qemu
-   Update manpage

MFH:
Differential Revision:

git-svn-id: svn://svn.freebsd.org/base/stable/10@287122 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f