]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
6 years agoFix the reldoc target in release/Makefile following doc commit r51264.
Glen Barber [Thu, 7 Dec 2017 20:00:19 +0000 (20:00 +0000)]
Fix the reldoc target in release/Makefile following doc commit r51264.

Sponsored by: The FreeBSD Foundation

6 years agomlx4: Remove redundant declarations to fix GCC build
Conrad Meyer [Thu, 7 Dec 2017 19:57:51 +0000 (19:57 +0000)]
mlx4: Remove redundant declarations to fix GCC build

These were made redundant in r325841.

Reviewed by: hselasky
MFC after: 1 week (hselasky will MFC)
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D13401

6 years agoUse correct field in the description for the lock after r319722.
Bjoern A. Zeeb [Thu, 7 Dec 2017 19:40:46 +0000 (19:40 +0000)]
Use correct field in the description for the lock after r319722.

Reviewed by: glebius
Sponsored by: iXsystems, Inc.

6 years agoFix the UMA reclaim worker after r326347.
Mark Johnston [Thu, 7 Dec 2017 19:38:09 +0000 (19:38 +0000)]
Fix the UMA reclaim worker after r326347.

atomic_set_*() sets a bit in the target memory location, so
atomic_set_int(&uma_reclaim_needed, 0) does not do what it looks like
it does.

PR: 224080
Reviewed by: jeff, kib
Differential Revision: https://reviews.freebsd.org/D13412

6 years agoMerge OpenSSL 1.0.2n.
Jung-uk Kim [Thu, 7 Dec 2017 18:02:57 +0000 (18:02 +0000)]
Merge OpenSSL 1.0.2n.

6 years agoImport OpenSSL 1.0.2n.
Jung-uk Kim [Thu, 7 Dec 2017 17:37:15 +0000 (17:37 +0000)]
Import OpenSSL 1.0.2n.

6 years agoLook for libraries in OBJDIR when building outside of buildworld.
Bryan Drewery [Thu, 7 Dec 2017 16:37:19 +0000 (16:37 +0000)]
Look for libraries in OBJDIR when building outside of buildworld.

This allows build testing more easily without establishing a sysroot
or installing the files.

Sponsored by: Dell EMC

6 years agoEnsure that "out" is initialized in all error paths.
Mark Johnston [Thu, 7 Dec 2017 15:16:17 +0000 (15:16 +0000)]
Ensure that "out" is initialized in all error paths.

Reported by: gcc
Reviewed by: cem
Differential Revision: https://reviews.freebsd.org/D13402

6 years agoFix livelock in ufsdirhash_create().
Konstantin Belousov [Thu, 7 Dec 2017 09:05:34 +0000 (09:05 +0000)]
Fix livelock in ufsdirhash_create().

When more than one thread enters ufsdirhash_create() for the same
directory and the inode dirhash is instantiated, but the dirhash' hash
is not, all of them lock the dirhash shared and then try to upgrade.
Since there are several threads owning the lock shared, upgrade fails
and the same attempt is repeated, ad infinitum.

To break the lockstep, lock the dirhash in exclusive mode after the
failed try-upgrade.

Reported and tested by: pho
Sponsored by: Mellanox Technologies
MFC after: 1 week

6 years agoMove instantiation of msgbufp from 9 MD files to subr_prf.c.
Bruce Evans [Thu, 7 Dec 2017 07:55:38 +0000 (07:55 +0000)]
Move instantiation of msgbufp from 9 MD files to subr_prf.c.

This variable should be pure MI except possibly for reading it in MD
dump routines.  Its initialization was pure MD in 4.4BSD, but FreeBSD
changed this in r36441 in 1998.  There were many imperfections in
r36441.  This commit fixes only a small one, to simplify fixing the
others 1 arch at a time.  (r47678 added support for
special/early/multiple message buffer initialization which I want in
a more general form, but this was too fragile to use because hacking
on the msgbufp global corrupted it, and was only used for 5 hours in
-current...)

6 years agoFix use-after-free that sometimes results in a garbage returned
Eugene Grosbein [Thu, 7 Dec 2017 05:55:18 +0000 (05:55 +0000)]
Fix use-after-free that sometimes results in a garbage returned
instead of right error code after requests to SINGLE/CONCAT volumes, f.e:

# dd if=/dev/raid/r0 bs=512 of=/dev/null
dd: /dev/raid/r0: Unknown error: -559038242

Reviewed by: avg (mentor), mav (mentor)
MFC after: 3 days

6 years agoUse consistent name for the vxlan VNI parameter name and provide shorthand
Bryan Venteicher [Thu, 7 Dec 2017 04:55:31 +0000 (04:55 +0000)]
Use consistent name for the vxlan VNI parameter name and provide shorthand

Submitted by: hrs
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D2868

6 years agodc(1): fix modulo operations with fractional inputs
Alan Somers [Thu, 7 Dec 2017 02:08:55 +0000 (02:08 +0000)]
dc(1): fix modulo operations with fractional inputs

Our dc(1) has never correctly calculated remainders with fractional inputs.
Both bmod and bdivmod seem to have copy/pasted code from bdiv, which results
in the remainder having the wrong output scale.

PR: 162495
Reported by: anonymous
Reviewed by: pfg
Differential Revision: https://reviews.freebsd.org/D13390

6 years agoFix mandoc -Tlint warnings in bin/
Benjamin Kaduk [Thu, 7 Dec 2017 01:57:27 +0000 (01:57 +0000)]
Fix mandoc -Tlint warnings in bin/

Many style-level issues are still reported.

Submitted by: Yuri Pankov <yuripv@gmx.com>
Reviewed by: jilles (previous revision)
Differential Revision: https://reviews.freebsd.org/D13334

6 years agoNote that old sys/event.h required manual sys/types.h inclusion
Benjamin Kaduk [Thu, 7 Dec 2017 01:50:17 +0000 (01:50 +0000)]
Note that old sys/event.h required manual sys/types.h inclusion

ed fixed this in r313704 but older versions are still affected.

6 years agoDisconnect OFED after r326169 broke all DIRDEPS support for it.
Bryan Drewery [Thu, 7 Dec 2017 01:49:35 +0000 (01:49 +0000)]
Disconnect OFED after r326169 broke all DIRDEPS support for it.

6 years agotinderbox/universe: Don't execute KERNCONFS lookup if not needed.
Bryan Drewery [Thu, 7 Dec 2017 00:31:28 +0000 (00:31 +0000)]
tinderbox/universe: Don't execute KERNCONFS lookup if not needed.

Sponsored by: Dell EMC

6 years agoRevert r325529: No longer needed after r325699.
Bryan Drewery [Thu, 7 Dec 2017 00:31:10 +0000 (00:31 +0000)]
Revert r325529: No longer needed after r325699.

Sponsored by: Dell EMC

6 years agoFix a null-pointer dereference and a tautological check in cam_get_device
Alan Somers [Wed, 6 Dec 2017 23:24:11 +0000 (23:24 +0000)]
Fix a null-pointer dereference and a tautological check in cam_get_device

Reported by: Coverity
CID: 1017964
MFC after: 3 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D13184

6 years agoDefine xpt_path_inq.
Warner Losh [Wed, 6 Dec 2017 23:05:22 +0000 (23:05 +0000)]
Define xpt_path_inq.

This provides a nice wrarpper around the XPT_PATH_INQ ccb creation and
calling.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D13387

6 years agoNow that cam_periph_runccb() can be called from situations where the
Warner Losh [Wed, 6 Dec 2017 23:05:15 +0000 (23:05 +0000)]
Now that cam_periph_runccb() can be called from situations where the
kernel scheduler is stopped, replace the by hand calling of
xpt_polled_action() with it.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D13388

6 years agoMake cam_periph_runccb be safe to call when we can only do polling.
Warner Losh [Wed, 6 Dec 2017 23:05:07 +0000 (23:05 +0000)]
Make cam_periph_runccb be safe to call when we can only do polling.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D13388

6 years agoGarbage collect IFCAP_POLLING_NOCOUNT. It wasn't used since very
Gleb Smirnoff [Wed, 6 Dec 2017 23:03:34 +0000 (23:03 +0000)]
Garbage collect IFCAP_POLLING_NOCOUNT.  It wasn't used since very
beginning of polling(4).  The module always ignored return value
from driver polling handler.

6 years agoSplit body of mails not respecting RFC2822
Baptiste Daroussin [Wed, 6 Dec 2017 22:08:35 +0000 (22:08 +0000)]
Split body of mails not respecting RFC2822

For mails which has a body not respecting RFC2822 (which often happen with
crontabs) try to split by words finding the last space before 1000's character

If no spaces are found then consider the mail to be malformed anyway

PR: 208261

6 years agoOptimize telldir(3)
Alan Somers [Wed, 6 Dec 2017 22:06:48 +0000 (22:06 +0000)]
Optimize telldir(3)

Currently each call to telldir() requires a malloc and adds an entry to a
linked list which must be traversed on future telldir(), seekdir(),
closedir(), and readdir() calls. Applications that call telldir() for every
directory entry incur O(n^2) behavior in readdir() and O(n) in telldir() and
closedir().

This optimization eliminates the malloc() and linked list in most cases by
packing the relevant information into a single long. On 64-bit architectures
msdosfs, NFS, tmpfs, UFS, and ZFS can all use the packed representation.  On
32-bit architectures msdosfs, NFS, and UFS can use the packed
representation, but ZFS and tmpfs can only use it for about the first 128
files per directory.  Memory savings is about 50 bytes per telldir(3) call.
Speedup for telldir()-heavy directory traversals is about 20-30x for one
million files per directory.

Reviewed by: kib, mav, mckusick
MFC after: 3 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D13385

6 years agoThe function make_relative_prefix_1 does not properly free locally
Stephen J. Kiernan [Wed, 6 Dec 2017 21:18:45 +0000 (21:18 +0000)]
The function make_relative_prefix_1 does not properly free locally
allocated memory when it returns early.

Free the memory associated with the variables full_programe, bin_dirs,
prog_dirs, and prefix_dirs when the function returns early.

Submitted by: Tom Rix <trix@juniper.net>
Reviewed by: jhibbits, emaste
Approved by: sjg (mentor)
Obtained from: Juniper Networks, Inc.
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D9691

6 years agoThe function fwscanf() return value is wrong when encountering an early
Stephen J. Kiernan [Wed, 6 Dec 2017 21:12:24 +0000 (21:12 +0000)]
The function fwscanf() return value is wrong when encountering an early
matching failure.

According to the Open Group documentation for fwscanf:
"Upon successful completion, these functions shall return the number of
successfully matched and assigned input items; this number can be zero in
the event of an early matching failure."

Without this change, fwscanf would return EOF in the case of an early
matching failure, instead of the proper return value of 0.

This change aligns fwscanf(3) with the implementation in fscanf(3).

PR: 202240
Submitted by: rajendra.sy@gmail.com
Reviewed by: jhb, cem
Approved by: sjg (mentor)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D13288

6 years agoAUTO_OBJ: Don't create nested OBJDIRS with print-dir or make -n.
Bryan Drewery [Wed, 6 Dec 2017 21:00:41 +0000 (21:00 +0000)]
AUTO_OBJ: Don't create nested OBJDIRS with print-dir or make -n.

Sponsored by: Dell EMC

6 years agoUpdate to 2017-12-06
Baptiste Daroussin [Wed, 6 Dec 2017 20:23:38 +0000 (20:23 +0000)]
Update to 2017-12-06

MFC after: 2 days

6 years agosdiff(1) can now be built defaults warning level
Baptiste Daroussin [Wed, 6 Dec 2017 20:10:05 +0000 (20:10 +0000)]
sdiff(1) can now be built defaults warning level

6 years agoRename variables confusing gcc 4.2.1
Baptiste Daroussin [Wed, 6 Dec 2017 20:09:30 +0000 (20:09 +0000)]
Rename variables confusing gcc 4.2.1

While there is no reason it shadows div(3) gcc 4.2.1 complains about it

MFC after: 1 week

6 years agoFix -Wincompatible-pointer-types-discards-qualifiers warnings
Baptiste Daroussin [Wed, 6 Dec 2017 20:05:36 +0000 (20:05 +0000)]
Fix -Wincompatible-pointer-types-discards-qualifiers warnings

MFC after: 1 week

6 years agoUse unique wait messages in the page daemon control loop.
Mark Johnston [Wed, 6 Dec 2017 18:36:54 +0000 (18:36 +0000)]
Use unique wait messages in the page daemon control loop.

Discussed with: alc
MFC after: 1 week

6 years agotcpdump: remove undesired svn:keywords property from contrib
Ed Maste [Wed, 6 Dec 2017 18:11:56 +0000 (18:11 +0000)]
tcpdump: remove undesired svn:keywords property from contrib

Reported by: glebius
MFC after: 6 days
MFC with: r326613

6 years agoUse a global extern declaration to appease gcc.
Mark Johnston [Wed, 6 Dec 2017 17:52:01 +0000 (17:52 +0000)]
Use a global extern declaration to appease gcc.

Reported by: gjb
X-MFC with: r326498

6 years agoFix crash with a dotless hostname.
Gleb Smirnoff [Wed, 6 Dec 2017 17:50:10 +0000 (17:50 +0000)]
Fix crash with a dotless hostname.

6 years agocam: fix sign-extension error in adagetparams
Alan Somers [Wed, 6 Dec 2017 17:01:25 +0000 (17:01 +0000)]
cam: fix sign-extension error in adagetparams

adagetparams contains a sign-extension error that will cause the sector
count to be incorrectly calculated for ATA disks of >=1TiB that still use
CHS addressing. Disks using LBA48 addressing are unaffected.

Reported by: Coverity
CID: 1007296
Reviewed by: ken
MFC after: 3 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D13198

6 years agoaw_mp.c: use argument name in macros
Kyle Evans [Wed, 6 Dec 2017 14:53:53 +0000 (14:53 +0000)]
aw_mp.c: use argument name in macros

Rather than relying on 'cluster' existing in the context they're used in,
use the argument name.

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

6 years agoReally fix typo and improve wording of the comment
Baptiste Daroussin [Wed, 6 Dec 2017 10:47:50 +0000 (10:47 +0000)]
Really fix typo and improve wording of the comment

6 years agoFix typo
Baptiste Daroussin [Wed, 6 Dec 2017 10:20:01 +0000 (10:20 +0000)]
Fix typo

Reported by: danfe

6 years agoRevert local changes made to make zstd(1) frontend behave like gzip(1) and friends
Baptiste Daroussin [Wed, 6 Dec 2017 09:53:10 +0000 (09:53 +0000)]
Revert local changes made to make zstd(1) frontend behave like gzip(1) and friends

This change was made to allow zstd(1) to be a dropin replacement for gzip(1) and
friends, allowing easy integration, in particular with newsyslog(8). At the
price of having a zstd(1) command which by default behaves differently than what
upstream default, confusing users.

newsyslog(8) has been adapted to now be more flexible in what it accepts as
compression program, so we can switch back zstd(1) to its default behaviour

Reported by: many

6 years agoAllow newsyslog to execute compression commands which
Baptiste Daroussin [Wed, 6 Dec 2017 09:44:35 +0000 (09:44 +0000)]
Allow newsyslog to execute compression commands which
have a semantic different than the traditional gzip(1)

This is done to allow to use zstd(1) as a compression tool without
having to patch it to change its default behavior.

6 years agodhcp_try_rfc1048() is not used any more
Toomas Soome [Wed, 6 Dec 2017 06:49:53 +0000 (06:49 +0000)]
dhcp_try_rfc1048() is not used any more

Remove unused function.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D13382

6 years agoDe-const to match changes in userboot.h
Warner Losh [Wed, 6 Dec 2017 05:18:52 +0000 (05:18 +0000)]
De-const to match changes in userboot.h

Sponsored by: Netflix

6 years agosponge(1): revert
Eitan Adler [Wed, 6 Dec 2017 02:47:46 +0000 (02:47 +0000)]
sponge(1): revert

I did a complete buildworld and test... with the program disconnected
from the tree. Revert the change for now.

(this keeps the change to .arclint which is still correct)

Wearing: my pointhat

6 years agoUpdate tcpdump to 4.9.2
Ed Maste [Wed, 6 Dec 2017 02:21:11 +0000 (02:21 +0000)]
Update tcpdump to 4.9.2

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

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

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

6 years agoAllow custom overrides of mmap attribute for VT framebuffer
Justin Hibbits [Wed, 6 Dec 2017 02:06:14 +0000 (02:06 +0000)]
Allow custom overrides of mmap attribute for VT framebuffer

Summary:
As in /dev/fb, allow the framebuffer driver to override the default memattr for
mmap(2).  This is analogous to the change in 306555.

Reviewed By: ray
Differential Revision: https://reviews.freebsd.org/D13331

6 years agoUse unsigned intptr_t type for framebuffer addresses
Justin Hibbits [Wed, 6 Dec 2017 02:05:21 +0000 (02:05 +0000)]
Use unsigned intptr_t type for framebuffer addresses

Summary:
Some architectures (powerpc Book-E) have a vm_paddr_t larger than intptr_t.
Casting from the intptr_t to vm_paddr_t causes sign extension, leading to a
potentially invalid address.

This was seen when running X on a PowerPC P1022 machine, which mapped the
backing framebuffer at 0xc1800000.  When mmap()d by X, this yielded an invalid
address of 0xffffffffc1800000, or, as the hardware would see it, 0xfc1800000.

Reviewed By: ray
Differential Revision: https://reviews.freebsd.org/D13332

6 years agoFix random() prototype to match the system.
Warner Losh [Wed, 6 Dec 2017 02:00:09 +0000 (02:00 +0000)]
Fix random() prototype to match the system.

Sponsored by: Netflix

6 years agoMake putenv and getenv match the userland definition of these
Warner Losh [Wed, 6 Dec 2017 02:00:00 +0000 (02:00 +0000)]
Make putenv and getenv match the userland definition of these
functions, tweak man page and one variable that shouldn't be const
anymore.

Sponsored by: Netflix

6 years agoFix file missed in r326607.
Gleb Smirnoff [Wed, 6 Dec 2017 00:44:49 +0000 (00:44 +0000)]
Fix file missed in r326607.

6 years agoReduce pollution via tmpfs.h.
Gleb Smirnoff [Wed, 6 Dec 2017 00:42:08 +0000 (00:42 +0000)]
Reduce pollution via tmpfs.h.

6 years agoRemove unused 4th argument to match the standard error routines.
Warner Losh [Wed, 6 Dec 2017 00:29:50 +0000 (00:29 +0000)]
Remove unused 4th argument to match the standard error routines.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D13386

6 years agoAdd NVME as a known device type for devstat processing.
Warner Losh [Wed, 6 Dec 2017 00:29:43 +0000 (00:29 +0000)]
Add NVME as a known device type for devstat processing.

Also, reduce the amount of cut and pasted code a little since only two
args are different in the devstat_end_transaction calls.

Sponsored by: Netflix

6 years agomdoc(7): Update .Dd for previous commit
Jilles Tjoelker [Tue, 5 Dec 2017 23:06:15 +0000 (23:06 +0000)]
mdoc(7): Update .Dd for previous commit

6 years agoRemove stray cam_periph_async call. It's called twice this way. While
Warner Losh [Tue, 5 Dec 2017 23:02:31 +0000 (23:02 +0000)]
Remove stray cam_periph_async call. It's called twice this way. While
currently harmless for AC_UNIT_ATTENTION event (cam_periph_async does
nothing with them), it's still in error because if it were to start in
the future, it would be done twice.

Sponsored by: Netflix

6 years agomdocml: Add IEEE Std 1003.1-2008, 2016 edition
Jilles Tjoelker [Tue, 5 Dec 2017 23:00:41 +0000 (23:00 +0000)]
mdocml: Add IEEE Std 1003.1-2008, 2016 edition

Also document IEEE Std 1003.1-2008, 2013 edition in mdoc(7) (as well as the
2016 edition).

Submitted by: Yuri Pankov
Reviewed by: bjk
Differential Revision: https://reviews.freebsd.org/D13349

6 years agoSince this is contrib code, create an upstreamable version of my
Warner Losh [Tue, 5 Dec 2017 22:24:20 +0000 (22:24 +0000)]
Since this is contrib code, create an upstreamable version of my
change. Now on FreeBSD and NetBSD if _STANDALONE is defined, we
include the kernel version with alloances for the quirky differences
between the two.

Sponsored by: Netflix

6 years agoImplement "vidcontrol -h <history_size>" for vt(4)
Ed Maste [Tue, 5 Dec 2017 22:19:59 +0000 (22:19 +0000)]
Implement "vidcontrol -h <history_size>" for vt(4)

PR: 210415
Submitted by: Siva Mahadevan
Reviewed by: ray (earlier)
MFC after: 1 month
Relnotes: yes
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D11814

6 years agodtb/allwinner: Restore a83t/BananaPi-M3 DTS after r342822
Kyle Evans [Tue, 5 Dec 2017 22:05:10 +0000 (22:05 +0000)]
dtb/allwinner: Restore a83t/BananaPi-M3 DTS after r342822

sinovoip-bpi-m3.dts was disconnected from the build in r324822. Since then,
a CCU driver has been added and several other changes have been made to
make us compatible with upstream DTS for this board.

Add links for older DTB that might be used: our u-boot port was expecting
sinovoip-bpi-m3.dtb up until ports r455629, and our u-boot will not be
switching to the upstream name (sun8i-a83t-bananapi-m3) quite yet.

Discussed with: manu

6 years agovnic: apply hardware L3 checksum only for IPv4
Ed Maste [Tue, 5 Dec 2017 22:02:46 +0000 (22:02 +0000)]
vnic: apply hardware L3 checksum only for IPv4

Previously we set the csum_l3 flag for IPv4 and IPv6, but only IPv4
should have header checksumming applied.

Prompted by Linux commit fa6d7cb5d76cf0467c61420fc9238045aedfd379.

Reviewed by: bz
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D13366

6 years agoMakefile.inc1: map mips MACHINE_/TARGET_ARCH to triples
Ed Maste [Tue, 5 Dec 2017 21:42:09 +0000 (21:42 +0000)]
Makefile.inc1: map mips MACHINE_/TARGET_ARCH to triples

This helps Clang MIPS builds.

Reviewed by: bdrewery, jhb (earlier version)
Differential Revision: https://reviews.freebsd.org/D12171

6 years agoa10_gpio: Don't do read/set dance if pin is already configured for output
Kyle Evans [Tue, 5 Dec 2017 21:40:52 +0000 (21:40 +0000)]
a10_gpio: Don't do read/set dance if pin is already configured for output

This fixes some regulator issues with a83t/BananaPi-M3; the pin value was
getting clobbered as we reconfigured the pin when initializing the
regulator.

Discussed with: ian

6 years agoNow that we offer a semi-sane standards-ish set of #include files in
Warner Losh [Tue, 5 Dec 2017 21:38:24 +0000 (21:38 +0000)]
Now that we offer a semi-sane standards-ish set of #include files in
the stand environment that's safe to use (and insulated from whatever
build env you might normally have), stop hacking the bzlib and zlib
sources with sed. There's no longer any need.

Sponsored by: Netflix

6 years agoStop building with the standard system headers.
Warner Losh [Tue, 5 Dec 2017 21:38:19 +0000 (21:38 +0000)]
Stop building with the standard system headers.

Building with the standard system headers isn't a perfect match to the
stand environment. Instead, copy over the files we know are safe to
use and constrain what else is used. We use -nostdinc to achieve this.

This also fixes issues with building 32-bit libraries on amd64
sometimes pulling in the wrong cpufunc.h giving an error now that we
stop on errors. It will also enable an easier transition to lua boot.

Sponsored by: Netflix

6 years agoDon't inherit CFLAGS. This a specialized test program, and can be
Warner Losh [Tue, 5 Dec 2017 21:38:14 +0000 (21:38 +0000)]
Don't inherit CFLAGS. This a specialized test program, and can be
built with mostly default flags. Do so in anticipation of the rest of
stand not building with system headers.

Sponsored by: Netflix

6 years agoThis isn't NetBSD specific code. Include these for any kernel /
Warner Losh [Tue, 5 Dec 2017 21:38:10 +0000 (21:38 +0000)]
This isn't NetBSD specific code. Include these for any kernel /
standalone use. Tweak for FreeBSD's quirky limits.h stuff.

Sponsored by: Netflix

6 years agoPrefer stdint.h to inttypes.h since the added prototypes form the
Warner Losh [Tue, 5 Dec 2017 21:38:04 +0000 (21:38 +0000)]
Prefer stdint.h to inttypes.h since the added prototypes form the
latter aren't used. Prefer sys/link_elf.h to link.h so we're only
dependent on the kernel tree. The default installation of link.h just
includes this file, and any benefit from that is outweighed by the
hassle it causes. This reduces the footprint of files needed from the
system includes (or sysroot in buildworld).

Sponsored by: Netflix

6 years agoMake sure we include the right path for skein.h, as well only include
Warner Losh [Tue, 5 Dec 2017 21:37:59 +0000 (21:37 +0000)]
Make sure we include the right path for skein.h, as well only include
the ZFS flags for zfs_modules.c. This keeps us from pulling from the
system or sysroot during buildworld.

6 years agoNeed to include skein in the include path so we don't get this from
Warner Losh [Tue, 5 Dec 2017 21:37:55 +0000 (21:37 +0000)]
Need to include skein in the include path so we don't get this from
the "system" headers (though in buildworld, it's from the recently
built sysroot).

Sponsored by: Netflix

6 years agoUse the kernel relative paths, rather than the userland relative paths
Warner Losh [Tue, 5 Dec 2017 21:37:50 +0000 (21:37 +0000)]
Use the kernel relative paths, rather than the userland relative paths
for the iso9660 header files.

Sponsored by: Netflix

6 years agoNo need to include the userland md5.h, the kernel one is just fine.
Warner Losh [Tue, 5 Dec 2017 21:37:45 +0000 (21:37 +0000)]
No need to include the userland md5.h, the kernel one is just fine.

Sponsored by: Netflix

6 years agoInclude ficl.h before anything else and avoid including anything at
Warner Losh [Tue, 5 Dec 2017 21:37:41 +0000 (21:37 +0000)]
Include ficl.h before anything else and avoid including anything at
all if we're not building float.

Sponsored by: Netflix

6 years agoWhen building standalone, include stand.h rather than the kernel
Warner Losh [Tue, 5 Dec 2017 21:37:32 +0000 (21:37 +0000)]
When building standalone, include stand.h rather than the kernel
includes or the userland includes.

Sponsored by: Netflix

6 years agonative-xtools: Ensure GCC files are cleaned up.
Bryan Drewery [Tue, 5 Dec 2017 21:36:08 +0000 (21:36 +0000)]
native-xtools: Ensure GCC files are cleaned up.

Because we force enable MK_GCC when building we need to also force
enable it for the cleaning phase.  Otherwise the NXB_TARGET files
are found in the next build's kernel-toolchain phase and cause
an error.

Reported by: sbruno
X-MFC-With: r325001
MFC after: 1 month
Sponsored by: Dell EMC

6 years agoDeal with bmake-20170301 no longer resolving -C like it used to.
Bryan Drewery [Tue, 5 Dec 2017 21:30:22 +0000 (21:30 +0000)]
Deal with bmake-20170301 no longer resolving -C like it used to.

Several checks assume .CURDIR is resolved, such as for determining RELDIR from
SRCTOP/.CURDIR.  If -C is used then the path is no longer resolved like it was
before which is problematic for symlinked source trees.  A similar change was
also made to ports post bmake-20170301.

This fixes 'make -C <symlinked path> buildworld' using the wrong OBJDIR.

Reported by: rstone
Sponsored by: Dell EMC

6 years agoHandle writable-but-not-a-directory cases for writable OBJDIR check.
Bryan Drewery [Tue, 5 Dec 2017 21:30:17 +0000 (21:30 +0000)]
Handle writable-but-not-a-directory cases for writable OBJDIR check.

Sponsored by: Dell EMC

6 years agoAUTO_OBJ: For all top-level targets enforce using an OBJDIR.
Bryan Drewery [Tue, 5 Dec 2017 21:29:47 +0000 (21:29 +0000)]
AUTO_OBJ: For all top-level targets enforce using an OBJDIR.

This will cause an error if the wanted OBJDIR is not writable.  Previously it
would cause the files to generate to the source tree.  This was too obscure and
things like buildworld really expect a proper OBJDIR layout.

Sponsored by: Dell EMC

6 years agoAllwinner H5: Enhance support
Emmanuel Vadot [Tue, 5 Dec 2017 21:21:23 +0000 (21:21 +0000)]
Allwinner H5: Enhance support

Add proper gpio and clock support

6 years agoiflib: Support to padding Ethernet frames to a min size
Stephen Hurd [Tue, 5 Dec 2017 21:00:31 +0000 (21:00 +0000)]
iflib: Support to padding Ethernet frames to a min size

Some bnxt devices do not correctly send frames smaller than
52 bytes (without CRC), so add a quirk that will pad frames to an
arbitrary size before passing off to the encap routine.

Reported by: Bhargava Chenna Marreddy <bhargava.marreddy@broadcom.com>
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D13269

6 years agoAvoid calling CURVNET_[SET|RESTORE] for each packet
Stephen Hurd [Tue, 5 Dec 2017 20:43:24 +0000 (20:43 +0000)]
Avoid calling CURVNET_[SET|RESTORE] for each packet

The LRO possible test was calling CURVNET_SET once for IPv4 or IPv6 for
each packet in a chain. Only call it once per chain instead.

Submitted by: Matthew Macy <mmacy@mattmacy.io>
Reviewed by: cem, ae
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D13368

6 years agouse @@@ instead of @@ in __sym_default
Ed Maste [Tue, 5 Dec 2017 20:19:13 +0000 (20:19 +0000)]
use @@@ instead of @@ in __sym_default

Using
    .symver foo,foo@@VER
causes foo and foo@@VER to be output to the .o file. This requires foo
to be weak since the linker handles foo@@VER as foo.

Using
    .symver foo,foo@@@VER
causes just foo@@ver to be output and avoid the need for making foo
weak. It also reduces the constraint on how exactly a linker has to
handle foo and foo@@VER being present.

Submitted by: Rafael EspĂ­ndola
Reviewed by: dim, kib
Differential Revision: https://reviews.freebsd.org/D11653

6 years agoFix build after r326554; reconnect sponge to build again.
Cy Schubert [Tue, 5 Dec 2017 20:06:53 +0000 (20:06 +0000)]
Fix build after r326554; reconnect sponge to build again.

6 years agoGenerate fully RFC3164 compliant messages, with timestamp and hostname.
Gleb Smirnoff [Tue, 5 Dec 2017 19:55:53 +0000 (19:55 +0000)]
Generate fully RFC3164 compliant messages, with timestamp and hostname.
Allow to set hostname to any string with -H.

MFC after: 2 months

6 years agoWhen parsing remote messages, require them to have standard timestamp
Gleb Smirnoff [Tue, 5 Dec 2017 19:54:55 +0000 (19:54 +0000)]
When parsing remote messages, require them to have standard timestamp
field, and support properly parse out the hostname as described by RFC3164,
which wasn't done before.  However, don't discard message if it doesn't
have hostname, for compatibility.

Enable logging of the message supplied hostname instead of real hostname
with -H switch.

PR: 200933
Reported by: Konstantin Pavlov <thresh nginx.com>
MFC after: 2 months

6 years agoioat(4): Add Skylake Xeon PCI-ID
Conrad Meyer [Tue, 5 Dec 2017 18:48:58 +0000 (18:48 +0000)]
ioat(4): Add Skylake Xeon PCI-ID

SKX IOAT is just another 3.2 version of the CBDMA engine.

Submitted by: Deepak Veliath <deepak.veliath AT isilon.com>
Sponsored by: Dell EMC Isilon

6 years agoifconfig(8): Display extended compliance code string for SFP transceivers
Eric Joyner [Tue, 5 Dec 2017 18:42:07 +0000 (18:42 +0000)]
ifconfig(8): Display extended compliance code string for SFP transceivers

- Updates tables in affected files with new entries from newer spec
revisions of SFF-8472, SFF-8024, and SFF-8636

- Change ifconfig to read and display the extended compliance code for
SFP media if the extended compliance code is not 0. This was being displayed
for QSFP transceivers only, but SFP28 media uses this to report 25G
capability.

Reviewed by: melifaro, sbruno
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D13286

6 years agoFor now, disconnect usr.bin/sponge from the build, to unbreak world
Dimitry Andric [Tue, 5 Dec 2017 18:26:34 +0000 (18:26 +0000)]
For now, disconnect usr.bin/sponge from the build, to unbreak world
after r326557.

Noticed by: many
Pointy hat to: eadler

6 years agoFix cyclic dependency after r326552.
Bryan Drewery [Tue, 5 Dec 2017 17:23:33 +0000 (17:23 +0000)]
Fix cyclic dependency after r326552.

The OBJS_DEPEND_GUESS mechanism was making vmx_genassym.o depend
on all headers along with vmx_assym.h, though vmx_assym.h depends
on having vmx_genassym.o present to generate.  Moving the headers
to DPSRCS is enough to resolve the issue as they will no longer
be implicit dependencies for all objects.  Because of this we
need explicit OBJS_DEPEND_GUESS entries to ensure the headers
are generated when needed for the *_support.o files that need
them.

X-MFC-With: r326552
MFC after: 2 weeks
Sponsored by: Dell EMC

6 years agoddb: fix validation of cpu id in 'set db_cpu=x'
Andriy Gapon [Tue, 5 Dec 2017 14:22:08 +0000 (14:22 +0000)]
ddb: fix validation of cpu id in 'set db_cpu=x'

MFC after: 1 week

6 years agoFix cut & paste error from r326558.
Cy Schubert [Tue, 5 Dec 2017 13:41:21 +0000 (13:41 +0000)]
Fix cut & paste error from r326558.

Reported by: ed
MFC after: 1 week
X-MFC with: r326558
Pointy hat to: cy

6 years agoMake EC2 instances use Amazon's NTP service for time synchronization.
Colin Percival [Tue, 5 Dec 2017 09:22:14 +0000 (09:22 +0000)]
Make EC2 instances use Amazon's NTP service for time synchronization.

Since Amazon provides NTP servers within their network, this should
be far superior to using the default NTP pools; and since the service
is provided by Amazon there's very little risk in enabling it by
default.  (If someone is able to compromise Amazon's NTP servers and
exploit them to attack EC2 instances, they would almost certainly be
able to compromise EC2 instances even without ntpd running...)

MFC after: 1 week
Relnotes: EC2 instances now keep their clocks synchronized using
the Amazon Time Sync Service (aka. NTP).

6 years agoResurrect r321659: Turn off ChallengeResponseAuthentication for EC2 AMIs.
Colin Percival [Tue, 5 Dec 2017 09:08:48 +0000 (09:08 +0000)]
Resurrect r321659: Turn off ChallengeResponseAuthentication for EC2 AMIs.

EC2 instances are normally launched with an SSH public key specified,
which is then used for logging in (by default, as 'ec2-user').  Having
ChallengeResponseAuthentication enabled (as FreeBSD's default sshd_config
does) has no functional effect in a new EC2 instance, since you can't log
in using a password until a password has been set -- but having this
enabled results in alerts from automated scanning tools which can detect
that sshd advertises support for keyboard-interactive logins (since they
can't detect that accounts have no password set).

EC2 users who want to use passwords to log in to their instances will need
to set 'ChallengeResponseAuthentication yes' in FreeBSD 12.0 and later.

Discussed with: gjb, gtetlow, emaste, des
Requested by: Amazon
X-MFC: No
Relnotes: ChallengeResponseAuthentication is turned off by default in
Amazon EC2 AMIs.

6 years agoCorrectly prefix the infiniband include directory for buildworld. This fixes
Hans Petter Selasky [Tue, 5 Dec 2017 08:25:17 +0000 (08:25 +0000)]
Correctly prefix the infiniband include directory for buildworld. This fixes
the OFED buildworld target, WITH_OFED=YES, when the include files are not
already installed locally, but only in the temporary object directory.

Found by: kib
Sponsored by: Mellanox Technologies

6 years agoUse strlcpy().
Xin LI [Tue, 5 Dec 2017 07:21:47 +0000 (07:21 +0000)]
Use strlcpy().

MFC after: 2 weeks

6 years agoUse strlcpy().
Xin LI [Tue, 5 Dec 2017 07:11:56 +0000 (07:11 +0000)]
Use strlcpy().

MFC after: 2 weeks

6 years agoCreate links for xzdiff.
Xin LI [Tue, 5 Dec 2017 07:01:10 +0000 (07:01 +0000)]
Create links for xzdiff.

MFC after: 2 weeks

6 years agofdformat is a sysadmin command and thus its man page should be in
Cy Schubert [Tue, 5 Dec 2017 05:02:46 +0000 (05:02 +0000)]
fdformat is a sysadmin command and thus its man page should be in
volume 8 instead of volume 1.

Reviewed by: imp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D13370

6 years agosponge(1): fix my tests
Eitan Adler [Tue, 5 Dec 2017 04:43:39 +0000 (04:43 +0000)]
sponge(1): fix my tests

Reviewed by: kevans

6 years agodc(1): fix input of non-decimal fractional numbers
Alan Somers [Tue, 5 Dec 2017 04:22:35 +0000 (04:22 +0000)]
dc(1): fix input of non-decimal fractional numbers

Inputting fractional non-decimal numbers has never worked correctly in our
OpenBSD-derived dc(1). It truncates the input to a number of decimal places
equal to the number of hexadecimal (or whatever base) places given on the
input. That's unacceptable, because many numbers require more precision to
represent in base 10 than in their original bases.

Fix this bug by using as many decimal places as needed to represent the
input, up to the maximum of the global scale factor.

This has one mildly surprising side effect: the scale of a number entered in
non-decimal mode will no longer necessarily equal the number of hexadecimal
(or whatever base) places given on the input. I think that's an acceptable
behavior change, given that inputting fractional non-decimal numbers never
worked in the first place, and the man page doesn't specify whether trailing
zeros on the input should affect a number's scale.

PR: 206230
Reported by: nibbana@gmx.us
Reviewed by: pfg
Differential Revision: https://reviews.freebsd.org/D13336