freebsd.git
6 years agoboot1.c needs EFI_ZFS_BOOT too, so add it globally. Otherwise we'll
imp [Fri, 8 Dec 2017 19:57:26 +0000 (19:57 +0000)]
boot1.c needs EFI_ZFS_BOOT too, so add it globally. Otherwise we'll
not be able to actually read ZFS partitions.

Submitted by: kevans@

6 years agoBuild WITHOUT_FORTH too, at least for amd64 and i386
imp [Fri, 8 Dec 2017 19:57:21 +0000 (19:57 +0000)]
Build WITHOUT_FORTH too, at least for amd64 and i386

Sponsored by: Netflix

6 years agoCreate interp class.
imp [Fri, 8 Dec 2017 19:57:16 +0000 (19:57 +0000)]
Create interp class.

Create an interp class. Use it to separate out the different types of
interpreters: forth and simple with function pointers rather than
via #ifdefs.

Obtained from: lua boot loader project
    (via https://bsdimp@github.com/bsdimp/freebsd.git lua-bootloader)
Sponsored by: Netflix

6 years agoConst poison a couple of interfaces.
imp [Fri, 8 Dec 2017 19:57:11 +0000 (19:57 +0000)]
Const poison a couple of interfaces.

Obtained from: lua boot project
Sponsored by: Netflix

6 years agoPut the files we're copying over into a few variables and add them to
imp [Fri, 8 Dec 2017 19:57:06 +0000 (19:57 +0000)]
Put the files we're copying over into a few variables and add them to
CLEANDIRS and CLEANFILES so make clean removes any divots.

Sponsored by: Netflix

6 years agoProvide implementations for iscntrl, ispunct and isgraph.
imp [Fri, 8 Dec 2017 19:57:02 +0000 (19:57 +0000)]
Provide implementations for iscntrl, ispunct and isgraph.

Sponsored by: Netflix

6 years agoRemove _KERNEL hack now that errno.h does the right thing when
imp [Fri, 8 Dec 2017 19:56:57 +0000 (19:56 +0000)]
Remove _KERNEL hack now that errno.h does the right thing when
_STANDALONE is defined.

Sponsored By: Netflix

6 years agoAdd partial support signal.h functioanlity. Pull in machine/signal.h
imp [Fri, 8 Dec 2017 19:56:35 +0000 (19:56 +0000)]
Add partial support signal.h functioanlity. Pull in machine/signal.h
to define sig_atomic_t.

Sponsored by: Netflix

6 years agoFree mbuf chain when m_dup fails
shurd [Fri, 8 Dec 2017 19:50:06 +0000 (19:50 +0000)]
Free mbuf chain when m_dup fails

Fix memory leak where mbuf chain wasn't free()d if iflib_ether_pad()
has a failure in m_dup().

Reported by: "Ryan Stone" <rysto32@gmail.com>
Sponsored by: Limelight Networks

6 years agoActually add the -x setenv test Makefile, missed in r326499.
markj [Fri, 8 Dec 2017 19:26:25 +0000 (19:26 +0000)]
Actually add the -x setenv test Makefile, missed in r326499.

X-MFC with: r326499

6 years agoHandle read-only mbufs in iflib ether pad function
shurd [Fri, 8 Dec 2017 18:43:31 +0000 (18:43 +0000)]
Handle read-only mbufs in iflib ether pad function

If ethernet padding is enabled, and a read-only mbuf is passed,
it would modify the mbuf using m_append(). Instead, call m_dup() and
append to the new packet.

Reported by: Pyun YongHyeon
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D13414

6 years agoSPDX: more ISC-related files.
pfg [Fri, 8 Dec 2017 17:52:53 +0000 (17:52 +0000)]
SPDX: more ISC-related files.

6 years agoat(1): annotate some intended switch-case fallthroughs
asomers [Fri, 8 Dec 2017 17:15:20 +0000 (17:15 +0000)]
at(1): annotate some intended switch-case fallthroughs

Reported by: Coverity
CID: 1008191
MFC after: 3 weeks
Sponsored by: Spectra Logic Corp

6 years agoSPDX: license IDs for some ISC-related files.
pfg [Fri, 8 Dec 2017 15:57:29 +0000 (15:57 +0000)]
SPDX: license IDs for some ISC-related files.

6 years agoSet the io width when using an ACPI uart. Previously it would only ever be
andrew [Fri, 8 Dec 2017 10:05:23 +0000 (10:05 +0000)]
Set the io width when using an ACPI uart. Previously it would only ever be
set when finding the uart from the device tree.

Sponsored by: DARPA, AFRL

6 years agoRemove PTE VA mappings for tracked pages in 64-bit mode
jhibbits [Fri, 8 Dec 2017 03:49:53 +0000 (03:49 +0000)]
Remove PTE VA mappings for tracked pages in 64-bit mode

This was done in 32-bit mode, but not duplicated when 64-bit mode was
brought in.  Without this, stale mappings can be left, leading to odd
crashes when the wrong VA is checked in XX_PhysToVirt() (dpaa(4)).

6 years agoSupport mounted boot partitions in the installer. This allows the platform
nwhitehorn [Fri, 8 Dec 2017 00:57:13 +0000 (00:57 +0000)]
Support mounted boot partitions in the installer. This allows the platform
layer, for example, to specify that the EFI boot partition should be
mounted at /efi and formatted normally with newfs_msdos rather than
splatted to from /boot/boot1.efifat.

This commit adds only the API for this; actual platform use will come later.

6 years agoSeparate out send buffer autoscaling code into function, so that
glebius [Thu, 7 Dec 2017 22:36:58 +0000 (22:36 +0000)]
Separate out send buffer autoscaling code into function, so that
alternative TCP stacks may reuse it instead of pasting.

Obtained from: Netflix

6 years agoRetire SCTP_WITH_NO_CSUM option.
tuexen [Thu, 7 Dec 2017 22:19:08 +0000 (22:19 +0000)]
Retire SCTP_WITH_NO_CSUM option.

This option was used in the early days to allow performance measurements
extrapolating the use of SCTP checksum offloading. Since this feature
is now available, get rid of this option.
This also un-breaks the LINT kernel. Thanks to markj@ for making me
aware of the problem.

6 years agoAvoid setting -Wno-tentative-definition-incomplete-type with gcc.
markj [Thu, 7 Dec 2017 22:11:23 +0000 (22:11 +0000)]
Avoid setting -Wno-tentative-definition-incomplete-type with gcc.

No version of gcc that I've tried accepts this flag.

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

6 years agoRemove an unused incude from lib/msun/bsdsrc/b_log.c.
dim [Thu, 7 Dec 2017 20:41:23 +0000 (20:41 +0000)]
Remove an unused incude from lib/msun/bsdsrc/b_log.c.

Submitted by: Steve Kargl
MFC after: 3 days

6 years agoRemove the sentence in math(3) about some long double math functions not
dim [Thu, 7 Dec 2017 20:38:37 +0000 (20:38 +0000)]
Remove the sentence in math(3) about some long double math functions not
being available.

Submitted by: Steve Kargl
MFC after: 3 days

6 years agogeom_raid (RAID5): do not lose bp->bio_error, keep it in pbp->bio_error
eugen [Thu, 7 Dec 2017 20:09:17 +0000 (20:09 +0000)]
geom_raid (RAID5): do not lose bp->bio_error, keep it in pbp->bio_error
and return it by passing to g_raid_iodone()

Approved by: mav (mentor)
MFC after: 3 days

6 years agoFix the reldoc target in release/Makefile following doc commit r51264.
gjb [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
cem [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.
bz [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.
markj [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.
jkim [Thu, 7 Dec 2017 18:02:57 +0000 (18:02 +0000)]
Merge OpenSSL 1.0.2n.

6 years agoImport OpenSSL 1.0.2n.
jkim [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.
bdrewery [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.
markj [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().
kib [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.
bde [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
eugen [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
bryanv [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
asomers [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/
bjk [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
bjk [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.
bdrewery [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.
bdrewery [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.
bdrewery [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
asomers [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.
imp [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
imp [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.
imp [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
glebius [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
bapt [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)
asomers [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
stevek [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
stevek [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.
bdrewery [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
bapt [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
bapt [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
bapt [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
bapt [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.
markj [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
emaste [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.
markj [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.
glebius [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
asomers [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
kevans [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
bapt [Wed, 6 Dec 2017 10:47:50 +0000 (10:47 +0000)]
Really fix typo and improve wording of the comment

6 years agoFix typo
bapt [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
bapt [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
bapt [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
tsoome [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
imp [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
eadler [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
emaste [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
jhibbits [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
jhibbits [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.
imp [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
imp [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.
glebius [Wed, 6 Dec 2017 00:44:49 +0000 (00:44 +0000)]
Fix file missed in r326607.

6 years agoReduce pollution via tmpfs.h.
glebius [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.
imp [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.
imp [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 [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
imp [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 [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
imp [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)
emaste [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
kevans [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
emaste [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
emaste [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
kevans [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
imp [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.
imp [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
imp [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 /
imp [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
imp [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
imp [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
imp [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
imp [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.
imp [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
imp [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
imp [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.
bdrewery [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.
bdrewery [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.
bdrewery [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