Commit Graph

227571 Commits

Author SHA1 Message Date
Warner Losh
50a717a67b Add notes about overlapping copies.
Add notes to each of these that specifically state that results are
undefined if the strings overlap. In the case of memcpy, we document
the overlapping behavior on FreeBSD (pre-existing). For str*, it is
left unspecified, however, since the default (and x86) implementations
do not handle overlapping strings properly.

PR: 223653
Sponsored by: Netflix
2017-11-13 17:04:44 +00:00
Eric van Gyzen
d63f2964ce Add __BEGIN_DECLS and __END_DECLS to <sys/umtx.h>
This allows C++ programs to call _umtx_op().

MFC after:	3 days
Sponsored by:	Dell EMC
2017-11-13 16:53:36 +00:00
Konstantin Belousov
f4dd123e15 Do not leak PMC_PO_OWNS_LOGFILE on error.
Note that PMCLOG_RESERVE_WITH_ERROR() macro contains goto error;
statement and executed after the flag is set.

Reported and tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2017-11-13 10:45:31 +00:00
Konstantin Belousov
c9da263712 Style bug.
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2017-11-13 10:43:31 +00:00
Xin LI
712dda7fb0 Be more careful when doing calculation with request from userland.
MFC after:	2 weeks
2017-11-13 07:47:43 +00:00
Warner Losh
691e6ea877 Document MACHINE, MACHINE_ARCH, CPUTYPE, TARGET and TARGET_ARCH
historical use and general philosphy.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D12981
2017-11-13 00:32:44 +00:00
Warner Losh
2ce13699d7 Use proper include file. While <boot/userboot/userboot.h> works, it
only works because we have -Isys on the command line. We also have
-Isys/boot/userboot on the command line, so bring it in directly with
<userboot.h>. No functional change, but it removes one hard to see
dependency on the boot loader's location in sys/boot.

Sponsored by: Netflix
2017-11-13 00:30:38 +00:00
Ruslan Bukin
b510dab312 Add Intel Processor Trace (PT) MSRs.
Sponsored by:	DARPA, AFRL
2017-11-12 23:13:04 +00:00
Michael Tuexen
469a65d1f8 Cleanup the handling of control chunks. While there fix some minor
bug related to clearing the assoc retransmit counter and the dup TSN
handling of NR-SACK chunks.

MFC after:	3 days
2017-11-12 21:43:33 +00:00
Ed Maste
1ec7755286 boot1: also check for NULL device
r325681 fixed a NULL pointer dereference on RPi3 caused by a lack of
functionality in uboot's EFI implementation.  That rev checked the boot1
load path for NULL but not the load device.  In practice if the former
works the latter will as well, but improve correctness by checking each
separately.

Submitted by:	Keith White <kwhite@eecs.uottawa.ca>
Reported by:	jhb
MFC after:	5 days
MFC with:	r325681
Sponsored by:	The FreeBSD Foundation
2017-11-12 17:15:54 +00:00
Warner Losh
175748c982 Make sure the proper loader.rc gets installed.
There were two things wrong. First, the wrong path was listed in .PATH
statement. Second, BOOTSRC wasn't yet defined for the .PATH, so it
didn't properly add it. Third, even if these were right, . was in the
path before, so it wouldn't have worked. Replace this with a simple
loop so the proper loader.rc gets selected.

Noticed by: dhw@ (menus stopped working on boot)
Sponsored by: Netflix
2017-11-12 17:10:57 +00:00
Baptiste Daroussin
57c3dc51ca Stop installing eqnchar which has been removed
Pointyhat to:	bapt
2017-11-12 09:42:42 +00:00
Mariusz Zaborski
6789a8b559 dhclient(8) should not close stdio using daemon(3) function.
dhclient(8) is chrooted so opening /dev/null always will fail.
In capability world this is also annoying because we getting error that
open(2) is not permitted in Capsicum. dhclient(8) is closing stdio by
precaching fd to /dev/null before chroot.
This is done few lines below daemon(3) function so let's not try to do that
in daemon(3) function.

Reviewed by:	cem@
Differential Revision:	https://reviews.freebsd.org/D12826
2017-11-12 08:54:23 +00:00
Mariusz Zaborski
cb003dd918 Use syslog service in dhclient(8).
dhclient(8) is failing during boot to connect to the syslog service, because
syslog daemon is started after dhclient(8). This can be reproduced by stooping
syslog daemon and ktrace the dhclient or use kern.trap_enotcap sysctl and boot
the machine. Using the Casper syslog service fix the problem.

Reviewed by:	bapt@
Differential Revision:	https://reviews.freebsd.org/D12825
2017-11-12 08:42:43 +00:00
Mariusz Zaborski
7b4fce76cc Introduce syslog service for Casper.
syslog in libc secretly reconnects to the daemon.
Another issue is that we don't have any information from openlog(3) if we
succeeded to open log or not so we don't know if we are ready
to enter cabability mode.
Because all of that we decided we need a syslog service for Caspser.

Reviewed by:	bapt@
Differential Revision:	https://reviews.freebsd.org/D12824
2017-11-12 08:34:25 +00:00
Baptiste Daroussin
3d7342941b Remove the special character definitions files for eqn(1)
This files hasn't been used since groff(1) was introduced in base 23 years ago.
2017-11-12 08:31:17 +00:00
Baptiste Daroussin
1917a73775 Update to 2017.10.21
MFC after:	3 days
2017-11-12 08:00:57 +00:00
Mariusz Zaborski
8751b03b19 We return a pointer when we are using cap_init() or cap_service_open()
function, so check if cap_chanel_t is NULL is not enough.
Casper with a normal libc will still fail in capability mote so let's not
enter capability mode without casper support when we need to resolve DNS.

Reviewed by:	cem
Differential Revision:	https://reviews.freebsd.org/D12823
2017-11-12 07:18:10 +00:00
Will Andrews
ec8659b385 libkvm: fix lib32 build. 2017-11-12 03:28:47 +00:00
Mateusz Guzik
ca0227933e amd64: stop nesting preemption counter in spinlock_enter
Discussed with:	jhb
2017-11-12 03:13:01 +00:00
Mateusz Guzik
fe7979a12c Use passed thread pointer instead of curthread in sys_sched_yield
No functional changes.
2017-11-12 02:34:33 +00:00
Will Andrews
8baaf913be libkvm: fix build failures 2017-11-12 01:36:48 +00:00
Will Andrews
2aa6a4f3c8 libkvm: fix 'index' shadowing. 2017-11-12 00:00:38 +00:00
Will Andrews
c9057838be libkvm: add kvm_walk_pages API.
This API allows callers to enumerate all known pages, including any
direct map & kernel map virtual addresses, physical addresses, size,
offset into the core, & protection configured.

For architectures that support direct map addresses, also generate pages
for any direct map only addresses that are not associated with kernel
map addresses.

Fix page size portability issue left behind from previous kvm page table
lookup interface.

Reviewed by:	jhb
Sponsored by:	Backtrace I/O
Differential Revision:	https://reviews.freebsd.org/D12279
2017-11-11 23:30:58 +00:00
Bartek Rutkowski
569aaa3b97 bhyve: avoid applying capsicum capabilities to file that was not opened
When using -l option targeting file that can't be opened (ie. nmdm module
is not loaded and /dev/nmdm* is specified) bhyve tries to apply capsicum
capabilities to a file that was not opened.

Enclose that code in an if statement and only run it on correctly opened
descriptor also providing meaningful message in case of an error.

Submitted by:	Pawel Biernacki <pawel.biernacki@gmail.com>
Reviewed by:	grehan, emaste
Sponsoied by:	Mysterious Code Ltd.
Differential Revision:	D12985
2017-11-11 22:50:14 +00:00
Mateusz Guzik
baaa6ec7ed Avoid locking and refing in sysctl_kern_proc_args if possible.
Turns out the sysctl is called a lot e.g. by pkg-static.
2017-11-11 22:39:33 +00:00
Mateusz Guzik
8b9817a443 sysctl: try to avoid malloc in name2oid
name2oid is called all the time and passed names are almost always very short
(< 16 characters).
2017-11-11 21:50:36 +00:00
Hans Petter Selasky
5c4155867a Implement missing KDGETMODE IOCTL in VT.
Obtained from:	Johannes Lundberg <yohanesu75@gmail.com>
Sponsored by:	Mellanox Technologies
MFC after:	1 week
2017-11-11 20:12:48 +00:00
Xin LI
0ab69d713c find(1): Don't treat statfs() error as fatal in f_fstype, which can happen
when a directory is removed in the middle of find.

Instead of a full err(), allow find to continue, plus print a warning with
exitstatus set when appropriate.

Reported by:	100.chksetuid via gordon
Reviewed by:	jilles
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D13024
2017-11-11 19:18:47 +00:00
Mateusz Guzik
537d0fb138 Use pfind_any in linux_rt_sigqueueinfo and kern_sigqueue 2017-11-11 18:10:09 +00:00
Mateusz Guzik
6e1619dae3 Add pfind_any
It looks for both regular and zombie processes. This avoids allproc relocking
previously seen with pfind -> zpfind calls.
2017-11-11 18:04:39 +00:00
Mateusz Guzik
272640b7fc Avoid allproc lock in pfind if curproc->pid == pid 2017-11-11 18:03:26 +00:00
Mateusz Guzik
9b57bf75d0 Remove useless proc lookup from sysctl_out_proc 2017-11-11 18:02:23 +00:00
Warner Losh
6a5a9a1976 Fix typo in filename.
Noticed by: Shawn Webb
2017-11-11 16:09:20 +00:00
Baptiste Daroussin
d0ab9cbec0 Remove __unused attributed on arguments that are actually used
MFC after:	3 days
2017-11-11 15:18:25 +00:00
Baptiste Daroussin
b903189b6c Fix some nroff style issue
MFC after:	3 days
2017-11-11 14:39:13 +00:00
Allan Jude
125996b592 vmstat: fix duplicate key in libxo output
In the libxo output from vmstat, the number of pages that have been
paged out uses the same key name as the number of times pages have been
paged. Appears to have been a typo or copy-pasto.

PR:		222198
Submitted by:	Yavuz Tanriverdi <stemix@gmail.com>
Reviewed by:	phil, garga
Differential Revision:	https://reviews.freebsd.org/D12395
2017-11-11 14:02:21 +00:00
Baptiste Daroussin
04ac1c64fe Follow up on zstd update 2017-11-11 13:57:30 +00:00
Baptiste Daroussin
1abf619a8a Update to zstd 1.3.2 2017-11-11 13:54:37 +00:00
Hans Petter Selasky
ef9257491d Remove release and acquire semantics when accessing the "state" field of the
LinuxKPI task struct. Change type of "state" variable from "int" to
"atomic_t" to simplify code and avoid unneccessary casting.

MFC after:	1 week
Sponsored by:	Mellanox Technologies
2017-11-11 11:01:50 +00:00
Hans Petter Selasky
e0390735d3 Mask away return codes from del_timer() and del_timer_sync() because
they are not the same like in Linux.

MFC after:	1 week
Sponsored by:	Mellanox Technologies
2017-11-11 10:46:12 +00:00
Mateusz Guzik
c7e4e92ecd rwlock: use fcmpset for setting RW_LOCK_WRITE_SPINNER 2017-11-11 09:34:11 +00:00
Eitan Adler
7a9e3b169f secure: chase removal of pkg_install 2017-11-11 07:21:49 +00:00
Eitan Adler
fd7074590a Chase removal of pkg_* commands 2017-11-11 07:20:14 +00:00
Eitan Adler
d7be61e67f badsect(8): case remaining element
r325452 removed badsect(8) - remove pseudo-target for it
2017-11-11 07:14:19 +00:00
Eitan Adler
1b3cd5ec63 mailaddr(7): wave goodbye
The information here is somewhere between ancient to obsolete.
It refers to a time in the internet's history when manual routing
was still useful, talks about UUCP as if its modern, and refers
to documents which I had trouble tracking down.

It seems unlikely that a manual page in this form would be useful, so
just remove it.

Reviewed By: imp, tsoome, bdrewery(?)
Differential Revision: https://reviews.freebsd.org/D12924
2017-11-11 07:00:40 +00:00
Bryan Drewery
de2b0e0318 DIRDEPS_BUILD: Fix after r325417.
DIRDEPS_BUILD works just fine without defining __objdir or dealing with any of
this logic.  It handles its own TARGET_SPEC in local.meta.sys.mk as well.  Just
let it do its own thing.

Sponsored by:	Dell EMC Isilon
2017-11-11 01:11:00 +00:00
Bryan Drewery
5edf5dc29f Don't work out of a TARGET. directory if TARGET_ARCH is not defined.
This fixes 'TARGET=<target> make universe_kernels' creating an empty TARGET.
directory and showing it in SIGINFO.

Sponsored by:	Dell EMC Isilon
2017-11-11 01:10:55 +00:00
Bryan Drewery
d8d24cec9f META_MODE: Avoid some logic if disabled and allow enabling with make argument.
Sponsored by:	Dell EMC Isilon
2017-11-11 01:10:50 +00:00
Bryan Drewery
58d86ed342 AUTO_OBJ: Disable in non-build targets.
There's no reason to create object directories for targets like 'installworld'
or 'distributeworld', and the others in this list.  Specifying MK_AUTO_OBJ as a
make argument allows circumventing this if needed for some reason.

This fixes mergemaster creating a full object tree due to doing a 'make
installconfig' tree walk.

Reported by:	Mark Millard
Sponsored by:	Dell EMC Isilon
2017-11-11 01:10:46 +00:00