Commit Graph

227559 Commits

Author SHA1 Message Date
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
Bryan Drewery
f82493cc3a Handle MAKEOBJDIRPREFIX when already inside of .OBJDIR.
This can happen in obscure cases with things like the kernel build.

Sponsored by:	Dell EMC Isilon
2017-11-11 01:10:41 +00:00
Bryan Drewery
f649ab27a3 cleanworld only needs a tree walk if the expected .OBJDIR is .CURDIR.
Sponsored by:	Dell EMC Isilon
2017-11-11 01:10:08 +00:00
Warner Losh
781c4d47f2 Install the 4th files in sys/boot/forth instead of each loader
Also, move generation of loader.help into loader.mk. Set HELP_FILES=
to disable this (so we only install one help file, for now). At the
same time remove some duplicate -I lines. Fix several FILES= and
CLEANFILES= into the += form since we're touching both of those in the
.mk files. Make sure we only build one loader.help file per platform
in a unified way (we were building many on some, with the last to
install winning, though often they were the same text).

Also, we're now installing loader.rc and menu.rc everywhere. arm and
mips uboot installed these as menu.rc.sample, but there's no need
since the loader.rc for those platforms doesn't do menu.rc processing
by default. pcibios.4th is now installed everywhere, but will failsafe
on non x86 platforms (it isn't loaded by default anywhere).

These changes are too intertwined to do separately since aspects of
each are required to have a bug-free commit.

Sponsored by: Netflix
2017-11-10 23:54:58 +00:00
Warner Losh
4728f534ff Move LOADER_{NO,}_GELI_SUPPORT to MK_LOADER_GELI
Transition to WITH/WITHOUT_LOADER_GELI to flag support or not of GELI
in the boot loaders. Add HAVE_GELI so components can flag they need
support (since it's too large to include everywhere). Add temporary
warnings for the old forms to ease transition.

Also, update test script to build without GELI on x86.

Sponsored by: Netflix
2017-11-10 23:54:48 +00:00
Warner Losh
a179cd9114 Replace LOADER_FIREWIRE_SUPPORT variable
Rename LOADER_FIREWIRE_SUPPORT to MK_LOADER_FIREWIRE. Only build
libfirewire when this is "yes". Add note to updating. Fix build script
to build this for x86 so the option doesn't decay. sparc64 supports
ZFS, so also build it MK_ZFS=no.

Sponsored by: Netflix
2017-11-10 23:54:41 +00:00
Warner Losh
96534eedcd Remove useless PNP define here.
We never use HAVE_PNP for anything, so don't define it on the command line.

Sponsored by: Netflix
2017-11-10 23:54:36 +00:00
Warner Losh
4e8fc5c539 Remove LOADER_ZFS_SUPPORT as a Makefile variable
LOADER_ZFS_SUPPORT is entirely used to select whether or not to
support ZFS in the loader. But it's not a user-servicable part (MK_ZFS
is what's used for that) Change it to the more conventional HAVE_ZFS
and move the ZFS support code into loader.mk. In addition, only build
ZFS libraries and boot loaders when ZFS is enabled.

Sponsored by: Netflix
2017-11-10 23:54:31 +00:00
Warner Losh
1f9ecdf78f Remove LOADER_FDT_SUPPORT as a Makefile variable.
LOADER_FDT_SUPPORT was used inconsistently in the tree. In some
places, it was used to control whether or not the user wanted FDT
included, and in other places it was a command to include
support. Remove it entirely. The former is now enabled -DWITH_FDT,
while the latter is controlled by Makefiles defining HAVE_FDT.

Supported by: Netflix
2017-11-10 23:54:24 +00:00
Warner Losh
f933edf086 FDT support doesn't make sense for ps3. There's no support in the ps3
port for FDT, and it's unlikely to grow support for that anytime soon.
When it does, support can be added back easily enough.

Supported by: Netflix
2017-11-10 23:54:18 +00:00
Warner Losh
5e81a5927b Remove all the empty help files from the powerpc build.
Sponsored by: Netflix
2017-11-10 23:54:13 +00:00
Warner Losh
a00b1bd36b Simplify this if to a direct assignment.
Sponsored by: Netflix
2017-11-10 23:54:09 +00:00
Warner Losh
7456f77248 libsa32 isn't needed for i386. It's already a 32-bit platform and
libfoo32 is only needed when compiling 32-bit libraries on native
64-bit architectures, and only when that 64-bit architecture needs
mixed 32-bit and 64-bit binaries.

Sponsored by: Netflix
2017-11-10 23:54:03 +00:00