]> CyberLeo.Net >> Repos - FreeBSD/stable/9.git/log
FreeBSD/stable/9.git
8 years agoMFC r287981:
bdrewery [Sat, 3 Oct 2015 16:25:47 +0000 (16:25 +0000)]
MFC r287981:

  Replace afterinstall: hack from r111083 with 'make delete-old' functionality.

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

8 years agoUpdate BIND to 9.9.8
erwin [Sat, 3 Oct 2015 09:33:29 +0000 (09:33 +0000)]
Update BIND to 9.9.8

See release notes for notable changes:
https://kb.isc.org/article/AA-01305

Note this is a direct commit to stable/9 as BIND is no longer in head.

Sponsored by: DK Hostmaster A/S

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

8 years agoFix a regression with SA-15:24 patch that prevented NIS from
delphij [Fri, 2 Oct 2015 16:36:16 +0000 (16:36 +0000)]
Fix a regression with SA-15:24 patch that prevented NIS from
working.

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

8 years agoMFC r288381:
bdrewery [Fri, 2 Oct 2015 16:22:24 +0000 (16:22 +0000)]
MFC r288381:

  All supported releases have the -m support from r186678, so remove the
  mention of it and reword this a bit to remove 'you'.

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

8 years agoMFC r288380:
bdrewery [Fri, 2 Oct 2015 16:21:25 +0000 (16:21 +0000)]
MFC r288380:

  Document the post-merge actions of calling tzsetup(8) and services_mkdb(8)
  added in r259134.

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

8 years agoMFC r281787
vangyzen [Fri, 2 Oct 2015 15:07:02 +0000 (15:07 +0000)]
MFC r281787

dmesg: accommodate message buffer growth between the sysctl calls

Allocate 12.5% extra space to avoid ENOMEM when the message buffer
is growing steadily.

Reported by:    Steve Wahl <steve_wahl@dell.com> (and tested)
Approved by:    kib (mentor until recently)
Obtained from:  Dell Inc.

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

8 years agoMFC r280793
vangyzen [Fri, 2 Oct 2015 14:16:37 +0000 (14:16 +0000)]
MFC r280793

pmcstat.8: The -m flag requires the -R flag.

Approved by:    kib (mentor until recently)
Sponsored by:   Dell Inc.

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

8 years agoMFC 286177:
jhb [Thu, 1 Oct 2015 21:57:15 +0000 (21:57 +0000)]
MFC 286177:
Fix a couple of markup typos.

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

8 years agoMFC 286256:
jhb [Thu, 1 Oct 2015 21:54:43 +0000 (21:54 +0000)]
MFC 286256:
kgdb uses td_oncpu to determine if a thread is running and should use
a pcb from stoppcbs[] rather than the thread's PCB.  However, exited threads
retained td_oncpu from the last time they ran, and newborn threads had their
CPU fields cleared to zero during fork and thread creation since they are
in the set of fields zeroed when threads are setup.  To fix, explicitly
update the CPU fields for exiting threads in sched_throw() to reflect the
switch out and reset the CPU fields for new threads in sched_fork_thread()
to NOCPU.

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

8 years agoMFC 283121:
jhb [Thu, 1 Oct 2015 20:49:10 +0000 (20:49 +0000)]
MFC 283121:
Use the proper mask when reloading sampling PMCs for Core CPUs.

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

8 years agoRegenerate after r280421.
bdrewery [Tue, 29 Sep 2015 21:55:45 +0000 (21:55 +0000)]
Regenerate after r280421.

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

8 years agoMFC r287935:
bdrewery [Tue, 29 Sep 2015 21:52:32 +0000 (21:52 +0000)]
MFC r287935:

  Optimize makeman slightly by removing uneeded cat and extra test -s.

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

8 years agoMFC r287979:
bdrewery [Tue, 29 Sep 2015 21:48:51 +0000 (21:48 +0000)]
MFC r287979:

  Remove redundant beforeinstall.

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

8 years agoDocument SA-15:24.
gjb [Tue, 29 Sep 2015 19:14:52 +0000 (19:14 +0000)]
Document SA-15:24.

Sponsored by: The FreeBSD Foundation

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

8 years agoMFC r287151,r287152,r287153,r287155:
bdrewery [Tue, 29 Sep 2015 18:46:39 +0000 (18:46 +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.

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

8 years agoMFC r284383,r284477,r284600,r284601:
bdrewery [Tue, 29 Sep 2015 18:33:17 +0000 (18:33 +0000)]
MFC r284383,r284477,r284600,r284601:

    Latest clang uses openat(2).
    Bump the version since we now handle openat
    filemon_pid_check needs to hold proctree_lock
    sx_sunlock for sx_slock

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

8 years agoThe Sun RPC framework uses a netbuf structure to represent the
delphij [Tue, 29 Sep 2015 18:06:27 +0000 (18:06 +0000)]
The Sun RPC framework uses a netbuf structure to represent the
transport specific form of a universal transport address.  The
structure is expected to be opaque to consumers.  In the current
implementation, the structure contains a pointer to a buffer
that holds the actual address.

In rpcbind(8), netbuf structures are copied directly, which would
result in two netbuf structures that reference to one shared
address buffer.  When one of the two netbuf structures is freed,
access to the other netbuf structure would result in an undefined
result that may crash the rpcbind(8) daemon.

Fix this by making a copy of the buffer that is going to be freed
instead of doing a shallow copy.

Security: FreeBSD-SA-15:24.rpcbind
Security: CVE-2015-7236

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

8 years agoMFC r287978:
bdrewery [Tue, 29 Sep 2015 17:05:12 +0000 (17:05 +0000)]
MFC r287978:

  Fix LIBRARIES_ONLY

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

8 years agoMFC r288092:
bdrewery [Tue, 29 Sep 2015 17:02:27 +0000 (17:02 +0000)]
MFC r288092:

  Avoid adding duplicates into OBJS.  bsd.lib.mk already handles adding entries
  to OBJS based on SRCS.

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

8 years agoMFC r287819: Make CAM log errors that make it wait.
mav [Tue, 29 Sep 2015 05:24:16 +0000 (05:24 +0000)]
MFC r287819: Make CAM log errors that make it wait.

Waiting can take minutes, and it would be good for user to know what is
going on.

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

8 years agoMFC r287747: Add ID for Intel Panther Point KT Controller
mav [Sun, 27 Sep 2015 01:20:55 +0000 (01:20 +0000)]
MFC r287747: Add ID for Intel Panther Point KT Controller

Found on ASUS P8Q77-M motherboard.

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

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

8 years agoMFC r287650:
delphij [Fri, 25 Sep 2015 01:17:52 +0000 (01:17 +0000)]
MFC r287650:

Use strlcpy() in favor of strncpy() as it's defined to have a nul character
at the end of string buffer, and the code context do expects this to behave
correctly (e.g. strchr).

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

8 years agoMFC r283929: Correct grdc(1) 12-hour display between 12:00 and 13:00
emaste [Thu, 24 Sep 2015 19:42:32 +0000 (19:42 +0000)]
MFC r283929: Correct grdc(1) 12-hour display between 12:00 and 13:00

PM starts at 12:00, not 13:00.

PR: 194291, 200133
Submitted by: Nick Price

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

8 years agoMFC r287886:
smh [Thu, 24 Sep 2015 09:35:35 +0000 (09:35 +0000)]
MFC r287886:

Fix kqueue write events for files > 2GB

Relnotes: YES
Sponsored by: Multiplay

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

8 years agoMFC r287541:
dim [Tue, 22 Sep 2015 22:35:42 +0000 (22:35 +0000)]
MFC r287541:

In libz's inflateMark(), avoid left-shifting a negative integer, which
is undefined.

Reviewed by: delphij
Differential Revision: https://reviews.freebsd.org/D3344

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

8 years agoMFC r286733:
dim [Tue, 22 Sep 2015 22:27:45 +0000 (22:27 +0000)]
MFC r286733:

Avoid left-shifting negative signed values in bxe(4).

Reviewed by: davidcs

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

8 years agoMFC r286702:
dim [Tue, 22 Sep 2015 22:18:36 +0000 (22:18 +0000)]
MFC r286702:

In ipfw2, avoid left-shifting negative integers, which is undefined.
While here, make some other arguments to htonl(3) unsigned too.

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

8 years agoMFC r286699:
dim [Tue, 22 Sep 2015 22:07:42 +0000 (22:07 +0000)]
MFC r286699:

In gcc's libcpp, stop using the INTTYPE_MAXIMUM() macro, which relies on
undefined behavior.  The code used this macro to avoid problems on some
broken systems which define SSIZE_MAX incorrectly, but this is not
needed on FreeBSD, obviously.

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

8 years agoMFC r286891, r286893:
pfg [Thu, 17 Sep 2015 00:37:40 +0000 (00:37 +0000)]
MFC r286891, r286893:
calendar(1): add a few more dates to the Christian calendar

Bring some well established holidays that also happen to be legal
holidays in many Catholic countries.

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

8 years agoDocument EN-15:16, EN-15:17, EN-15:18.
gjb [Wed, 16 Sep 2015 23:33:12 +0000 (23:33 +0000)]
Document EN-15:16, EN-15:17, EN-15:18.

Sponsored by: The FreeBSD Foundation

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

8 years agoMFC r287238:
yongari [Wed, 16 Sep 2015 00:45:48 +0000 (00:45 +0000)]
MFC r287238:
  Set DMA alignment constraint of status, TX and RX LEs(List Elements
  in Marvell terms) to 32768.  32768 looks overkill but it will
  ensure correct DMAed update.  This change addresses occasional
  watchdog timeouts reported on 10.2-RELEASE.

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

8 years agoFix build with gcc
bapt [Tue, 15 Sep 2015 08:34:32 +0000 (08:34 +0000)]
Fix build with gcc

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

8 years agoMFC: r281039
bapt [Tue, 15 Sep 2015 06:22:50 +0000 (06:22 +0000)]
MFC: r281039

Allow fetching pkg(8) even if servers/proxies are not passing Content-length

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

8 years agoMFC: r287579, r287810 (adapted to old openssl APIs)
bapt [Tue, 15 Sep 2015 06:21:33 +0000 (06:21 +0000)]
MFC: r287579, r287810 (adapted to old openssl APIs)

Implement pubkey support for the bootstrap

Note that to not interfer with finger print it expects a signature on pkg itself
which is named pkg.txz.pubkeysign

To generate it:
echo -n "$(sha256 -q pkg.txz)" | openssl dgst -sha256 -sign /thekey \
    -binary -out ./pkg.txz.pubkeysig

Note the "echo -n" which prevent signing the '\n' one would get otherwise

PR: 202622

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

8 years agoMFC r287320:
delphij [Mon, 14 Sep 2015 18:58:30 +0000 (18:58 +0000)]
MFC r287320:
 - uri is expected to be nul-terminated (strchr used later),
   so use strlcpy instead of strncpy.
 - replace the other two cases of strncpy+\0 with strlcpy.

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

8 years agoMFC r286887: Using the error return code documented in the comment.
avatar [Mon, 14 Sep 2015 15:47:20 +0000 (15:47 +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/9@287787 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r286798 and r286827:
ed [Mon, 14 Sep 2015 09:31:00 +0000 (09:31 +0000)]
MFC r286798 and r286827:

  Stop parsing digits if the value already exceeds UINT_MAX / 100.

  There is no need for us to support parsing values that are larger than
  the maximum terminal window size. In this case that would be the maximum
  of unsigned short.

  The problem with parsing larger values is that they can cause integer
  overflows when adjusting the cursor position, leading to all sorts of
  failing assertions.

MFC r286981 and r287098:

  Don't truncate cursor arithmetic to 16 bits.

  When updating the row number when the cursor position escape sequence is
  issued, we should make sure to store the intermediate result in a 32-bit
  integer. If we fail to do this, the cursor may be set above the origin
  region, which is bad.

  This could cause libteken to crash when INVARIANTS is enabled, due to
  the strict set of assertions that libteken has.

PR: 202326, 202540, 202612
Submitted by: kwcu csie org

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

8 years agoMFC r287100: spa_import_rootpool: prevent lock and resource leak
avg [Fri, 11 Sep 2015 13:32:55 +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/9@287668 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287099: account for ashift when gathering buffers to be written to
avg [Fri, 11 Sep 2015 12:59:16 +0000 (12:59 +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/9@287666 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:43:31 +0000 (12:43 +0000)]
MFC r285021: zfs_mount(MS_REMOUNT): protect zfs_(un)register_callbacks calls

git-svn-id: svn://svn.freebsd.org/base/stable/9@287662 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:38:21 +0000 (12:38 +0000)]
MFC r286985: try to fix lor between z_teardown_lock and spa_namespace_lock

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

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

git-svn-id: svn://svn.freebsd.org/base/stable/9@287657 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/9@287637 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC 283281,283282,283562,286158:
jhb [Wed, 9 Sep 2015 23:41:24 +0000 (23:41 +0000)]
MFC 283281,283282,283562,286158:
Various fixes to orphan handling which also fix issues with following
forks.  Unlike the changes in HEAD, this merge does not include the
changes to the ATF ptrace test since ATF is not present in 9.

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.

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().

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.

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

8 years agoMFC 269656,270024,270443,270993:
jhb [Wed, 9 Sep 2015 23:05:52 +0000 (23:05 +0000)]
MFC 269656,270024,270443,270993:
Fix problems with orphan handling.  Note that to preserve KBI, p_treeflag
has been added to the end of struct proc and is explicitly zero'd during
fork.

269656:
Correct the problems with the ptrace(2) making the debuggee an orphan.
One problem is inferior(9) looping due to the process tree becoming a
graph instead of tree if the parent is traced by child. Another issue
is due to the use of p_oppid to restore the original parent/child
relationship, because real parent could already exited and its pid
reused (noted by mjg).

Add the function proc_realparent(9), which calculates the parent for
given process. It uses the flag P_TREE_FIRST_ORPHAN to detect the head
element of the p_orphan list and than stepping back to its container
to find the parent process. If the parent has already exited, the
init(8) is returned.

Move the P_ORPHAN and the new helper flag from the p_flag* to new
p_treeflag field of struct proc, which is protected by proctree lock
instead of proc lock, since the orphans relationship is managed under
the proctree_lock already.

The remaining uses of p_oppid in ptrace(PT_DETACH) and process
reapping are replaced by proc_realparent(9).

270024:
Correct the order of arguments passed to LIST_INSERT_AFTER().

270443:
Properly reparent traced processes when the tracer dies.

Previously they were uncoditionally reparented to init. In effect
it was possible that tracee was never returned to original parent.

270993:
Fix up proc_realparent to always return correct process.

Prior to the change it would always return initproc for non-traced
processes.

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

8 years agoMFC r286888: Using consistent coding style to deal with error inside the loop.
avatar [Wed, 9 Sep 2015 04:16:48 +0000 (04:16 +0000)]
MFC r286888: Using consistent coding style to deal with error inside the loop.

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

8 years agoMFC r287093:
delphij [Tue, 8 Sep 2015 01:46:52 +0000 (01:46 +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/9@287548 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287345:
delphij [Fri, 4 Sep 2015 00:42:05 +0000 (00:42 +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/9@287447 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/9@287439 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/9@287435 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC 248705,253812,253813:
jhb [Thu, 3 Sep 2015 16:38:26 +0000 (16:38 +0000)]
MFC 248705,253812,253813:
- Unlock IPMI sc while performing requests via KCS and SMIC interfaces.
- empirical testing showed that 3 seconds is just too slow for GET_DEVICE_ID
  to return on newer Dell hardware.  Bump to 6 second timeouts until someone
  has a better idea on how to handle this
- Check for ipmi_attached in ipmi_isa_probe as a suggested alternative to
  ipmi_isa_attach.  This keeps unintended but harmless noise about "ipmi1"
  from appearing in the boot up sequence.

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

8 years agoDocument SA-15:23.
gjb [Wed, 2 Sep 2015 21:13:06 +0000 (21:13 +0000)]
Document SA-15:23.

Sponsored by: The FreeBSD Foundation

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

8 years agoFix remote denial of service vulnerability when parsing malformed
delphij [Wed, 2 Sep 2015 20:06:46 +0000 (20:06 +0000)]
Fix remote denial of service vulnerability when parsing malformed
key.

Fix remote denial of service vulnerability caused by an incorrect
boundary check in openpgpkey_61.c.

Security: CVE-2015-5722, FreeBSD-SA-15:23.bind
Security: CVE-2015-5986

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

8 years agoMFC r286886: Fixing typo as well as improving readability of a few comments.
avatar [Sat, 29 Aug 2015 11:15:58 +0000 (11:15 +0000)]
MFC r286886: Fixing typo as well as improving readability of a few comments.

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

8 years agoMFC r286799:
hselasky [Sat, 29 Aug 2015 06:17:39 +0000 (06:17 +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/9@287273 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r286720:
ae [Fri, 28 Aug 2015 12:02:40 +0000 (12:02 +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/9@287252 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r286169:
markj [Thu, 27 Aug 2015 23:46:45 +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/9@287228 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/9@287210 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/9@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/9@287139 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoInstant-MFC r286933:
delphij [Wed, 19 Aug 2015 18:33:25 +0000 (18:33 +0000)]
Instant-MFC r286933:

Issue warning and refuse to proceed further if the configured
repository signature_type is unsupported by bootstrap pkg(7).

Previously, when signature_type specified an unsupported method,
the bootstrap pkg(7) would proceed like when signature_type is
"none".  MITM attackers may be able to use this vulnerability and
bypass validation and install their own versions of pkg(8).

At this time, only fingerprint and none are supported by the
bootstrap pkg(7).

FreeBSD's official pkg(8) repository uses the fingerprint method
and is therefore unaffected.

Errata candidate.

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

8 years agoRemove a broken link.
gjb [Wed, 19 Aug 2015 17:51:03 +0000 (17:51 +0000)]
Remove a broken link.
While here, prefer https where possible.

Sponsored by: The FreeBSD Foundation

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

8 years agoDocument SA-15:20, EN-15:11, EN-15:12, EN-15:13.
gjb [Tue, 18 Aug 2015 20:27:03 +0000 (20:27 +0000)]
Document SA-15:20, EN-15:11, EN-15:12, EN-15:13.

Sponsored by: The FreeBSD Foundation

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

8 years agoFix multiple integer overflows in expat.
delphij [Tue, 18 Aug 2015 19:30:05 +0000 (19:30 +0000)]
Fix multiple integer overflows in expat.

Security: CVE-2015-1283
Security: FreeBSD-SA-15:20.expat

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

8 years agoMFC r286719: Revert part of r280687, reporting "1" (true) for empty value.
mav [Sun, 16 Aug 2015 00:39:44 +0000 (00:39 +0000)]
MFC r286719: Revert part of r280687, reporting "1" (true) for empty value.

For example, it made gpart partitions without label report "1" as label.

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

8 years agoMFC of 286750,tzdata9:
edwin [Fri, 14 Aug 2015 00:00:24 +0000 (00:00 +0000)]
MFC of 286750,tzdata9:

Update to tzdata2015f:

Changes affecting future time stamps

    North Korea switches to +0830 on 2015-08-15.  (Thanks to Steffen Thorsen.)
    The abbreviation remains "KST".  (Thanks to Robert Elz.)
    Uruguay no longer observes DST.  (Thanks to Steffen Thorsen and Pablo Camargo.)
    Changes affecting past and future time stamps
    Moldova starts and ends DST at 00:00 UTC, not at 01:00 UTC. (Thanks to Roman Tudos.)

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

8 years agoMFC r276282: Support ALT_BREAK_TO_DEBUGGER in vt(4)
emaste [Thu, 13 Aug 2015 19:51:21 +0000 (19:51 +0000)]
MFC r276282: Support ALT_BREAK_TO_DEBUGGER in vt(4)

PR: 196511

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

8 years agoMFC r286074:
pfg [Thu, 13 Aug 2015 01:04:26 +0000 (01:04 +0000)]
MFC r286074:
GCC: Add a new option "-fstack-protector-strong"

This includes additional functions to be protected: those that
have local array definitions, or have references to local frame
addresses. This is a new option in GCC-4.9 that was relicensed
by Han Shen from Google under GPLv2.

Obtained from: OpenBSD (2014-01-14)

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

8 years agoMFC r286519:
dim [Wed, 12 Aug 2015 19:18:54 +0000 (19:18 +0000)]
MFC r286519:

In GNU as, avoid left-shifting negative integers, which is undefined.

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

8 years agoMFC r286515:
dim [Wed, 12 Aug 2015 19:06:35 +0000 (19:06 +0000)]
MFC r286515:

In libm's exp2(3), avoid left-shifting a negative integer, which is
undefined.  Replace it with the intended value, in a defined way.

Reviewed by: bde

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

8 years agoMFC: r285260
rmacklem [Mon, 10 Aug 2015 22:30:13 +0000 (22:30 +0000)]
MFC: r285260
Since the case where secflavor < 0 indicates the security flavor is
to be negotiated, it could be a Kerberized mount. As such, filling
in the "principal" argument using the canonized host name makes sense.
If it is negotiated as AUTH_SYS, the "principal" argument is meaningless
but harmless.

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

8 years agoMFC: r285113
rmacklem [Mon, 10 Aug 2015 22:26:14 +0000 (22:26 +0000)]
MFC: r285113
If a "principal" argument isn't provided for a Kerberized NFS mount,
the kernel would generate a bogus one with a ":/<path>" suffix.
This would only occur for the case where there was no explicit
"principal" argument and the getaddrinfo() call in mount_nfs.c failed to a
return a cannonical name for the server.
This patch fixes this unusual case.

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

8 years agoMFC: r286046
rmacklem [Sun, 9 Aug 2015 22:33:51 +0000 (22:33 +0000)]
MFC: r286046
This patch fixes a problem where, if the NFSv4 server has a previous
unconfirmed clientid structure for the same client on the last hash list,
this old entry would not be removed/deleted. I do not think this bug would have
caused serious problems, since the new entry would have been before the old one
on the list. This old entry would have eventually been scavenged/removed.

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

8 years agoMFC: r284531
rmacklem [Sun, 9 Aug 2015 22:29:10 +0000 (22:29 +0000)]
MFC: r284531
Document that a forced dismount of an NFSv3 mount when the
NLM (rpc.lockd) is running can crash the system.
Unfortunately this is not easy to fix, but I have left
PR#200585 open.

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

8 years agoMFC: r283273
rmacklem [Sun, 9 Aug 2015 22:07:52 +0000 (22:07 +0000)]
MFC: r283273
The NFS client wasn't handling getdirentries(2) requests for sizes
that are not an exact multiple of DIRBLKSIZ correctly. Fortunately
readdir(3) always uses an exact multiple of DIRBLKSIZ, so few applications
were affected. This patch fixes this problem by reducing the size
of the directory read to an exact multiple of DIRBLKSIZ.

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

8 years agoMFC: Reminder to check tools/build/mk/OptionalObsoleteFiles.inc on new
gshapiro [Sat, 8 Aug 2015 16:33:32 +0000 (16:33 +0000)]
MFC: Reminder to check tools/build/mk/OptionalObsoleteFiles.inc on new
     version imports.

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

8 years agoMFC r286375:
delphij [Thu, 6 Aug 2015 19:53:41 +0000 (19:53 +0000)]
MFC r286375:

Remove INDEX-8 (and INDEX-7) as they are EoL'ed.

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

8 years agoDocument SA-15:18, SA-15:19.
gjb [Wed, 5 Aug 2015 22:30:49 +0000 (22:30 +0000)]
Document SA-15:18, SA-15:19.

Sponsored by: The FreeBSD Foundation

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

8 years agoFix routed remote denial of service vulnerability. [SA-15:19]
delphij [Wed, 5 Aug 2015 22:05:07 +0000 (22:05 +0000)]
Fix routed remote denial of service vulnerability. [SA-15:19]

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

8 years agoMFC r285720:
pfg [Wed, 5 Aug 2015 18:55:26 +0000 (18:55 +0000)]
MFC r285720:
libusb: Fix minor warning.

Fix a warning triggered by the gcc + FORTIFY_SOURCE patches:

In function 'libusb20_parse_config_desc': lib/libusb/libusb20_desc.c:141:
warning: passing argument 1 of 'memcpy' discards qualifiers from pointer
target type

Submitted by: hselansky

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

8 years agoMFC r285973
davidcs [Wed, 5 Aug 2015 02:19:38 +0000 (02:19 +0000)]
MFC r285973
      - Avoid lock contention in the if_transmit callback by using trylock and
       enqueueing the frames when it fails. This way there is some latency
       removed from the transmitting path.
      - If IFF_DRV_OACTIVE is set (and also if IFF_DRV_RUNNING is not) just
       enqueue the desired frames and return successful transmit. This way we
       avoid to return errors on transmit side and resulting in
       possible out-of-order frames. Please note that IFF_DRV_OACTIVE is set
       everytime we get the threshold ring hit, so this can be happening quite
       often.

Submitted by: Attilio.Rao@isilon.com

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

8 years agoMFC r286102:
pfg [Tue, 4 Aug 2015 03:07:06 +0000 (03:07 +0000)]
MFC r286102:
Buffer overflow in wall(1).

This affected syslogd, wall and talkd.
Detected by FORTIFY_SOURCE GSoC (with clang).

Submitted by: Oliver Pinter
Differential Revision: https://reviews.freebsd.org/D3254
Reviewed by: delphij, jmg

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

8 years agoMFC r285869.
dru [Mon, 3 Aug 2015 17:02:36 +0000 (17:02 +0000)]
MFC r285869.
Fix transposed words in man page.

PR: 201752
Reviewed by: gjb

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

8 years agoMFC r286092:
gjb [Mon, 3 Aug 2015 16:30:03 +0000 (16:30 +0000)]
MFC r286092:
  Fix a rendering issue in the zfs(8) manual.

Sponsored by: The FreeBSD Foundation

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

8 years agoMFC r286207:
ae [Sun, 2 Aug 2015 16:29:30 +0000 (16:29 +0000)]
MFC r286207:
  Report the scheme and provider names in warning message about unaligned
  partition.

  PR: 201873

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

8 years agoUpdate BIND to 9.9.7-P2
erwin [Fri, 31 Jul 2015 11:10:43 +0000 (11:10 +0000)]
Update BIND to 9.9.7-P2

This is a direct commit to stable/9 as BIND is no longer in head.

Sponsored by: DK Hostmaster A/S

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

8 years agoMFC: r285839
marius [Thu, 30 Jul 2015 02:06:34 +0000 (02:06 +0000)]
MFC: r285839

o Revert the other functional half of r239864 (MFCed to stable/9 in r241681),
  i. e. the merge of r134227 from x86 to use smp_ipi_mtx spin lock not only
  for smp_rendezvous_cpus() but also for the MD cache invalidation, TLB
  demapping and remote register reading IPIs due to the following reasons:
  - The cross-IPI SMP deadlock x86 otherwise is subject to can't happen on
    sparc64. That's because on sparc64, spin locks don't disable interrupts
    completely but only raise the processor interrupt level to PIL_TICK. This
    means that IPIs still get delivered and direct dispatch IPIs such as the
    cache invalidation etc. IPIs in question are still executed.
  - In smp_rendezvous_cpus(), smp_ipi_mtx is held not only while sending an
    IPI_RENDEZVOUS, but until all CPUs have processed smp_rendezvous_action().
    Consequently, smp_ipi_mtx may be locked for an extended amount of time as
    queued IPIs (as opposed to the direct ones) such as IPI_RENDEZVOUS are
    scheduled via a soft interrupt. Moreover, given that this soft interrupt
    is only delivered at PIL_RENDEZVOUS, processing of smp_rendezvous_action()
    on a target may be interrupted by f. e. a tick interrupt at PIL_TICK, in
    turn leading to the target in question trying to send an IPI by itself
    while IPI_RENDEZVOUS isn't fully handled, yet, and, thus, resulting in a
    deadlock.
o As mentioned in the commit message of r245850, on least some sun4u platforms
  concurrent sending of IPIs by different CPUs is fatal. Therefore, hold the
  reintroduced MD ipi_mtx also while delivering cross-traps via MI helpers,
  i. e. ipi_{all_but_self,cpu,selected}().
o Akin to x86, let the last CPU to process cpu_mp_bootstrap() set smp_started
  instead of the BSP in cpu_mp_unleash(). This ensures that all APs actually
  are started, when smp_started is no longer 0.
o In all MD and MI IPI helpers, check for smp_started == 1 rather than for
  smp_cpus > 1 or nothing at all. This avoids races during boot causing IPIs
  trying to be delivered to APs that in fact aren't up and running, yet.
  While at it, move setting of the cpu_ipi_{selected,single}() pointers to
  the appropriate delivery functions from mp_init() to cpu_mp_start() where
  it's better suited and allows to get rid of the global isjbus variable.
o Given that now concurrent IPI delivery no longer is possible, also nuke
  the delays before completely disabling interrupts again in the CPU-specific
  cross-trap delivery functions, previously giving other CPUs a window for
  sending IPIs on their part. Actually, we now should be able to entirely get
  rid of completely disabling interrupts in these functions. Such a change
  needs more testing, though.
o In {s,}tick_get_timecount_mp(), make the {s,}tick variable static. While not
  necessary for correctness, this avoids page faults when accessing the stack
  of a foreign CPU as {s,}tick now is locked into the TLBs as part of static
  kernel data. Hence, {s,}tick_get_timecount_mp() always execute as fast as
  possible, avoiding jitter.

PR: 201245

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

8 years agoMFC: r284447, r284552
marius [Thu, 30 Jul 2015 00:28:32 +0000 (00:28 +0000)]
MFC: r284447, r284552

Merge from NetBSD:
o rev. 1.10: Nuke trailing whitespace.
o rev. 1.15: Fix typo in comment.
o rev. 1.16: Add the following registers from IEEE 802.3-2009 Clause 22:
 - PSE control register (0x0b)
 - PSE status register (0x0c)
 - MMD access control register (0x0d)
 - MMD access address data register (0x0e)
o rev. 1.17 (comments only): The bit location of link ability is different
  between 1000Base-X and others (see Annex 28B.2 and 28D).
o rev. 1.18: Nuke dupe word.

Obtained from: NetBSD
Sponsored by: genua mbh

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

8 years agoMerge r286033 from stable/10:
dim [Wed, 29 Jul 2015 19:37:32 +0000 (19:37 +0000)]
Merge r286033 from stable/10:

Reapply r286007, modified to compile with pre-C++11 compilers:

Pull in r219009 from upstream llvm trunk (by Adam Nemet):

  [ISel] Keep matching state consistent when folding during X86 address match

  In the X86 backend, matching an address is initiated by the 'addr' complex
  pattern and its friends.  During this process we may reassociate and-of-shift
  into shift-of-and (FoldMaskedShiftToScaledMask) to allow folding of the
  shift into the scale of the address.

  However as demonstrated by the testcase, this can trigger CSE of not only the
  shift and the AND which the code is prepared for but also the underlying load
  node.  In the testcase this node is sitting in the RecordedNode and MatchScope
  data structures of the matcher and becomes a deleted node upon CSE.  Returning
  from the complex pattern function, we try to access it again hitting an assert
  because the node is no longer a load even though this was checked before.

  Now obviously changing the DAG this late is bending the rules but I think it
  makes sense somewhat.  Outside of addresses we prefer and-of-shift because it
  may lead to smaller immediates (FoldMaskAndShiftToScale is an even better
  example because it create a non-canonical node).  We currently don't recognize
  addresses during DAGCombiner where arguably this canonicalization should be
  performed.  On the other hand, having this in the matcher allows us to cover
  all the cases where an address can be used in an instruction.

  I've also talked a little bit to Dan Gohman on llvm-dev who added the RAUW for
  the new shift node in FoldMaskedShiftToScaledMask.  This RAUW is responsible
  for initiating the recursive CSE on users
  (http://lists.cs.uiuc.edu/pipermail/llvmdev/2014-September/076903.html) but it
  is not strictly necessary since the shift is hooked into the visited user.  Of
  course it's safer to keep the DAG consistent at all times (e.g. for accurate
  number of uses, etc.).

  So rather than changing the fundamentals, I've decided to continue along the
  previous patches and detect the CSE.  This patch installs a very targeted
  DAGUpdateListener for the duration of a complex-pattern match and updates the
  matching state accordingly.  (Previous patches used HandleSDNode to detect the
  CSE but that's not practical here).  The listener is only installed on X86.

  I tested that there is no measurable overhead due to this while running
  through the spec2k BC files with llc.  The only thing we pay for is the
  creation of the listener.  The callback never ever triggers in spec2k since
  this is a corner case.

  Fixes rdar://problem/18206171

This fixes a possible crash in x86 code generation when compiling recent
llvm/clang trunk sources.

Direct commit to stable/10, since head already has llvm/clang 3.6.1,
which includes this fix.

Reported by: jonathan, theraven
Upstream PR: https://llvm.org/bugs/show_bug.cgi?id=24249

Merge r286034 from stable/10:

Add updated llvm patch corresponding to r286033.

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

8 years agoRevert r286007-r286009 for now, until I can figure out how to make the
dim [Wed, 29 Jul 2015 14:07:29 +0000 (14:07 +0000)]
Revert r286007-r286009 for now, until I can figure out how to make the
fix compile with older gcc and libstdc++.

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

8 years agoMerge r286007 from stable/10:
dim [Wed, 29 Jul 2015 13:14:34 +0000 (13:14 +0000)]
Merge r286007 from stable/10:

Pull in r219009 from upstream llvm trunk (by Adam Nemet):

  [ISel] Keep matching state consistent when folding during X86 address match

  In the X86 backend, matching an address is initiated by the 'addr' complex
  pattern and its friends.  During this process we may reassociate and-of-shift
  into shift-of-and (FoldMaskedShiftToScaledMask) to allow folding of the
  shift into the scale of the address.

  However as demonstrated by the testcase, this can trigger CSE of not only the
  shift and the AND which the code is prepared for but also the underlying load
  node.  In the testcase this node is sitting in the RecordedNode and MatchScope
  data structures of the matcher and becomes a deleted node upon CSE.  Returning
  from the complex pattern function, we try to access it again hitting an assert
  because the node is no longer a load even though this was checked before.

  Now obviously changing the DAG this late is bending the rules but I think it
  makes sense somewhat.  Outside of addresses we prefer and-of-shift because it
  may lead to smaller immediates (FoldMaskAndShiftToScale is an even better
  example because it create a non-canonical node).  We currently don't recognize
  addresses during DAGCombiner where arguably this canonicalization should be
  performed.  On the other hand, having this in the matcher allows us to cover
  all the cases where an address can be used in an instruction.

  I've also talked a little bit to Dan Gohman on llvm-dev who added the RAUW for
  the new shift node in FoldMaskedShiftToScaledMask.  This RAUW is responsible
  for initiating the recursive CSE on users
  (http://lists.cs.uiuc.edu/pipermail/llvmdev/2014-September/076903.html) but it
  is not strictly necessary since the shift is hooked into the visited user.  Of
  course it's safer to keep the DAG consistent at all times (e.g. for accurate
  number of uses, etc.).

  So rather than changing the fundamentals, I've decided to continue along the
  previous patches and detect the CSE.  This patch installs a very targeted
  DAGUpdateListener for the duration of a complex-pattern match and updates the
  matching state accordingly.  (Previous patches used HandleSDNode to detect the
  CSE but that's not practical here).  The listener is only installed on X86.

  I tested that there is no measurable overhead due to this while running
  through the spec2k BC files with llc.  The only thing we pay for is the
  creation of the listener.  The callback never ever triggers in spec2k since
  this is a corner case.

  Fixes rdar://problem/18206171

This fixes a possible crash in x86 code generation when compiling recent
llvm/clang trunk sources.

Direct commit to stable/10, since head already has llvm/clang 3.6.1,
which includes this fix.

Reported by: jonathan, theraven
Upstream PR: https://llvm.org/bugs/show_bug.cgi?id=24249

Merge r286008 from stable/10:

Add llvm patch corresponding to r286007.

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

8 years agoDocument SA-15:14 through SA-15:17.
gjb [Tue, 28 Jul 2015 20:38:52 +0000 (20:38 +0000)]
Document SA-15:14 through SA-15:17.

Sponsored by: The FreeBSD Foundation

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

8 years agoFix resource exhaustion in TCP reassembly. [SA-15:15]
delphij [Tue, 28 Jul 2015 19:58:54 +0000 (19:58 +0000)]
Fix resource exhaustion in TCP reassembly. [SA-15:15]

Fix OpenSSH multiple vulnerabilities. [SA-15:16]

Fix BIND remote denial of service vulnerability. [SA-15:17]

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

8 years agoMFC r285067: mfiutil: increase buffer size to accommodate sprintf string
emaste [Tue, 28 Jul 2015 12:40:09 +0000 (12:40 +0000)]
MFC r285067: mfiutil: increase buffer size to accommodate sprintf string

PR: 201289

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

8 years agoMFC r285340:
dim [Tue, 28 Jul 2015 09:19:04 +0000 (09:19 +0000)]
MFC r285340:

Fix swapped copyin(9) arguments in cxgb's iwch_arm_cq() function.
Detected by clang 3.7.0 with the warning:

sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_provider.c:309:18: error: variable
'rptr' is uninitialized when used here [-Werror,-Wuninitialized]
chp->cq.rptr = rptr;
       ^~~~

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

8 years agoMFC r285735:
ae [Tue, 28 Jul 2015 08:25:49 +0000 (08:25 +0000)]
MFC r285735:
  lseek() allows an offset to be set beyond the end of file. Using
  it to check that partition has enough space to write bootcode doesn't
  work. Use the known size of provider instead.

  PR: 201504

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

8 years agoMFC r285719:
pfg [Fri, 24 Jul 2015 19:26:06 +0000 (19:26 +0000)]
MFC r285719:
snmp_hostres(3): Fix buffer overflow.

Actually just a typo. Detected by gcc + FORTIFY_SOURCE patches.

CID: 1007594

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

8 years agoDocument FreeBSD-SA-15:13.
gjb [Wed, 22 Jul 2015 16:38:07 +0000 (16:38 +0000)]
Document FreeBSD-SA-15:13.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

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

8 years agoFix resource exhaustion due to sessions stuck in LAST_ACK state.
delphij [Tue, 21 Jul 2015 23:42:20 +0000 (23:42 +0000)]
Fix resource exhaustion due to sessions stuck in LAST_ACK state.

Security: CVE-2015-5358
Security: SA-15:13.tcp
Submitted by: Jonathan Looney (Juniper SIRT)
Reviewed by: lstewart

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

8 years agoMFC r285642
vangyzen [Tue, 21 Jul 2015 18:54:38 +0000 (18:54 +0000)]
MFC r285642

ssh: canonicize the host name before looking it up in the host file

Re-apply r99054 by des in 2002. This was accidentally dropped
by the update to OpenSSH 6.5p1 (r261320).

This change is actually taken from r387082 of
ports/security/openssh-portable/files/patch-ssh.c

Differential Revision: https://reviews.freebsd.org/D3103
PR:             198043
Approved by:    kib (mentor)
Sponsored by:   Dell Inc.
Relnotes:       yes

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