]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
6 years agoMFC r319157:
ngie [Thu, 1 Jun 2017 06:35:37 +0000 (06:35 +0000)]
MFC r319157:

fma_test: mute a warning about unreachable code on amd64 by restructuring
the #ifdef block to only handle the rest of the logic in the loop in the
#else case.

CID: 1346844

6 years agoMFC r319158:
ngie [Thu, 1 Jun 2017 06:34:35 +0000 (06:34 +0000)]
MFC r319158:

logarithm_test: assert that feclearexcept succeeds

This helps ensure that test preconditons are fulfilled.

CID: 1346572

6 years agoMFC r318175,r318178,r318179:
ngie [Thu, 1 Jun 2017 06:26:35 +0000 (06:26 +0000)]
MFC r318175,r318178,r318179:

r318175:

procstat(1): clarify the Signal Disposition section

- Fix a typo (SIGIGN -> SIG_IGN). Use .Dv when referencing SIG_IGN.
- Use semi-colons as soft breaks when separating sentences for
  the FLAGS section.
- Tweak wording for C slightly to flow better and to be a bit
  more technically correct (signals with handlers installed will
  be caught by the target program).
- Reference signal(3) in the SEE ALSO section.

r318178:

procstat(1): document all possible `PRO` (network protocol) values

Reference the appropriate section 4 manpages for networking
protocols.

r318179:

procstat(1): also reference icmp(4) and sctp(4)

This was missed in the previous commit by accident.

MFC with: r318178

6 years agoMFC r319156,r319159:
ngie [Thu, 1 Jun 2017 06:17:01 +0000 (06:17 +0000)]
MFC r319156,r319159:

r319156:

:nvlist_unpack__duplicate_key : check the result of nvlist_pack(3)

This fixes a potential NULL pointer dereference.

CID: 1362051

r319159:

:dnvlist_get_string__default_value: fix a bogus string comparison test

Check actual_value vs "5", not "5" vs itself.

CID: 1362021

6 years agoMFC r319137:
kib [Thu, 1 Jun 2017 00:50:58 +0000 (00:50 +0000)]
MFC r319137:
Correct explanation of the dynamic tokens handling.

6 years agoMFC r319138:
kib [Thu, 1 Jun 2017 00:48:59 +0000 (00:48 +0000)]
MFC r319138:
Document direct execution mode for rtld.

6 years agoMFC r318592: compress: Allow uncompress -c with multiple pathnames,
jilles [Wed, 31 May 2017 21:54:21 +0000 (21:54 +0000)]
MFC r318592: compress: Allow uncompress -c with multiple pathnames,
as required by POSIX.

Per POSIX, allow passing multiple pathnames to uncompress -c, concatenating
the uncompressed data.

Passing multiple pathnames to compress -c remains disallowed, since the
result cannot be decompressed.

PR: 219387

6 years agoMFC r318586
vangyzen [Wed, 31 May 2017 21:20:42 +0000 (21:20 +0000)]
MFC r318586

dma.8: fix problems reported by igor and 'mandoc -Tlint'

dma.8:77:contraction:Queue the mail, but [don't] attempt to deliver it.
dma.8:85:repeated:s [are are] ignored.
dma.8:87:contraction:[Don't] run in the background.
dma.8:201:contraction:Use the catch-all alias only if you [don't] want any local mail to be

mandoc: dma.8:308:5: WARNING: macro neither callable nor escaped: Sm

6 years agoMFC r318585
vangyzen [Wed, 31 May 2017 21:19:21 +0000 (21:19 +0000)]
MFC r318585

dma.8: use the correct name for 'SECURETRANSFER'

The code uses 'SECURETRANS', but the config file uses 'SECURETRANSFER'.

6 years agoMFC r319022
vangyzen [Wed, 31 May 2017 21:16:10 +0000 (21:16 +0000)]
MFC r319022

Fix INSTALL_AS_USER with external nsswitch databases

The INSTALL_AS_USER option tells "install" to use the current
user name as the owner of the installed file.  The "install"
command executed by the build is statically linked, so it does not
load nsswitch modules, such as nss_ldap.so, so it fails when
the user is only defined in such a database.

Fix it to use the current UID instead of user name.  This works
for all users.  I expect it is also slightly more efficient.

Sponsored by: Dell EMC

6 years agoMFC r319020
vangyzen [Wed, 31 May 2017 21:15:05 +0000 (21:15 +0000)]
MFC r319020

Fix INSTALL_AS_USER

Move INSTALL_AS_USER into bsd.init.mk to maximize the chance that
it has final authority over fooOWN and fooGRP.

Reviewed by: sjg
Sponsored by: Dell EMC
Differential Revision: https://reviews.freebsd.org/D10810

6 years agoDocument r319349, byacc(1) version 20170201.
gjb [Wed, 31 May 2017 19:26:20 +0000 (19:26 +0000)]
Document r319349, byacc(1) version 20170201.

Sponsored by: The FreeBSD Foundation

6 years agoMFC: r313105, r313106
jkim [Wed, 31 May 2017 19:16:22 +0000 (19:16 +0000)]
MFC: r313105, r313106

Update byacc to 20170201.

6 years agoDocument r319244, rpcbind(8) warmstart support knob.
gjb [Wed, 31 May 2017 13:33:04 +0000 (13:33 +0000)]
Document r319244, rpcbind(8) warmstart support knob.

Sponsored by: The FreeBSD Foundation

6 years agoDocument r319269, cxgbe(4) firmware update.
gjb [Wed, 31 May 2017 13:33:03 +0000 (13:33 +0000)]
Document r319269, cxgbe(4) firmware update.

Sponsored by: The FreeBSD Foundation

6 years agoMFC r319086:
kib [Wed, 31 May 2017 09:23:21 +0000 (09:23 +0000)]
MFC r319086:
Mention that the basep argument to getdirentries(2) can be NULL.

6 years agoMFC r317632:
ngie [Wed, 31 May 2017 08:46:39 +0000 (08:46 +0000)]
MFC r317632:

Fix "make cscope-clean" when .OBJDIR already exists

The cscope generated files are always put in .CURDIR .

6 years agoMFC r316742:
ngie [Wed, 31 May 2017 08:43:46 +0000 (08:43 +0000)]
MFC r316742:

Clarify units for mediasize and sectorsize in DoFile(..)

They're byte quantities.

6 years agoMFC r316740:
ngie [Wed, 31 May 2017 08:42:31 +0000 (08:42 +0000)]
MFC r316740:

Clarify `minfree` warning message in check_space(..)

- State that the units are kB.
- Be more complete/concise in terms of what is required (in this case
  `minfree` must be at least `X`kB)

6 years agoMFC r317311,r317312,r319019:
ngie [Wed, 31 May 2017 08:40:39 +0000 (08:40 +0000)]
MFC r317311,r317312,r319019:

r317311:

Check for failures from getpagesize(3)

Return errno on failure, similar to the open(2) call above it.

CID: 1193753

r317312:

Fix type for `pagesize` to match the return type for getpagesize(3)
to fix the build

Pointyhat to: ngie

r319019:

Remove getpagesize(3) error checking added in r317312

getpagesize(3) no longer fails as of r317436.

6 years agoMFC r319056,r319058,r319059,r319060,r319061,r319078:
ngie [Wed, 31 May 2017 08:36:43 +0000 (08:36 +0000)]
MFC r319056,r319058,r319059,r319060,r319061,r319078:

r319056:

tests/sys/file/ftruncate_test: use an exit code of 1 instead
of -1 with err*(3).

An exit code of -1 is implementation defined -- it's best to stick
with something well-defined (1).

r319058:

Create a deterministic file in the kyua sandbox, instead of a
temporary file outside the kyua sandbox

This helps ensure that the file is removed at test exit, and as
a side effect, cures a warning about umasks with Coverity.

r319059:

Use an exit code of 1 instead of -1 for reasons noted in r319056

r319060:

Use main(void) instead of main(argc __unused, argv __unused)

r319061:

Don't leak accept_fd on thread completion

CID: 1296068

r319078:

Tweak r319058 slightly

- Specify an explicit mode when using O_CREAT per open(2).
- Fix the error message (add missing enclosing parentheses).

MFC with: r319058

6 years agoMFC r319027,r319028,r319029,r319030,r319031,r319033,r319034,r319035,r319036,r319037...
ngie [Wed, 31 May 2017 08:32:05 +0000 (08:32 +0000)]
MFC r319027,r319028,r319029,r319030,r319031,r319033,r319034,r319035,r319036,r319037,r319038,r319039,r319040,r319041,r319042,r319043,r319044,r319045,r319046:

r319027:

lib/libc/tests/nss: use calloc appropriately

The pattern used prior to this commit was `calloc(1, n * sizeof(type))`;
the pattern that should be used however is `calloc(n, sizeof(type))`.

r319028:

Sort make variables to suit style.Makefile(5)

This is being done prior to functional changes.

r319029:

Staticize functions and remove unused variables to aid with bumping WARNS

r319030:

Fix -Wsign-compare warnings

r319031:

getusershell_test: staticize run_tests(..) to fix warnings

r319033:

getserv_test: fix -Wsign-compare and -Wmissing-prototypes warnings

r319034:

getaddrinfo_test: fix -Wsign-compare warnings

r319035:

getrpc_test: fix -Wmissing-prototypes and -Wsign-compare warnings

r319036:

getproto_test: fix -Wmissing-prototypes and -Wsign-compare warnings

r319037:

getaddrinfo_test: mark unused function parameters __unused to fix -Wunused
warnings

r319038:

getusershell_test: mark mdata parameter in compare_usershell __unused

r319039:

getserv_test: mark unused parameters __unused to fix corresponding
warnings

r319040:

getrpc_test: fix -Wunused warnings

- Mark unused function parameters unused.
- Remove an unused function prototype.

r319041:

getproto_test: fix -Wunused warnings

Mark unused parameters __unused in functions.

r319042:

gethostby_test: fix multiple warning types

- Fix -Wmissing-declaration warning by staticizing run_tests.
- Fix -Wsign-compare warnings by casting size_t types to int
  for comparisons.

Reindent some of the code in sdump_hostent(..) to accomodate the
overall changes.

r319043:

getpw_test: fix -Wunused warnings

- Mark unused parameters __unused.
- Put dump_passwd under DEBUG as it's only used in that case.

r319044:

getgr_test: fix -Wunused warnings

r319045:

Fix -Wunused and -Wshadow warnings

r319046:

Fix a -Wunused-but-set-variable warning reported by gcc 6.3.0

6 years agoMFC r306691,310036:
delphij [Wed, 31 May 2017 08:21:16 +0000 (08:21 +0000)]
MFC r306691,310036:

Merge byacc 20161202.

6 years agoMFC r319062:
ngie [Wed, 31 May 2017 08:07:51 +0000 (08:07 +0000)]
MFC r319062:

Initial `srv` before using it in bind(2)

CID: 1357526

6 years agoMFC r304106:
delphij [Wed, 31 May 2017 06:47:56 +0000 (06:47 +0000)]
MFC r304106:

Add timingsafe_bcmp and timingsafe_memcmp.

Obtained from: OpenBSD
Reviewed by: trasz

6 years agoMFC r316649 (kan):
delphij [Wed, 31 May 2017 06:07:19 +0000 (06:07 +0000)]
MFC r316649 (kan):

Add missing double quote to fix r316635 commit.

6 years agoMFC r318514-r318515, r318517, r318917
delphij [Wed, 31 May 2017 05:52:32 +0000 (05:52 +0000)]
MFC r318514-r318515, r318517, r318917

r318514:
Use size_t.

Inspired by: OpenBSD src/lib/libc/stdlib/qsort.c,v 1.11

r318515:
The current qsort(3) implementation ignores the sizes of partitions, and
always perform recursion on the left partition, then use a tail call to
handle the right partition.  In the worst case this could require O(N)
levels of recursions.

Reduce the possible recursion level to log2(N) by always recursing on the
smaller partition instead.

Obtained from: PostgreSQL 9d6077abf9d6efd992a59f05ef5aba981ea32096

r318517:
Sync qsort.c with userland r318515.

(Note that MIN macro is removed in favor of sys/param.h's version).

PR: 213922

r318917:
Disconnect heimdal version of qsort.c from build because we are already
using libc's version of qsort.

PR: bin/213922

6 years agoMFC r311989 (cem):
delphij [Wed, 31 May 2017 05:45:06 +0000 (05:45 +0000)]
MFC r311989 (cem):

libkern: Remove obsolete 'register' keyword

6 years agoMFC r316635:
delphij [Wed, 31 May 2017 05:37:51 +0000 (05:37 +0000)]
MFC r316635:

Enable 16-bit longest_match for x86.

This gives a ~2% improvement in compression tests.

6 years agoMFC r313327:
delphij [Wed, 31 May 2017 05:29:20 +0000 (05:29 +0000)]
MFC r313327:

Reflect actual NetBSD revision we already have.

6 years agoMFC r313695, r313760, r314769, r314863, r314865, r316125
delphij [Wed, 31 May 2017 05:20:59 +0000 (05:20 +0000)]
MFC r313695, r313760, r314769, r314863, r314865, r316125

r313695:
MFV r313676: libpcap 1.8.1

r313760:
MFV r313759: license change for a few headers (4 clause BSD to 3 clause BSD).

X-MFC-with: r313695

r314769:
Remove compatibility with old libpcap.

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

r314863:
Stop installing pcap-int.h, which is the internal interface for libpcap.

Reference: https://github.com/the-tcpdump-group/libpcap/issues/560
PR: 217221

r314865:
Bump __FreeBSD_version for removal of pcap-int.h.

PR: 217221

r316125:
MFV r316124: Fix build when WITHOUT_INET6.

Reported by: Randy Westlund <rwestlun gmail com>

6 years agoMFC r315272, r315370
delphij [Wed, 31 May 2017 05:10:03 +0000 (05:10 +0000)]
MFC r315272, r315370

r315272:
Implement INHERIT_ZERO for minherit(2).

INHERIT_ZERO is an OpenBSD feature.

When a page is marked as such, it would be zeroed
upon fork().

This would be used in new arc4random(3) functions.

PR: 182610
Reviewed by: kib (earlier version)
Differential Revision: https://reviews.freebsd.org/D427

r315370:
The adj_free and max_free values of new_entry will be calculated and
assigned by subsequent vm_map_entry_link(), therefore, remove the
pointless copying.

Submitted by: alc

6 years agoMFC r315615:
delphij [Wed, 31 May 2017 05:05:32 +0000 (05:05 +0000)]
MFC r315615:

Make space style consistent with earlier entries.

6 years agoMFC r318975:
delphij [Wed, 31 May 2017 05:00:02 +0000 (05:00 +0000)]
MFC r318975:

Tighten /entropy permissions.

PR: 219527
Reported by: Lu Tung-Pin <lutungpin at openmailbox.org>
Submitted by: jilles

7 years agoMFC r318774:
np [Wed, 31 May 2017 00:43:34 +0000 (00:43 +0000)]
MFC r318774:

cxgbe/iw_cxgbe: sodisconnect failures are harmless and should not be
treated as fatal errors.

Sponsored by: Chelsio Communications

7 years agoMFC r318762:
np [Wed, 31 May 2017 00:16:05 +0000 (00:16 +0000)]
MFC r318762:

cxgbe(4): Update the T4, T5, and T6 firmwares to 1.16.45.0.

The latest firmware has a number of link related fixes, support for a
new custom card, and the fix for a bug that affected rate limiting on
FreeBSD.

Relnotes: Yes
Sponsored by: Chelsio Communications

7 years agoMFC r314176 and r318973.
np [Tue, 30 May 2017 21:55:48 +0000 (21:55 +0000)]
MFC r314176 and r318973.

r314176:
Add support for RDMA from userspace with T6 cards.

r318973:
libcxgb4: Use memcpy instead of copying WRs 8B at a time in the userspace
RDMA library for cxgbe(4).

Sponsored by: Chelsio Communications

7 years agoRegenerate src.conf(5)
ngie [Tue, 30 May 2017 18:08:33 +0000 (18:08 +0000)]
Regenerate src.conf(5)

7 years agoMFC r313169,r319246:
ngie [Tue, 30 May 2017 18:04:55 +0000 (18:04 +0000)]
MFC r313169,r319246:

r313169 (by wblock):

Clarify some option descriptions, add a line of text to makeman to
add the slightest hint of a shade of a clue of what it does.

r319246:

Use .Xr to reference libblacklist(3), blacklistctl(8), and blacklistd(8)

7 years agoMFC r317168:
ngie [Tue, 30 May 2017 17:47:19 +0000 (17:47 +0000)]
MFC r317168:

Add a knob, WITH*_RPCBIND_WARMSTART_SUPPORT, to allow the end-user to build
rpcbind(8) with/without warmstart support.

The knob defaults to off to preserve POLA for the feature.

See rpcbind(8) for more details about the warmstart feature.

Relnotes: yes

7 years agoMFC r317155,r317162,r317163,r317164:
ngie [Tue, 30 May 2017 17:37:40 +0000 (17:37 +0000)]
MFC r317155,r317162,r317163,r317164:

r317155:

rpcbind(8): wordsmith -h description and mention -W in the SYNOPSIS section

-W was already documented in the OPTIONS section.

r317162:

rpcbind(8): add a description for /var/run/rpcbind.sock under the FILES section

r317163:

rpcbind(8): post-humously document -w (warmstart) support added in r74462

warmstart support saves portmap/rpcbind(8) registration state on exit and
restores the saved registration state on restart.

r317164:

Fix indentation per style.Makefile(5)

7 years agoMFC r318305: makeman: reword description, based on feedback from wblock
emaste [Tue, 30 May 2017 17:09:47 +0000 (17:09 +0000)]
MFC r318305: makeman: reword description, based on feedback from wblock

7 years agoMFC arch.7 man page describing some arch-specific details
emaste [Tue, 30 May 2017 17:07:40 +0000 (17:07 +0000)]
MFC arch.7 man page describing some arch-specific details

MFC of r318386, r317938, r317844, r317843, r317840, r317835, r317809,
       r317790, r317754, r317708, r317681, r312563, r308251, r308130,
       r307687, r303153, r303134, r303045, r303044, r303033
Changes by br, emaste, jhb, jhibbits, kevlo, kib

Sponsored by: The FreeBSD Foundation

7 years agoMFC r318316: uniq: allow -c to be used with -d or -u
emaste [Tue, 30 May 2017 16:55:15 +0000 (16:55 +0000)]
MFC r318316: uniq: allow -c to be used with -d or -u

Bring in some bits from NetBSD and lift the restriction in uniq(1) that
-c cannot be used with the -d and -u options.  This restriction seems
unnecessary and is supported at least by GNU, OpenBSD, and NetBSD.  Lift
the restriction and simplify the show() logic a little bit to maintain
functionality when -c is provided with -d/-u.

Also with this change, -d and -u are now actually a mutually exclusive,
albeit valid, combination.  Given that they both indicate opposite
behavior, uniq(1) will no longer output anything if both -d and -u are
supplied.  This is in line with NetBSD as well as GNU.

Adjust the man page and usage() to reflect that -c is its own standalone
option.

PR: 200553
Submitted by: Kyle Evans <kevans91@ksu.edu>

7 years agoMFC r318689: Add parent interface reference counting to if_vlan.
mav [Tue, 30 May 2017 16:34:18 +0000 (16:34 +0000)]
MFC r318689: Add parent interface reference counting to if_vlan.

Using plain ifunit() looks like a request for troubles.

7 years agoMFC r318593:
asomers [Tue, 30 May 2017 15:33:27 +0000 (15:33 +0000)]
MFC r318593:

Fix build of AIO tests with -DDEBUG

Also, redefine some constants for clarity.  No functional change.

7 years agoMFC r318141, r318143-r318144
asomers [Tue, 30 May 2017 15:18:22 +0000 (15:18 +0000)]
MFC r318141, r318143-r318144

r318141:
strcpy => strlcpy

Reported by: Coverity
CID: 1352771
Sponsored by: Spectra Logic Corp

r318143:
strcpy => strlcpy

Reported by: Coverity
CID: 1006715
Sponsored by: Spectra Logic Corp

r318144:
Don't depend on assert(3) getting evaluated

Reported by: imp
X-MFC-With: 318141, 318143
Sponsored by: Spectra Logic Corp

7 years agoMFC r307334, r318252: Support write-through caches on arm64
andrew [Tue, 30 May 2017 13:56:38 +0000 (13:56 +0000)]
MFC r307334, r318252: Support write-through caches on arm64

r307334:
Create macros for the MAIR memory attributes. While here add an uncached
memory type, however the VM code still needs to be taught about this.

r318252:
Add the VM_MEMATTR_WRITE_THROUGH memory type to arm64 and use it to support
VM_MEMATTR_WRITE_COMBINING in the kernel. This fixes a bug where Xorg would
use write back cached memory for its graphics buffers. This would produce
artifacts on the screen as cachelines were written to memory.

7 years agoMFC r317824:
andrew [Tue, 30 May 2017 13:35:54 +0000 (13:35 +0000)]
MFC r317824:

Add reclaim_pv_chunk on arm64. This is based on the amd64 code so should
operate similarly, other than not needing the delayed invalidation.

It has been tested with artificial injection of vm_page_alloc failures
while running 'sort /dev/zero'.

7 years agoMFC r317361:
andrew [Tue, 30 May 2017 13:26:37 +0000 (13:26 +0000)]
MFC r317361:

Call the PSCI reset from cpu_reset on arm64. When rebooting from DDB the
kernel calls this directly so the event handler is not called, meaning
the computer fails to reboot.

7 years agoMFC r317197:
andrew [Tue, 30 May 2017 13:21:43 +0000 (13:21 +0000)]
MFC r317197:

Restrict the arm64 supervisor all instructions to only allow a zero
immediate value for system calls. We may wish to use other values in the
future for other purposes.

7 years agoMFC r317192:
andrew [Tue, 30 May 2017 13:16:06 +0000 (13:16 +0000)]
MFC r317192:

Push loading curthread into assembly in the synchronous exception handlers.
This will help investigating the performance impact of moving parts of the
switch statement in do_el0_sync into assembly.

7 years agoMFC r313396:
andrew [Tue, 30 May 2017 13:02:10 +0000 (13:02 +0000)]
MFC r313396:

Push reading of ESR_EL1 to assembly. Among other uses this will allow us
to expose this to signal handlers, e.g. for the clang sanitizers.

7 years agoMFC r316734, r316761: Support Execute-Never bit in the arm64 pmap.
andrew [Tue, 30 May 2017 12:44:01 +0000 (12:44 +0000)]
MFC r316734, r316761: Support Execute-Never bit in the arm64 pmap.

r316734:
Start to use the User and Privileged execute-never bits in the arm64
pagetables. This sets both bits when entering an address we know shouldn't
be executed.

I expect we could mark all userspace pages as Privileged execute-never to
ensure the kernel doesn't branch to one of these addresses.

While here add the ARMv8.1 upper attributes.

r316761:
Set the arm64 Execute-never bits in more places.

We need to set the Execute-never bits when mapping device memory as the
hardware may perform speculative instruction fetches.

Set the Privileged Execute-ever bit on userspace memory to stop the kernel
if it is tricked into executing it.

7 years agoMFC r316732, r316756: Enable Privileged Access Never on arm64.
andrew [Tue, 30 May 2017 12:26:36 +0000 (12:26 +0000)]
MFC r316732, r316756: Enable Privileged Access Never on arm64.

r316732:
Use the unprivileged variant of the load and store instructions most
places possible in the kernel. This forces these functions to fail if
userspace is unable to access a given memory location, even if it is in
the user memory range.

This will simplify adding Privileged Access Never support later.

r316756:
In ARMv8.1 ARM has added a process state bit to disable access to userspace
from the kernel. Make use of this to restrict accessing userspace to just
the functions that explicitly handle crossing the user kernel boundary.

7 years agoMFC r316755:
andrew [Tue, 30 May 2017 11:03:05 +0000 (11:03 +0000)]
MFC r316755:

Add SCTLR bits added in ARMv8.1 and ARMv8.2 and start to use them in the
early boot code.

7 years agoMFC r312703:
andrew [Tue, 30 May 2017 10:50:15 +0000 (10:50 +0000)]
MFC r312703:

Fix the error value we write in cerror. __error returns an int *, however
we were writing a 64 bit value meaning the 32 bits after this would be
trashed.

7 years agoRegenerate src.conf(5) after MK_DIALOG was added
ngie [Tue, 30 May 2017 07:31:02 +0000 (07:31 +0000)]
Regenerate src.conf(5) after MK_DIALOG was added

7 years agoMFC r314463:
ngie [Tue, 30 May 2017 07:29:18 +0000 (07:29 +0000)]
MFC r314463:

Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones

This simplifies pathing in make/displayed output.

7 years agoMFC r306375,r307802:
ngie [Tue, 30 May 2017 07:28:27 +0000 (07:28 +0000)]
MFC r306375,r307802:

r306375 (by emaste):

Add a WITHOUT_DIALOG src.conf(5) knob

It also turns off dependencies (bsdinstall, bsdconfig, dpv, tzsetup).

r307802 (by bapt):

Fix build of tzsetup when WITHOUT_DIALOG is set

Hide dialog specific code behind HAVE_DIALOG. It allows to build a stripped
down version (missing the dialog UI) but perfectly function tzsetup when
world is built WITHOUT_DIALOG

Reorganise a bit the code to limit the number of blocks under HAVE_DIALOG

7 years agoMFC r314451,r314452,r314453,r314456,r314457,r314458,r314459,r314460,r314461,r314462...
ngie [Tue, 30 May 2017 05:15:09 +0000 (05:15 +0000)]
MFC r314451,r314452,r314453,r314456,r314457,r314458,r314459,r314460,r314461,r314462,r314464,r314466,r314468,r314470,r314472,r314478:

r314451:

Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones

The SRCTOP conversion simplifies pathing in make/displayed output.

Also, while here, change a hardcoded path to ar5523.bin.uu in the make target
with ${.ALLSRC} .

r314452:

Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones

r314453:

Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones

r314456:

Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones

This simplifies pathing in make/displayed output.

r314457:

Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones

The SRCTOP conversion simplifies pathing in make/displayed output.

Also, while here, change a hardcoded path to ${RPCDIR}/ypupdate_prot.x in
the make targets with ${.ALLSRC} .

r314458:

Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones

This simplifies pathing in make/displayed output.

r314459:

Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones

This simplifies pathing in make/displayed output.

r314460:

Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones

This simplifies pathing in make/displayed output.

r314461:

Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones

This simplifies pathing in make/displayed output.

r314462:

Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones

The SRCTOP conversion simplifies pathing in make/displayed output.

Also, while here, change a hardcoded path to ${RPCDIR}/ypxfrd.x in
the make targets with ${.ALLSRC} .

r314464:

Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones

This simplifies pathing in make/displayed output.

r314466:

Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones

This simplifies pathing in make/displayed output.

r314468:

Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones

Also, use :H where possible/sensical to manipulate .CURDIR-relative paths

This simplifies pathing in make/displayed output.

r314470:

Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones

This simplifies pathing in make/displayed output.

r314472:

Simplify/improve idioms in usr.sbin/ntp Makefiles

- Use SRCTOP-relative paths to other directories instead of
  .CURDIR-relative ones. This simplifies pathing in make/displayed output.
- Also, use :H where possible/sensical to manipulate .CURDIR-relative
  paths
- Remove superfluous bsd.own.mk .includes which are already handled via
  src.opts.mk .includes

r314478:

Simplify idioms in Makefiles further

- Use SRCTOP-relative paths instead of .CURDIR-relative ones where possible
- Use :H to manipulate .CURDIR in areas instead of ..-relative paths.

7 years agoMFC r314541:
ngie [Tue, 30 May 2017 04:45:11 +0000 (04:45 +0000)]
MFC r314541:

Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones

This simplifies pathing in make/displayed output.

7 years agoMFC r314658:
ngie [Tue, 30 May 2017 04:42:36 +0000 (04:42 +0000)]
MFC r314658:

crypto: normalize paths using SRCTOP-relative paths or :H when possible

This simplifies make logic/output

7 years agoMFC r318439:
ngie [Tue, 30 May 2017 04:36:11 +0000 (04:36 +0000)]
MFC r318439:

Normalize .PATH on SRCTOP

This will help Jenkins dedupe 9 warnings between the static build and
the module build of ipsec(4).

Missed in SRCTOP conversion in r314651.

MFC with: r314651

7 years agoMFC r307741:
ngie [Tue, 30 May 2017 04:31:35 +0000 (04:31 +0000)]
MFC r307741:
r307741 (by emaste):

Allow all subdirectories to be optional via SUBDIR.${MK_*}

Tested by: br
Pointy hat to: emaste

7 years agoMFC r315170:
ngie [Tue, 30 May 2017 04:27:05 +0000 (04:27 +0000)]
MFC r315170:
r315170 (by imp):

Adopt SRCTOP in usr.bin

Prefer ${SRCTOP}/foo over ${.CURDIR}/../../foo and ${SRCTOP}/usr.bin/foo
over ${.CURDIR}/../foo for paths in Makefiles.

Silence on: arch@ (twice)

7 years agoMFC r314655:
ngie [Tue, 30 May 2017 04:17:22 +0000 (04:17 +0000)]
MFC r314655:

bin: normalize paths using SRCTOP-relative paths or :H when possible

This simplifies make logic/output

7 years agoMFC r314655:
ngie [Tue, 30 May 2017 04:15:40 +0000 (04:15 +0000)]
MFC r314655:

bin: normalize paths using SRCTOP-relative paths or :H when possible

This simplifies make logic/output

7 years agoMFC r314657:
ngie [Tue, 30 May 2017 04:13:06 +0000 (04:13 +0000)]
MFC r314657:

kerberos5: normalize paths using SRCTOP-relative paths or :H when possible

This simplifies make logic/output

7 years agoMFC r314651,r318439,r318440:
ngie [Tue, 30 May 2017 04:11:12 +0000 (04:11 +0000)]
MFC r314651,r318439,r318440:

r314651:

sys/modules: normalize .CURDIR-relative paths to SRCTOP

This simplifies make output/logic

Tested with: `cd sys/modules; make ALL_MODULES=` on amd64

r318439:

Normalize .PATH on SRCTOP

This will help Jenkins dedupe 9 warnings between the static build and
the module build of ipsec(4).

Missed in SRCTOP conversion in r314651.

MFC with: r314651

r318440:

Normalize SYSDIR on SRCTOP instead of .CURDIR

This is being done to simplify pathing for CFLAGS and source files.

7 years agoMFC r307698:
ngie [Tue, 30 May 2017 04:00:26 +0000 (04:00 +0000)]
MFC r307698:
r307698 (by lwhsu):

- Add required header for fixing `make` in sys/modules/gpio

7 years agoMFC r308161:
ngie [Tue, 30 May 2017 03:55:38 +0000 (03:55 +0000)]
MFC r308161:
r308161 (by lwhsu):

- Fix `make` in sys/modules/bhnd

7 years agoMFC r318606:
cy [Tue, 30 May 2017 03:33:48 +0000 (03:33 +0000)]
MFC r318606:

Refactor & compact struct i6addr_t #ifdef: remove redundant structure
definintion when USE_INET6 is false.

7 years agoMFC r318588:
cy [Tue, 30 May 2017 03:30:53 +0000 (03:30 +0000)]
MFC r318588:

Fix up two assertions following malloc(). vangyzen@ notified me of
the second one. The first one is fixed as well.

Reported by: vangyzen@

7 years agoMFC r318578:
cy [Tue, 30 May 2017 03:27:59 +0000 (03:27 +0000)]
MFC r318578:

Fix non-recoverable name resolution failures due to negative cache
entries never expiring. This patch honours the negative cache timeout.

To test/experience the failure do the following:

1. Edit /etc/ncd.conf to adjust the cache timeouts as follows:

positive-time-to-live hosts 30
negative-time-to-live hosts 1

2. Ensure that nsswitch.conf hosts line contains something like:

hosts: files cache dns

Note that cache must be specified before dns.

3. Start nscd.

4. Run the following command:

while true; do nc -z -w 3 www.google.com 80; sleep 5; done

5. While running the command, remove or comment out all nameserver
   statements in /etc/resolv.conf. After a short while you will notice
   non-recoverable name rsolution failures.

6. Uncomment or replace all nameserver statements back into
   /etc/resolv.conf. Take note that name resolution never recovers.
   To recover nscd must be restarted. This patch fixes this.

PR: 207804
Submitted by: Jov <amutu@amutu.com>

7 years agoMFC r318745:
cy [Tue, 30 May 2017 03:25:05 +0000 (03:25 +0000)]
MFC r318745:

Remove redundant variable declaration.

7 years agoMFC r315368:
cy [Tue, 30 May 2017 03:22:18 +0000 (03:22 +0000)]
MFC r315368:

calloc() and realloc() modernization.

This commit replaces calloc calls, which called calloc() as if it were
malloc() by allocating a multiple of objects as a sizeof multiplied by
the number of objects. The patch rectifies this by calling calloc() as
it was meant to be called.

This commit also replaces realloc() with reallocarray() in a similar
fashion as above. Instead of calculating the memory to reallocated
(changed) by multiplying sizeof by the number of objects, the sizeof
and number are passed as separate arguments to reallocarray(), letting
reallocarray() do the multiplication instead. Like the calloc()
adjustment above, this is approach is cleaner and more elegant than
than the previous code.

This has been tested on my production firewall and a laptop (also
running ipfilter).

Submitted by: pfg

7 years agoMFC r318006:
ngie [Tue, 30 May 2017 03:10:05 +0000 (03:10 +0000)]
MFC r318006:

style(9): sort headers and remove duplicates

7 years agoMFC r312913,r318100,r318107:
ngie [Tue, 30 May 2017 03:09:01 +0000 (03:09 +0000)]
MFC r312913,r318100,r318107:

r312913 (by asomers):

Improve the aio tests

* Add tests for aio_suspend(2).
* Add tests for polled completion notification.
* Test the full matrix of file descriptor types and completion notification
  mechanisms.
* Don't bother with mkstemp, because ATF runs every test in its own temp dir.
* Fix some typos.
* Remove extraneous ATF_REQUIRE_KERNEL_MODULE calls.

r318100:

style(9): move function definition curly braces to column 0

r318107:

Remove unused constant (PATH_TEMPLATE)

It was made unnecessary in r312913.

MFC with: r312913

7 years agoMFC r318094,r318098,r318099:
ngie [Tue, 30 May 2017 03:05:22 +0000 (03:05 +0000)]
MFC r318094,r318098,r318099:

r318094:

style(9): clean up trailing whitespace

r318098:

Refactor ATF_REQUIRE_UNSAFE_AIO and PLAIN_REQUIRE_UNSAFE_AIO

This is being done to reduce duplication between the two macros.

r318099:

Print out when unsafe AIO is enabled to debugging purposes

7 years agoMFC r318007,r318008,r318009,r318011:
ngie [Tue, 30 May 2017 03:02:07 +0000 (03:02 +0000)]
MFC r318007,r318008,r318009,r318011:

r318007:

Add intermediary Makefile for compiling all items in the directory

r318008:

Only compile tests/ if MK_TESTS != no or ALL_MODULES is defined

r318009:

Add MK_TESTS to kern.opts.mk to support r31800

MFC with: r318008
Pointyhat to: ngie

r318011:

Mark this Makefile SUBDIR_PARALLEL

I inserted the necessary SUBDIR+= .WAIT in the previous commit

7 years agoMFC r319015:
ngie [Tue, 30 May 2017 02:56:17 +0000 (02:56 +0000)]
MFC r319015:

Use calloc instead of malloc + memset

7 years agoMFC r318010:
ngie [Tue, 30 May 2017 02:53:00 +0000 (02:53 +0000)]
MFC r318010:

style(9): sort headers

7 years agoMFC r318591: compress: Add basic tests.
jilles [Mon, 29 May 2017 21:48:02 +0000 (21:48 +0000)]
MFC r318591: compress: Add basic tests.

7 years agoMFC r317313:
ngie [Mon, 29 May 2017 18:19:32 +0000 (18:19 +0000)]
MFC r317313:

gctl_test.t: catch errors with the mdcfg directive

While here, add a note about certain testcases relying on `count=1024` in
the "create" portion.

7 years agoMFC r314659,r314676:
ngie [Mon, 29 May 2017 18:17:34 +0000 (18:17 +0000)]
MFC r314659,r314676:

r314659:

usr.sbin: normalize paths using SRCTOP-relative paths or :H when possible

This simplifies make logic/output

r314676:

Fix build after r314656

Some of the changes I introduced to use .ALLSRC were correct in spirit,
but incorrect in reality -- in particular, ../Makefile.inc hadn't been
pulled in via bsd.init.mk (via bsd.lib.mk, bsd.prog.mk), so the value
of .ALLSRC (evaluated immediately) was empty. .include bsd.init.mk
explicitly so we can be certain that the values used as dependencies in
the targets are defined when the target recipe has been evaluated.

Reminder: thou shalt separate out separate functional changes before
          committing them.

(YUGE) Pointyhat to: ngie
In collaboration with: bdrewery

7 years agoMFC r318788:
pfg [Mon, 29 May 2017 15:24:45 +0000 (15:24 +0000)]
MFC r318788:
bhyvegc_resize: make use of reallocarray(3) for bounds-checking.

Also add __FBSDID.

Reviewed by: grehan

7 years agoMFC r318446:
kib [Mon, 29 May 2017 13:25:55 +0000 (13:25 +0000)]
MFC r318446:
Update my copyright, note The FreeBSD Foundation involvement.

7 years agoMFC direct execution mode for rtld.
kib [Mon, 29 May 2017 13:24:27 +0000 (13:24 +0000)]
MFC direct execution mode for rtld.

MFC r318313:
Make ld-elf.so.1 directly executable.

MFC r318352 (by jonathan):
Rename rtld's parse_libdir to parse_integer.

MFC r318380:
Pretend that there is some security when executing in direct mode.

MFC r318431 (by jonathan):
Allow rtld direct-exec to take a file descriptor.

MFC r318445:
Fix style, add static keyword before static function definition.

MFC r318739:
For ld.so direct execution mode, implement -p option.

7 years agoMFC r318312:
kib [Mon, 29 May 2017 13:18:20 +0000 (13:18 +0000)]
MFC r318312:
Fix the AT_EXECFD functionality.

7 years agoMFC r318318:
kib [Mon, 29 May 2017 13:17:00 +0000 (13:17 +0000)]
MFC r318318:
Ensure that resume path on amd64 only accesses page tables for normal
operation after processor is configured to allow all required
features.

7 years agoMFC r318303:
kib [Mon, 29 May 2017 12:55:26 +0000 (12:55 +0000)]
MFC r318303:
Style.

7 years agoMFC r318299:
kib [Mon, 29 May 2017 12:53:44 +0000 (12:53 +0000)]
MFC r318299:
Simplify cleanup on failure in realpath(3).

7 years agoMFC r318298:
kib [Mon, 29 May 2017 12:52:13 +0000 (12:52 +0000)]
MFC r318298:
Fix several buffer overflows in realpath(3), and other minor issues.

PR: 219154

7 years agoMFC r318632, r318633:
royger [Mon, 29 May 2017 11:37:08 +0000 (11:37 +0000)]
MFC r318632, r318633:

bsdinstall: mount is not needed for the ZFS install case
bsdinstall: do not use distextract in scripted mode

7 years agoMFC r314659,r314676:
ngie [Mon, 29 May 2017 10:15:41 +0000 (10:15 +0000)]
MFC r314659,r314676:

r314659:

usr.sbin: normalize paths using SRCTOP-relative paths or :H when possible

This simplifies make logic/output

r314676:

Fix build after r314656

Some of the changes I introduced to use .ALLSRC were correct in spirit,
but incorrect in reality -- in particular, ../Makefile.inc hadn't been
pulled in via bsd.init.mk (via bsd.lib.mk, bsd.prog.mk), so the value
of .ALLSRC (evaluated immediately) was empty. .include bsd.init.mk
explicitly so we can be certain that the values used as dependencies in
the targets are defined when the target recipe has been evaluated.

Reminder: thou shalt separate out separate functional changes before
          committing them.

(YUGE) Pointyhat to: ngie
In collaboration with: bdrewery

7 years agoMFC r315561:
ngie [Mon, 29 May 2017 06:31:07 +0000 (06:31 +0000)]
MFC r315561:
r315561 (by trasz):

Bring back the "i".  The point is to make it easy to find via "apropos
iscsi", along with all the other relevant components.

7 years agoMFC r316179,r316180,r316181,r316260:
ngie [Mon, 29 May 2017 06:26:00 +0000 (06:26 +0000)]
MFC r316179,r316180,r316181,r316260:

r316179 (by cem):

t_msgsnd: Use msgsnd()'s msgsz argument correctly to avoid overflow

msgsnd's msgsz argument is the size of the message following the 'long'
message type.  Don't include the message type in the size of the message
when invoking msgsnd(2).

CID: 1368712

r316180 (by cem):

Follow-up to r316179: More of the same

CIDs: 1368705136870613687071368710

r316181 (by cem):

t_msgctl: Fix the same msgsnd() misuse as t_msgsnd

msgsnd(2)'s msgsz argument does not describe the full structure, only the
message component.

CIDs: 13687031368711

r316260:

Annotate all changes made in r316178-r316180 with __FreeBSD__

Restore the stock (upstream) code under an #else block, so it's easier
for me to visualize and understand the code that needs to be upstreamed.

7 years agoMFC r318315:
ngie [Mon, 29 May 2017 06:15:41 +0000 (06:15 +0000)]
MFC r318315:

lib/libc/gen/realpath_test: make check result from getcwd(3)

This is being done to avoid dereferencing a NULL pointer via strlcat,
obscuring the underlying issue with the getcwd(3) call.

7 years agoMFC r308826: zfs: fix up after the removal of PG_CACHED pages in r308691
avg [Mon, 29 May 2017 06:15:06 +0000 (06:15 +0000)]
MFC r308826: zfs: fix up after the removal of PG_CACHED pages in r308691

Now that r308691 has been MFC-ed as a part of r318716,
r308826 must be MFC-ed as well.

PR: 214629
Reported by: mshirk@daemon-security.com [head], lev [stable/11]