]> CyberLeo.Net >> Repos - FreeBSD/stable/9.git/log
FreeBSD/stable/9.git
8 years agoFix OpenSSL SSLv2 ciphersuite downgrade vulnerability.
delphij [Sat, 30 Jan 2016 06:09:38 +0000 (06:09 +0000)]
Fix OpenSSL SSLv2 ciphersuite downgrade vulnerability.

Security: CVE-2015-3197
Security: FreeBSD-SA-16:11.openssl

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

8 years agoMFC r294695:
pfg [Thu, 28 Jan 2016 02:21:20 +0000 (02:21 +0000)]
MFC r294695:
ext2fs: passthrough any extra timestamps to the dinode struct.

In general we don't trust any of the extended timestamps unless the
EXT2F_ROCOMPAT_EXTRA_ISIZE feature is set. However, in the case where
we freshly allocated a new inode the information is valid and it is
better to pass it along instead of leaving the value undefined.

This should have no practical effect but should reduce the amount of
garbage if EXT2F_ROCOMPAT_EXTRA_ISIZE is set, like in cases where the
filesystem is converted from ext3 to ext4.

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

8 years agoDocument SA-16:08, SA-16:09, SA-16:10.
gjb [Wed, 27 Jan 2016 14:12:10 +0000 (14:12 +0000)]
Document SA-16:08, SA-16:09, SA-16:10.

Sponsored by: The FreeBSD Foundation

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

8 years agoMFC r294900:
delphij [Wed, 27 Jan 2016 07:34:23 +0000 (07:34 +0000)]
MFC r294900:

Implement AT_SECURE properly.

AT_SECURE auxv entry has been added to the Linux 2.5 kernel to pass a
boolean flag indicating whether secure mode should be enabled. 1 means
that the program has changes its credentials during the execution.
Being exported AT_SECURE used by glibc issetugid() call.

Submitted by: imp, dchagin
Security: FreeBSD-SA-16:10.linux
Security: CVE-2016-1883

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

8 years agoMFC: r256940
jkim [Tue, 26 Jan 2016 21:35:47 +0000 (21:35 +0000)]
MFC: r256940

Allow users to set UUID in network byte order regardless of SMBIOS version.

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

8 years agoMFH (r261233): cleanup
des [Tue, 26 Jan 2016 07:44:26 +0000 (07:44 +0000)]
MFH (r261233): cleanup
MFH (r261234): increase buffer size
MFH (r280630): remove all traces of SSLv2 support
MFH (r285141): remove unused variable
MFH (r288217): correctly check return value from getaddrinfo(3)
MFH (r289419): fix bugs in HTTPS tunnelling
MFH (r289420): use fopen()'s "e" mode instead of fcntl for close-on-exec
MFH (r291453, r291461): use .netrc for http servers and proxies
MFH (r292330, r292332): reset bufpos to 0 after refilling in chunked mode

PR: 194483 199801 193740 204771

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

8 years agoMFstable/10 r294770:
ngie [Tue, 26 Jan 2016 06:39:11 +0000 (06:39 +0000)]
MFstable/10 r294770:

MFC r278047:

PR: 206622

r278047 (by amdmi3):

- Remove more files when MK_BSNMP == no

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

8 years agoRevert r279011:
pfg [Tue, 26 Jan 2016 05:04:36 +0000 (05:04 +0000)]
Revert r279011:
tdelete(3): don't delete the node we are about to return.

The original change, from NetBSD, was bogus; introduced a memory
leak and and broke POSIX. By reverting we actually match NetBSD's
latest revision.

This is a revert of the original merge: this function was rewritten
in 11-current.

Reported by: Markiyan Kushnir
Obtained from: NetBSD (CVS rev. 1.7, 1.8)

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

8 years agoMFC 288833:
jgh [Mon, 25 Jan 2016 20:04:06 +0000 (20:04 +0000)]
MFC 288833:

PR:           203440 (based on)
Submitted by: ceratv@rpi.edu
Approved by:  wblock@ (mentor)
Differential Revision:        https://reviews.freebsd.org/D3813

- address grammar

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

8 years agoFix mismerge in r294738. No MK_FAST_DEPEND on stable/9
bdrewery [Mon, 25 Jan 2016 17:40:53 +0000 (17:40 +0000)]
Fix mismerge in r294738. No MK_FAST_DEPEND on stable/9

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

8 years agoMFC r294370:
bdrewery [Mon, 25 Jan 2016 17:39:59 +0000 (17:39 +0000)]
MFC r294370:

  mkdep: Fix -include not being added for .depend tracking.

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

8 years agoMFstable/10 r294657:
ngie [Sun, 24 Jan 2016 06:20:57 +0000 (06:20 +0000)]
MFstable/10 r294657:

MFC r293073:

- Use attach_md instead of hardcoding md(4) provider unit numbers
- Implement a gmirror_test_cleanup function, which in turn calls
  geom_test_cleanup to clean up all md(4) providers allocated in the test
  run.
- Remove duplicate logic in test scripts for removing md(4) providers.
- Don't create files in /tmp (outside the kyua sandbox); use the current
  directory instead

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

8 years agoMFC r293858
vangyzen [Sat, 23 Jan 2016 20:51:57 +0000 (20:51 +0000)]
MFC r293858

libthr: const-ify two variables

Make the default umutex and urwlock initializers const,
because they can be, and as a microoptimization.

Sponsored by:   Dell Inc.

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

8 years agoMFC 294366:
jhb [Sat, 23 Jan 2016 17:08:17 +0000 (17:08 +0000)]
MFC 294366:
Initialize vm_page_prot to VM_MEMATTR_DEFAULT instead of 0.

If a driver's Linux mmap callback passed vm_page_prot through unchanged,
then linux_dev_mmap_single() would try to apply whatever VM_MEMATTR_xxx
value 0 is to the mapping.  On x86, VM_MEMATTR_DEFAULT is the PAT value
for write-back (WB) which is 6, while 0 maps to the PAT value for
uncacheable (UC).  Thus, any mmap request that did not explicitly set
page_prot was tried to map memory as UC triggering the warning in
sg_pager_getpages().

Sponsored by: Chelsio Communications

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

8 years agoMFC r294554: MFV r294491: ntp 4.2.8p6.
delphij [Fri, 22 Jan 2016 15:56:35 +0000 (15:56 +0000)]
MFC r294554: MFV r294491: ntp 4.2.8p6.

Security: CVE-2015-7973, CVE-2015-7974, CVE-2015-7975
Security: CVE-2015-7976, CVE-2015-7977, CVE-2015-7978
Security: CVE-2015-7979, CVE-2015-8138, CVE-2015-8139
Security: CVE-2015-8140, CVE-2015-8158
With hat: so

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

8 years agoMFstable/10 r294550:
ngie [Fri, 22 Jan 2016 07:25:41 +0000 (07:25 +0000)]
MFstable/10 r294550:

MFC r293048,r293444:

r293048:

- Use a temporary file for the temporary md(4) devices instead of
  hardcoding it
- Remove the temporary file in the cleanup routine

r293444:

- Move functions that might be used in class-specific cleanup functions
  (geom_test_cleanup, etc) down so the testcases don't emit noise when
  bailing
- Conform to the TAP protocol better when dealing with classes that can't
  be loaded and with temporary files that can't be allocated for tracking
  md(4) devices.

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

8 years agoMFC r293856:
brooks [Wed, 20 Jan 2016 19:56:43 +0000 (19:56 +0000)]
MFC r293856:

Avoid reading pass the end of the source buffer when it is not NUL
terminated.

If this buffer is adjacent to an unmapped page or a version of C with
bounds checked is used this may result in a crash.

PR: 206178
Submitted by: Alexander Cherepanov <cherepan@mccme.ru>

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

8 years agoMFC r293855:
brooks [Wed, 20 Jan 2016 19:52:01 +0000 (19:52 +0000)]
MFC r293855:

Avoid reading pass the end of the source buffer when it is not NUL
terminated.

If this buffer is adjacent to an unmapped page or a version of C with
bounds checked is used this may result in a crash.

PR: 206177
Submitted by: Alexander Cherepanov <cherepan@mccme.ru>

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

8 years agoMFV r294374: BIND 9.9.8-P3.
delphij [Wed, 20 Jan 2016 08:54:35 +0000 (08:54 +0000)]
MFV r294374: BIND 9.9.8-P3.

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

8 years agoMergeinfo fixup.
delphij [Wed, 20 Jan 2016 07:33:45 +0000 (07:33 +0000)]
Mergeinfo fixup.

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

8 years agoMFC 292410,292443,293977:
jhb [Tue, 19 Jan 2016 19:04:56 +0000 (19:04 +0000)]
MFC 292410,292443,293977:
Exit cleanly if malloc() fails to allocate a buffer for a copy of the
current MBR.

PR: 205322
Submitted by: Alexander Kuleshov <kuleshovmail@gmail.com>

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

8 years agoMFC r294102:
dim [Tue, 19 Jan 2016 18:35:22 +0000 (18:35 +0000)]
MFC r294102:

MFV r294101: 6527 Possible access beyond end of string in zpool comment

Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Dan McDonald <danmcd@omniti.com>
Approved by: Gordon Ross <gwr@nexenta.com>

illumos/illumos-gate@2bd7a8d078223b122d65fea49bb8641f858b1409

This fixes erroneous double increments of the 'check' variable in a loop
in spa_prop_validate().  I ran into this in the clang380-import branch,
where clang 3.8.0 warns about it.  (It is already fixed there.)

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

8 years agoRevert r294273
pfg [Tue, 19 Jan 2016 14:15:09 +0000 (14:15 +0000)]
Revert r294273
MFC r293680
ext4: add support for reading sparse files

The change was meant for newer versions and doesn't work out of the box.
While it seems easy to adapt I prfer not to have the implementations
diverge at this time.

Reported by: Arrigo Marchiori
PR: 205816

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

8 years agoMFstable/10 r294305:
ngie [Tue, 19 Jan 2016 01:42:31 +0000 (01:42 +0000)]
MFstable/10 r294305:

MFC r294128:

Fix -Wunused warning with clang/gcc

- Get rid of unused argc/argv variables in main
- Bump WARNS to 6

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

8 years agoMFstable/10 r294303:
ngie [Tue, 19 Jan 2016 01:39:29 +0000 (01:39 +0000)]
MFstable/10 r294303:

MFC r294103:

- Check for accf_filter before running the tests, otherwise it will always
  fail at subtest 9/11
- Use strncpy instead of strcpy with afa.af_name

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

8 years agoMFstable/10 r294300:
ngie [Tue, 19 Jan 2016 01:33:27 +0000 (01:33 +0000)]
MFstable/10 r294300:

MFC r293715:

Fix a mismerge from NetBSD in r162194 with `xdr_rpcb_entry_list_ptr(..)`

This fixes the potential NULL pointer dereference properly, and also fixes
memory leaks encountered in the process of iterating through `*rp`.

Found by: Valgrind
Submitted by: Miles Ohlrich <miles.ohlrich@isilon.com>

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

8 years agoMFC r293190: MFV r293125: less v481.
delphij [Mon, 18 Jan 2016 19:27:24 +0000 (19:27 +0000)]
MFC r293190: MFV r293125: less v481.

Relnotes: yes

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

8 years agoMFC r293680
pfg [Mon, 18 Jan 2016 15:43:37 +0000 (15:43 +0000)]
MFC r293680
ext4: add support for reading sparse files

Add support for sparse files in ext4. Also implement read-ahead, which
greatly increases the performance when transferring files from ext4.
The sparse file support has become very common in ext4.

Both features implemented by Damjan Jovanovic.

PR: 205816

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

8 years agoMFC r293679:
ae [Mon, 18 Jan 2016 11:51:41 +0000 (11:51 +0000)]
MFC r293679:
  Change the type of newsize argument in the smbfs_smb_setfsize() function
  from int to int64.
  MSDN says that SMB_SET_FILE_END_OF_FILE_INFO uses signed 64-bit integer
  to specify offset, but since smbfs_smb_setfsize() has used plain int,
  a value was truncated in case when offset was larger than 2G.
   https://msdn.microsoft.com/en-us/library/ff469975.aspx

  In particular, now `truncate -s 10G` will work correctly on the mounted
  SMB share.

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

8 years agoMFstable/10 r294240:
ngie [Mon, 18 Jan 2016 03:52:44 +0000 (03:52 +0000)]
MFstable/10 r294240:

MFC r293705:

Similar to r293704, fix theoretical leak of netconfig(3) resources in
__rpcbind_is_up(..) if getnetconfig(3) is partly successful in allocating
resources, but not completely successful by moving the endnetconfig(3) call
up before we return from the function if nconf == NULL.

Submitted by: Miles Ohlrich <miles.ohlrich@isilon.com>

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

8 years agoMFstable/10 r294239:
ngie [Mon, 18 Jan 2016 03:51:38 +0000 (03:51 +0000)]
MFstable/10 r294239:

MFC r293704:

Fix theoretical leak of netconfig(3) resources in svcunix_create(..)

In the event that the getconfig(3) call in svcunix_create is partly successful,
some of the netconfig(3) resources allocated might be leaked if the call returns
NULL as endnetconfig(3) wasn't called explicitly in that case. Ensure that the
resources are fully cleaned up by going to the `done` label, which will call
endnetconfig(3) for us.

Submitted by: Miles Ohlrich <miles.ohlrich@isilon.com>

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

8 years agoDocument SA-16:07
gjb [Fri, 15 Jan 2016 05:48:28 +0000 (05:48 +0000)]
Document SA-16:07

Sponsored by: The FreeBSD Foundation

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

8 years agoFix dates for previous errata update.
gjb [Fri, 15 Jan 2016 05:38:27 +0000 (05:38 +0000)]
Fix dates for previous errata update.

Sponsored by: The FreeBSD Foundation

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

8 years agoMFstable/10 r294066:
ngie [Fri, 15 Jan 2016 02:32:57 +0000 (02:32 +0000)]
MFstable/10 r294066:

MFC r293032:

Use randomly generated device names in testcases via mktemp -u instead of using
the hardcoded device name, "test"

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

8 years agoMFstable/10 r294063:
ngie [Fri, 15 Jan 2016 02:19:26 +0000 (02:19 +0000)]
MFstable/10 r294063:

MFC r293028,r293029:

r293028:

- Use geom <class> load instead of g<class> load; g<class> doesn't exist
  for all geom classes, e.g. geom_uzip(4)
- These tests require root. Skip all of the tests if they're run as non-root

r293029:

Add functions for managing md(4) devices and cleaning up said md(4) devices

These will be used soon in the various test scripts that source geom_subr.sh

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

8 years agoMerge r294048: fix OpenSSH client information leak.
glebius [Thu, 14 Jan 2016 22:50:35 +0000 (22:50 +0000)]
Merge r294048: fix OpenSSH client information leak.

Security: SA-16:07.openssh
Security: CVE-2016-0777

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

8 years agoDocument EN-16:01, EN-16:02, EN-16:03, SA-15:27, SA-16:01,
gjb [Thu, 14 Jan 2016 11:11:46 +0000 (11:11 +0000)]
Document EN-16:01, EN-16:02, EN-16:03, SA-15:27, SA-16:01,
SA-16:02, SA-16:03, SA-16:04, SA-16:05, SA-16:06.

Bump copyright date.

Sponsored by: The FreeBSD Foundation

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

8 years agoo Fix SCTP ICMPv6 error message vulnerability. [SA-16:01.sctp]
glebius [Thu, 14 Jan 2016 09:11:48 +0000 (09:11 +0000)]
o Fix SCTP ICMPv6 error message vulnerability. [SA-16:01.sctp]
o Fix ntp panic threshold bypass vulnerability. [SA-16:02.ntp]
o Fix Linux compatibility layer incorrect futex handling. [SA-16:03.linux]
o Fix Linux compatibility layer setgroups(2) system call. [SA-16:04.linux]
o Fix TCP MD5 signature denial of service. [SA-16:05.tcp]
o Fix insecure default bsnmpd.conf permissions. [SA-16:06.bsnmpd]

Security: FreeBSD-SA-16:01.sctp, CVE-2016-1879
Security: FreeBSD-SA-16:03.linux, CVE-2016-1880
Security: FreeBSD-SA-16:04.linux, CVE-2016-1881
Security: FreeBSD-SA-16:05.tcp, CVE-2016-1882
Security: FreeBSD-SA-16:06.bsnmpd, CVE-2015-5677

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

8 years agoMFC r293683:
pfg [Thu, 14 Jan 2016 01:51:18 +0000 (01:51 +0000)]
MFC r293683:
ext4: mount panic from freeing invalid pointers

Initialize the struct with those fields to zeroes on allocation,
preventing the panic.

Patch by: Damjan Jovanovic.

PR: 206056

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

8 years agoMerge r291073:
glebius [Wed, 13 Jan 2016 05:32:24 +0000 (05:32 +0000)]
Merge r291073:
  If a NIS server has long entries on its database that is bigger than
  1024 specified on YPMAXRECORD the ypmatch can get in an infinite retry
  loop when is requesting the information from the NIS server.

  The ypmatch(1) will return an error until the command receives an
  kill(1).

  To avoid this problem, we check the MAX_RETRIES that is by default set
  to 20 and avoid get in infinet loop at the client side.

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

8 years agoMFC r292639
davidcs [Tue, 12 Jan 2016 23:48:39 +0000 (23:48 +0000)]
MFC r292639
  Add support for firmware dump (a.k.a grcdump)

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

8 years agoMFC r292638
davidcs [Tue, 12 Jan 2016 23:44:03 +0000 (23:44 +0000)]
MFC r292638
    Check for packet_length is greater than 60 bytes as well as packet_length is
    greater than len_on_bd, before invoking the routine to handle jumbo over SGL
    (bxe_service_rxsgl()).
    Add counters for number of jumbo_over_SGL packets (rx_bxe_service_rxsgl) and
    erroneous jumbo_over_SGL packets (rx_erroneous_jumbo_sge_pkts)

    Fix formatting in bxe_sysctl_state()

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

8 years agoMFC r289199
davidcs [Tue, 12 Jan 2016 23:26:45 +0000 (23:26 +0000)]
MFC r289199
  Add support for reading device temperature

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

8 years agoMFC r292950:
dim [Tue, 12 Jan 2016 19:33:43 +0000 (19:33 +0000)]
MFC r292950:

Drop the clang patch which adds recognition of 'CC' suffixes as aliases
for --driver-mode=g++, since this was never upstreamed.  For backwards
compatibility, add a wrapper shell script.

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

8 years agoMFC r292989:
hselasky [Tue, 12 Jan 2016 09:03:39 +0000 (09:03 +0000)]
MFC r292989:
Handle when filedescriptors are closed before initialized. An early
fdclose() call can cause fget_unlocked() to fail.

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

8 years agoMerge r293423, r293469:
glebius [Mon, 11 Jan 2016 01:48:16 +0000 (01:48 +0000)]
Merge r293423, r293469:
  ntp 4.2.8p5

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

8 years agoInstall stdatomic.h.
glebius [Mon, 11 Jan 2016 01:45:25 +0000 (01:45 +0000)]
Install stdatomic.h.

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

8 years agoMFC r293370:
pfg [Sun, 10 Jan 2016 22:31:39 +0000 (22:31 +0000)]
MFC r293370:
ext2fs: reading mmaped file in Ext4 causes panic

Always call brelse(path.ep_bp), fixing reading EXT4 files using mmap().

Patch by Damjan Jovanovic.

PR: 205938

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

8 years agoMFstable/10 r276677:
ngie [Sat, 9 Jan 2016 21:33:31 +0000 (21:33 +0000)]
MFstable/10 r276677:

MFC r276319:

  Fix the function signatures when MK_CRYPT == no for snmp_get_local_keys and
  snmp_passwd_to_keys

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

8 years agoMFC r291941:
bdrewery [Fri, 8 Jan 2016 00:07:37 +0000 (00:07 +0000)]
MFC r291941:

  Replace unneeded manual dependency on header by adding it to SRCS.

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

8 years agoMFC r279969:
np [Fri, 8 Jan 2016 00:05:20 +0000 (00:05 +0000)]
MFC r279969:

cxgbe(4):  fix if_media handling for T520-BT cards.  1Gbps and 100Mbps
are valid for this card.

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

8 years agoMFstable/10 r293246,r293257:
ngie [Wed, 6 Jan 2016 20:09:51 +0000 (20:09 +0000)]
MFstable/10 r293246,r293257:

r293246:

MFC r292530,r292546:

r292530:

- Use 1 for an exit code instead of -1 with err, errx, and exit
- Add unistd.h for getuid(3)
- Sort #includes

r292546:

- Convert testcase to TAP format
- Use nitems(x) instead of handrolled sizeof(x) / sizeof(*x) macro
- Do not mark count != 0 case with bsde_get_rule_count as a failure; this
  generates false positives on systems with ugidfw rules set on it

r293257:

MFC r292650,r292651:

r292650:

Move mac_bsdextended check up before running the test_libugidfw_strings testcases

I realize that these tests could be run before mac_bsdextended is loaded, but
it would overcomplicate things to special case handle the testcases before doing
the mac_bsdextended(4) feature check

The testcases will be split up so they can be run separately in the near future

r292651:

Delete the comment about running `test_libugidfw_strings` before testing
`mac_is_present` so it doesn't accidentally confuse people

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

8 years agoMFC r270675:
bdrewery [Wed, 6 Jan 2016 17:53:51 +0000 (17:53 +0000)]
MFC r270675:

  Allow mailwrapper to use mailer.conf from localbase (respecting LOCALBASE env
  var if set)

PR: 205965
Relnotes: yes

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

8 years agoMFC r292877:
pfg [Wed, 6 Jan 2016 16:35:30 +0000 (16:35 +0000)]
MFC r292877:
pax: prevent possible buffer overflow

Or at least quiet down some static analyzers about it.

CID: 978835
Obtained from: OpenBSD

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

8 years agoMFC r292872:
pfg [Wed, 6 Jan 2016 16:27:17 +0000 (16:27 +0000)]
MFC r292872:

ext2: recognize ext4 INCOMPAT_RECOVER flag

This is a flag specific for journalling in ext4.
Add it to the list of ext4 features we ignore for
read-only purposes.

PR: 205668

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

8 years agoAdd missed mergeinfo.
hselasky [Mon, 4 Jan 2016 08:39:56 +0000 (08:39 +0000)]
Add missed mergeinfo.

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

8 years agoMFC r291199:
hselasky [Mon, 4 Jan 2016 07:29:19 +0000 (07:29 +0000)]
MFC r291199:
Fix compile warning about shifting signed negative constant.

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

8 years agoMFstable/10 r293141:
ngie [Mon, 4 Jan 2016 07:04:58 +0000 (07:04 +0000)]
MFstable/10 r293141:

MFC r292815:

Staticize several variables that are used exclusively in bsnmpd/main.c and
bsnmpd/trap.c

This fixes several -Wmissing-variable-declaration warnings noted by clang

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

8 years agoMFstable/10 r293138:
ngie [Mon, 4 Jan 2016 06:58:39 +0000 (06:58 +0000)]
MFstable/10 r293138:

MFC r292531,r292532,r292533,r292545:

r292531:

Make test_matches.sh into a series of TAP testcases

Use temporary filesystems / memory disks instead of a hardcoded path
which doesn't exist on test systems

r292532:

Mark `subject matching jailid` testcase as an unexpected failure with
TODO to ensure that the testcase isn't marked as a failure

PR: 205481

r292533:

Skip the testcases if mac_bsdextended(4) isn't detected on the
system

r292545:

Redo the TAP integration so it works with Kyua

Kyua needs numbers in the TAP results :/, but prove doesn't

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

8 years agoMFC r292605, r292606, r292607, r292608:
pfg [Mon, 4 Jan 2016 03:22:06 +0000 (03:22 +0000)]
MFC r292605, r292606, r292607, r292608:

cron: bring some fixes for Coverity reports and other issues.

crontab: replace malloc + bzero with calloc
crontab: properly free an entry
cron: Check the return value of pipe(2)

CID: 271773, 1009830,

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

8 years agoMFC r293015:
dim [Sun, 3 Jan 2016 17:23:16 +0000 (17:23 +0000)]
MFC r293015:

Merge r293013 from clang380-import branch:

Fix a clang 3.8.0 warning in pflogd.c:

contrib/pf/pflogd/pflogd.c:769:8: error: logical not is only applied to the left hand side of this comparison [-Werror,-Wlogical-not-parentheses]
       if (!if_exists(interface) == -1) {
   ^                     ~~

The if_exists() function does not return -1, and even if it did, it
would not be the correct way to check.  Just ditch the == -1 instead.

Obtained from: OpenBSD's pflogd.c 1.49

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

8 years agoMFC r293014:
dim [Sun, 3 Jan 2016 17:19:17 +0000 (17:19 +0000)]
MFC r293014:

Merge r293006 from clang380-import branch:

For determining the compiler version, quote the string to be echo'd,
otherwise the command might fail.  This is because clang -v now results
in the following:

FreeBSD clang version 3.8.0 (trunk 256633) (based on LLVM 3.8.0svn)

The second "3.8.8svn)" string tripped up the shell command.

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

8 years agoMFstable/10 r293025:
ngie [Fri, 1 Jan 2016 00:38:17 +0000 (00:38 +0000)]
MFstable/10 r293025:

MFC r292884:

Fix getopt(3) argument after r290180; I forgot to change -r to -R
by accident

Pointyhat to: ngie

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

8 years agoMFC r292719:
ume [Fri, 1 Jan 2016 00:36:20 +0000 (00:36 +0000)]
MFC r292719:
  Remove _gethostbynisname() and _gethostbynisaddr().  These functions
  used to be called from getipnodebyname().

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

8 years agoMFstable/10 r293003:
ngie [Thu, 31 Dec 2015 20:52:39 +0000 (20:52 +0000)]
MFstable/10 r293003:

MFC r292640,r292641:

r292640:

Clean up trailing whitespace; no functional change

r292641:

Fix r292640

vim overzealously removed some trailing `+' and I didn't check the
diff

Pointyhat to: ngie

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

8 years agoMFstable/10 r292998:
ngie [Thu, 31 Dec 2015 20:51:05 +0000 (20:51 +0000)]
MFstable/10 r292998:

MFC r292710:

Remove unused function `act_getkernstring`

This fixes a clang -Wunused warning

Differential Revision: https://reviews.freebsd.org/D4697
Reported by: Jenkins
Reviewed by: araujo, bapt
Sponsored by: EMC / Isilon Storage Division

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

8 years agoMFC r292983:
bz [Thu, 31 Dec 2015 11:25:45 +0000 (11:25 +0000)]
MFC r292983:

 Bump copyright year.

 Happy New Year 2016!

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

8 years agoMFstable/10 r292975:
ngie [Thu, 31 Dec 2015 04:01:52 +0000 (04:01 +0000)]
MFstable/10 r292975:

MFC r278860:
r278860 (by jmg):

remove NULL check as M_WAITOK will not return NULL

Reviewed by: jhb
Sponsored by: FreeBSD Foundation

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

8 years agoMFstable/10 r292879:
ngie [Tue, 29 Dec 2015 18:33:43 +0000 (18:33 +0000)]
MFstable/10 r292879:

MFC r265842,r266120,r266121,r266959,r267148,r269985,r281789,r282261,r285064:

r265842 (by eadler):

arcconfig: add one

Add a .arcconfig to allow arc to work in its usual way.

r266120 (by bapt):

Add project name to the arc config it is still required when arcanist is used with SVN

r266121 (by bapt):

Add the missing coma

r266959 (by eadler):

arc: add linting for python files

r267148 (by bapt):

Prevent arc commands from overwriting history

r269985 (by gjb):

Update the URL to the phabricator instance.

Sponsored by: The FreeBSD Foundation

r281789 (by eadler):

phabricator related changes:
- don't lint either contrib or crypto: these are both externally written
  directories
- add additional linters for spelling (check common typos like teh ->
  the)
- chmod linter checks for executible bit on bad files
- merge-conflict checks for merge conflict tokens then may have been
  resolved incorrectly
- filename checks for back characters in filenames
- json for json syntax correctness

- remove history.immutable: it is meaningless on subversion, and causes
  workflow problems when trying to use git.  It it set to 'true' by
  default with hg

r282261 (by eadler):

Phabricator: enable "history.immutable":
With certain arc workflows leaving history.immutable as false
results in using the upstream template instead of our usual
commit template.  Since the git workflow issues alluded to in my
prior commit message can be worked around, set history.immutable
once again.

r285064 (by mat):

Add repository.callsign, to help arcanist figure out what repo it's
doing things on when not using Subversion.

With hat: phabric-admin@
Sponsored by: Absolight

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

8 years agoMFstable/10 r292855:
ngie [Tue, 29 Dec 2015 01:09:53 +0000 (01:09 +0000)]
MFstable/10 r292855:

MFC r292585:

Prevent use-after-free with ctx->ns in set_nameservers(..), which could occur
if the memory wasn't allocated again later on

Reported by: Coverity
Submitted by: Miles Ohlrich <miles.ohlrich@isilon.com>
Sponsored by: EMC / Isilon Storage Division

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

8 years agoMFC r292550, r292595:
ume [Tue, 29 Dec 2015 00:43:46 +0000 (00:43 +0000)]
MFC r292550, r292595:
  Simplify _map_v4v6_address().
  We don't need to use a temporary buffer, here.

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

8 years agoMFstable/10 r292845:
ngie [Tue, 29 Dec 2015 00:04:21 +0000 (00:04 +0000)]
MFstable/10 r292845:

MFC r292569:

Make the mac_portacl testcases work / more robust

- A trap(1) call has been added to the test scripts to better
  ensure that the tests do a better job at trying to restore the
  test host state at the end of the tests (if the test was
  interrupted before it would leave the system in an odd state,
  potentially making the test results for subsequent runs
  non-deterministic).
- Add root user checks
- Fix nc(1) usage:
  -- -o is deprecated
  -- Using `-w 10` will make the call timeout after 10 seconds so it
     doesn't block indefinitely
- Use local variables
- Be more terse in the error messages
- Parameterize out "127.0.0.1"

Sponsored by: EMC / Isilon Storage Division

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

8 years agoMFC r292445, r292554:
ume [Mon, 28 Dec 2015 03:39:32 +0000 (03:39 +0000)]
MFC r292445, r292554:
  Use _map_v4v6_address().

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

8 years agoMFC r292539:
ume [Mon, 28 Dec 2015 03:27:51 +0000 (03:27 +0000)]
MFC r292539:
  If we end up following a CNAME chain that does not find
  any data return that instead of internal error.

PR: 156684

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

8 years agoMFstable/10 r226602:
ngie [Sun, 27 Dec 2015 21:58:13 +0000 (21:58 +0000)]
MFstable/10 r226602:
r226602 (by das):

Tests for cancellation in fma(). Also include more tests for 128-bit
long doubles. Thanks for clusteradm (simon) for making the needed
hardware available.

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

8 years agoMFstable/10 r251053:
ngie [Sun, 27 Dec 2015 21:55:26 +0000 (21:55 +0000)]
MFstable/10 r251053:
r251053 (by tijl):

Fix cexp regression tests that have an infinite real part. The signs of the
result depend on the cosine and sine of the imaginary part.
Small values are used in the new tests such that cosine and sine are well
defined.

Reviewed by: das

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

8 years agoMFstable/10 r292769,r292799:
ngie [Sun, 27 Dec 2015 21:53:21 +0000 (21:53 +0000)]
MFstable/10 r292769,r292799:

r292769:

MFC r292493:

Don't run test-fma on i386

It completely fails all assertions on i386 on both stable/9 and stable/10

PR: 205448
X-MFC to: stable/10
Sponsored by: EMC / Isilon Storage Division

r292799:

MFC r292492,r292495,r292647:

r292492:

- Use nitems instead of handrolling the macro
- Use a separate variable for tracking the testcase count instead
  of hardcoding the offset for the testcases

Sponsored by: EMC / Isilon Storage Division

r292495:

Initialize j so it doesn't print out a garbage index

Use it consistently instead of i in the first loop

Sponsored by: EMC / Isilon Storage Division

r292647:

Use j instead of a hardcoded index (9) and increment it after
running the NaNs testcases

Pointyhat to: ngie
Sponsored by: EMC / Isilon Storage Division

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

8 years agoRevert r292803
ngie [Sun, 27 Dec 2015 21:47:12 +0000 (21:47 +0000)]
Revert r292803

Some of the hyperbolic functions (sinh, etc) haven't been implemented
on stable/9, so the tests that were MFCed were invalid.

A corrected MFC will come soon

Sponsored by: EMC / Isilon Storage Division

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

8 years agoMFstable/10 r226603,r251119:
ngie [Sun, 27 Dec 2015 21:39:28 +0000 (21:39 +0000)]
MFstable/10 r226603,r251119:

r226603 (by das):

Tests for complex trig and hyperbolic functions.

r251119 (by das):

Basic tests for complex inverse trig and hyperbolic functions.

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

8 years agoMFstable/10 r292795:
ngie [Sun, 27 Dec 2015 21:34:37 +0000 (21:34 +0000)]
MFstable/10 r292795:

MFC r292491,r292493,r292496:

r292491:

Disable test-ctrig.t testcases which fail assertions on i386 [*]

Also, don't compile the exp2l(3) testcases on platforms that don't support the
libcall (technically only x86 right now). This makes this test buildable on
arm*/mips*/powerpc*

Tested on: stable/10 (amd64/i386), head (amd64/i386)
PR: 205446 [*]
X-MFC to: stable/10
Sponsored by: EMC / Isilon Storage Division

r292493:

Don't run test-fma on i386

It completely fails all assertions on i386 on both stable/9 and stable/10

PR: 205448
X-MFC to: stable/10
Sponsored by: EMC / Isilon Storage Division

r292496:

Skip the testcases on i386 (all the assertions fail) [*]

Also, don't compile the ldexpl(3) testcases on platforms that don't support
the libcall (technically only x86 right now). This makes this test buildable on
arm*/mips*/powerpc*

PR: 205449 [*]
Tested on: stable/10 (amd64/i386), head (amd64/i386)
Sponsored by: EMC / Isilon Storage Division

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

8 years agoMFstable/10 r226377,r292799:
ngie [Sun, 27 Dec 2015 21:15:58 +0000 (21:15 +0000)]
MFstable/10 r226377,r292799:

r226377 (by das):

Add some tests for double-rounding bugs in fma().

r292799:

MFC r292492,r292495,r292647:

r292492:

- Use nitems instead of handrolling the macro
- Use a separate variable for tracking the testcase count instead
  of hardcoding the offset for the testcases

Sponsored by: EMC / Isilon Storage Division

r292495:

Initialize j so it doesn't print out a garbage index

Use it consistently instead of i in the first loop

Sponsored by: EMC / Isilon Storage Division

r292647:

Use j instead of a hardcoded index (9) and increment it after
running the NaNs testcases

Pointyhat to: ngie
Sponsored by: EMC / Isilon Storage Division

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

8 years agoMFC: r285909, r285913 (partial)
marius [Sun, 27 Dec 2015 20:49:36 +0000 (20:49 +0000)]
MFC: r285909, r285913 (partial)

- Probe UICLASS_CDC/UISUBCLASS_ABSTRACT_CONTROL_MODEL/0xff again. This
  variant of Microsoft RNDIS, i. e. their unofficial version of CDC ACM,
  has been disabled in r261544 (r262362 in stable/9) for resolving a
  conflict with umodem(4). Eventually, in r275790 (r276244 in stable/9)
  that problem was dealt with in the right way. However, r275790 failed
  to put probing of RNDIS devices in question back.
- Initialize the device prior to querying it, as required by the RNDIS
  specification. Otherwise already determining the MAC address may fail
  rightfully.
- On detach, halt the device again.
- Use UCDC_SEND_ENCAPSULATED_{COMMAND,RESPONSE}. While these macros are
  resolving to the same values as UR_{CLEAR_FEATURE,GET_STATUS}, the
  former set is way more appropriate in this context.
- Report unknown - rather: unimplemented - events unconditionally and
  not just in debug mode. This ensures that we'll get some hint of what
  is going wrong instead of the driver silently failing.
- Deal with the Microsoft ActiveSync requirement of using an input buffer
  the size of the expected reply or larger - except for variably sized
  replies - when querying a device.
- Fix some pointless NULL checks, style bugs etc.

This changes allow urndis(4) to communicate with a Microsoft-certified
USB RNDIS test token.

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

8 years agoMFC: r285912
marius [Sun, 27 Dec 2015 19:48:02 +0000 (19:48 +0000)]
MFC: r285912

- Use __FBSDID().
- Const'ify cons_to_vga_colors.
- Fix line wrapping.

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

8 years agoMFC: r287768, r290566, r290946
marius [Sun, 27 Dec 2015 17:34:29 +0000 (17:34 +0000)]
MFC: r287768, r290566, r290946

- Although it doesn't make a whole lot of sense to enable RX and TX
  before their initial configuration is done, it turns out that r281337
  (MFCed to stable/9 in r285178) has the inverse effect on some older
  chips. Moreover, as with newer chips before, two chips seemingly
  identical according to their MAC revisions may behave differently in
  this regard, with most working but a few not, making changes extremely
  hard to test.
  Closer inspection of the corresponding Linux code suggests that RX
  and TX should only be enabled after their initial configuration with
  RTL8168G and later chips, i. e. RTL8106E{,US}, RTL8107E, as well as
  RTL8168{EP,G,GU,H}, so limit the new code path to these. [1]
- Distinguish between RTL8168H and RTL8107E, with the latter being the
  10/100-Mbit/s-only variant of the former.
- For MAC variants that can only do Fast Ethernet at a maximum, ensure
  that we don't advertise Gigabit Ethernet speed.
- In re_stop(), do the inverse of re_init_locked() and enable RXDV
  gate on RTL8168G and later chips again, matching what Linux does.
- With the latter in place, it turns out that WOL previously only worked
  by accident with RTL8168G and later chips when the interface actually
  was brought up. This is due to the fact that with these MAC variants,
  RXDV gate needs be disabled for WOL to work. So in re_setwol() do just
  that when IFCAP_WOL is requested.
- Add preliminary support for RTL8168H and RTL8107E, with the latter
  being the 10/100-Mbit/s-only variant of the former.

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

8 years agoMFC: r271864
marius [Sun, 27 Dec 2015 17:19:46 +0000 (17:19 +0000)]
MFC: r271864

Move rl(4) to dev/rl.

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

8 years agoMFC: r286785, r291088, r291120
marius [Sun, 27 Dec 2015 15:55:15 +0000 (15:55 +0000)]
MFC: r286785, r291088, r291120
- Reformat x86 bounce buffer synchronization code to reduce indentation.
  No functional change.
- Avoid a NULL pointer dereference in bounce_bus_dmamap_sync() when the
  map has been created via bounce_bus_dmamem_alloc(). Even for coherent
  DMA - which bus_dmamem_alloc(9) typically is used for -, calling of
  bus_dmamap_sync(9) isn't optional. [1]
- Avoid a NULL pointer dereference in bounce_bus_dmamap_unload() when
  the map has been created via bounce_bus_dmamem_alloc(). In that case
  bus_dmamap_unload(9) typically isn't called during normal operation
  but still should be during detach, cleanup from failed attach etc. [2]

PR: 188899 (non-original problem) [1]
Submitted by: yongari [2]

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

8 years agoMFC r292514:
ume [Sun, 27 Dec 2015 00:38:57 +0000 (00:38 +0000)]
MFC r292514:
  addrinfo.ai_family is an address family, not a protocol family.

PR: 162434

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

8 years agoMFC r292454, r292455
pfg [Sat, 26 Dec 2015 18:38:09 +0000 (18:38 +0000)]
MFC r292454, r292455
ed(1): Prevent possible string overflows

Use strlcpy to guarantee NULL termination.

With hint from: imp, cem, ngie
CID: 1007252

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

8 years agopf: Fix IPv6 checksums with route-to.
kp [Fri, 25 Dec 2015 15:12:54 +0000 (15:12 +0000)]
pf: Fix IPv6 checksums with route-to.

When using route-to (or reply-to) pf sends the packet directly to the output
interface. If that interface doesn't support checksum offloading the checksum
has to be calculated in software.
That was already done in the IPv4 case, but not for the IPv6 case. As a result
we'd emit packets with pseudo-header checksums (i.e. incorrect checksums).

This issue was exposed by the changes in r289316 when pf stopped performing full
checksum calculations for all packets.

Submitted by:   Luoqi Chen

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

8 years agopf: Fix TSO issues
kp [Fri, 25 Dec 2015 15:12:11 +0000 (15:12 +0000)]
pf: Fix TSO issues

In certain configurations (mostly but not exclusively as a VM on Xen) pf
produced packets with an invalid TCP checksum.

The problem was that pf could only handle packets with a full checksum. The
FreeBSD IP stack produces TCP packets with a pseudo-header checksum (only
addresses, length and protocol).
Certain network interfaces expect to see the pseudo-header checksum, so they
end up producing packets with invalid checksums.

To fix this stop calculating the full checksum and teach pf to only update TCP
checksums if TSO is disabled or the change affects the pseudo-header checksum.

PR:             154428, 193579, 198868
Sponsored by:   RootBSD

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

8 years agoMFC r292444, r292446:
ume [Fri, 25 Dec 2015 11:33:09 +0000 (11:33 +0000)]
MFC r292444, r292446:
  Add AI_V4MAPPED and AI_ALL support for getaddrinfo(3).

PR: 198092

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

8 years agoMFC r292435, r292441:
ume [Fri, 25 Dec 2015 10:55:39 +0000 (10:55 +0000)]
MFC r292435, r292441:
  - Keep hosts.by{name,addr} IPv4 only.
  - Add comment how we handle hosts and ipnodes.
  - Generate ipnodes.by{addr,name} from /etc/hosts for
    compatibility with FreeBSD local name resolution.
    If /var/yp/ipnodes exists, we generate them from it
    for backward compatibility.

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

8 years agoMFH: r292263
brueffer [Thu, 24 Dec 2015 20:19:49 +0000 (20:19 +0000)]
MFH: r292263

Assorted grammar, spelling and punctuation fixes.

PR: 203336, 203339
Submitted by: espeyb@rpi.edu, themesta@gmail.com

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

8 years agoMFstable/10 r292652:
ngie [Wed, 23 Dec 2015 10:38:44 +0000 (10:38 +0000)]
MFstable/10 r292652:

MFC r292316:

Remove hosts that don't resolve properly with the nss and resolv tests

Sponsored by: EMC / Isilon Storage Division

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

8 years agoMFC r289635
davidcs [Tue, 22 Dec 2015 19:41:40 +0000 (19:41 +0000)]
MFC r289635

  ql_hw.c: fixed error code INJCT_HEARTBEAT_FAILURE
  ql_os.c: removed unnecessary debug printf
  ql_ver.h: updated version number

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

8 years agoMFH: r292212
brueffer [Mon, 21 Dec 2015 09:36:45 +0000 (09:36 +0000)]
MFH: r292212

Flesh out the SEE ALSO section.

PR: 202929
Submitted by: jhs@berklix.com

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

8 years agoMFC r289315 (reprise)
vangyzen [Sun, 20 Dec 2015 20:58:49 +0000 (20:58 +0000)]
MFC r289315 (reprise)

MFC the man page change from r289315.  Thanks for the
attention to detail, Jeremy.

Pointed out by: Jeremy Chadwick <jdc@koitsu.org>
Sponsored by: Dell Inc.

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

8 years agoMFstable/10 r292481:
ngie [Sun, 20 Dec 2015 00:45:34 +0000 (00:45 +0000)]
MFstable/10 r292481:

MFC r292153:

Add -static to CFLAGS to unbreak the tests by using a libc.a with
the xlocale private symbols exposed which aren't exposed publicly
via the DSO

PR: 191354
Sponsored by: EMC / Isilon Storage Division

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

8 years agoMFC r289315,r292216
vangyzen [Sat, 19 Dec 2015 02:49:59 +0000 (02:49 +0000)]
MFC r289315,r292216

resolver: automatically reload /etc/resolv.conf

On each resolver query, use stat(2) to see if the modification time
of /etc/resolv.conf has changed.  If so, reload the file and reinitialize
the resolver library.  However, only call stat(2) if at least two seconds
have passed since the last call to stat(2), since calling it on every
query could kill performance.

This new behavior is enabled by default.  Add a "reload-period" option
to disable it or change the period of the test.

Document this behavior and option in resolv.conf(5).

Polish the man page just enough to appease igor.

Relnotes:       yes
Sponsored by:   Dell Inc.

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

8 years agoMFC r289837
vangyzen [Sat, 19 Dec 2015 02:47:05 +0000 (02:47 +0000)]
MFC r289837

resolver: abuse _res a little less

In the past, _res was a global variable.  Now, it's multiple function calls.
Several functions in the resolver use _res multiple times and therefore
call the function(s) far more than necessary.

Fix those callers to store the result of _res in a local variable.

Add __noinline to the definition of res_init() to avoid the code bloat
that these changes would have otherwise incurred.  Thanks to jilles
for noticing this.

Sponsored by:   Dell Inc.

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