Commit Graph

248038 Commits

Author SHA1 Message Date
Warner Losh
be39790ac2 Add relnotes entries for armv5 and sparc64 being removed.
These commits lacked the proper relnotes entries in the commit
message.
2020-02-06 18:00:46 +00:00
Warner Losh
dd99ab06f3 Remove elf2aout
Remove the long obsolete elf2aout utility. Should any ports need to
know when this left the tree, use 1300077 as the revision so we
avoid multiple bumps for the sparc64 removal.

Reviewed by: brooks@, emaste@
Differential Revision: https://reviews.freebsd.org/D23527
2020-02-06 17:52:16 +00:00
Warner Losh
d6cc6be78c Mark elf2aout as deprecated.
Only sparc64 used this, so we will be removing it from FreeBSD 13. Add
the usual deprecation notice in a MFC-able way.

Reviewed by: emaste, rgrimes
Differential Revision: https://reviews.freebsd.org/D23526
2020-02-06 17:52:11 +00:00
Warner Losh
6a027eda92 No need to have a special sparc64 list here.
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D23525
2020-02-06 17:52:07 +00:00
Warner Losh
ab9848aa9b No need to make sunlabel anymore
It was only built on sparc64. Since it wasn't a general tool on other
architectures, no need to keep it around for another release.

Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D23524
2020-02-06 17:52:02 +00:00
Warner Losh
75ababf8b5 Restore missing comment
I was overly agressive about removing the entire comment. It was still
valid, except the part about being only for some architectures.

Reviewed by: emaste
Differenial Revision: https://reviews.freebsd.org/D23523
2020-02-06 17:51:48 +00:00
Warner Losh
ac12771c01 Avoid the phrase 'now deprecated'
Reword this construct to be more consistent with normal man page language.
2020-02-06 16:38:06 +00:00
Warner Losh
24619588e4 'is now deprecated' -> 'is deprecated'
Man pages are written in a more timeless voice than news flashes,
so adopt the language to what we do elsewhere.
2020-02-06 16:38:02 +00:00
Luca Pizzamiglio
19bb4570ea mixer: call the cleanup function in a test
The set_empty_value test has a cleanup function, but is not called.
Fix it

Reviewed by:	0mp
Approved by:	kp
Differential Revision:	https://reviews.freebsd.org/D23498
2020-02-06 14:31:29 +00:00
Ed Maste
429932bacc src.conf.5: regen after r357617, BINUTILS_BOOTSTRAP description update 2020-02-06 14:18:48 +00:00
Ed Maste
0b3a4f15aa Update WITH_/WITHOUT_BINUTILS_BOOTSTRAP descriptions
Use of binutils is being incrementally reduced.  The specific binutils
are listed in the WITH_BINUTILS and WITHOUT_BINUTILS descriptions; there
is no need to list the specific tools again in the descriptions for the
_BOOTSTRAP options.

MFC after:	1 week
2020-02-06 14:13:33 +00:00
Roger Pau Monné
d16bd54140 xen/console: fix priority of Xen console
Currently the Xen console is always attached with priority CN_REMOTE
(highest), which means that when booting with a single console the Xen
console will take preference over the VGA for example, and that's not
intended unless the user has also selected to use a serial console.

Fix this by lowering the priority of the Xen console to NORMAL unless
the user has selected to use a serial console. This keeps the usual
FreeBSD behavior of outputting to the internal consoles (ie: VGA) when
booted as a Xen dom0.

MFC after:	3 days
Sponsored by:	Citrix Systems R&D
2020-02-06 14:02:47 +00:00
Leandro Lupori
38cf2a4334 Implement kvm_kerndisp
This change adds a new libkvm function, kvm_kerndisp(), that can be used to
retrieve the kernel displacement, that is the difference between the kernel's
base virtual address at run time and the kernel base virtual address specified
in the kernel image file.

This will be used by kgdb, to properly relocate kernel symbols, when needed.

Reviewed by:	jhb
Differential Revision:	https://reviews.freebsd.org/D23285
2020-02-06 13:21:59 +00:00
Pawel Biernacki
210176ad76 sysctl(9): add CTLFLAG_NEEDGIANT flag
Add CTLFLAG_NEEDGIANT flag (modelled after D_NEEDGIANT) that will be used to
mark sysctls that still require locking Giant.

Rewrite sysctl_handle_string() to use internal locking instead of locking
Giant.

Mark SYSCTL_STRING, SYSCTL_OPAQUE and their variants as MPSAFE.

Add infrastructure support for enforcing proper use of CTLFLAG_NEEDGIANT
and CTLFLAG_MPSAFE flags with SYSCTL_PROC and SYSCTL_NODE, not enabled yet.

Reviewed by:	kib (mentor)
Approved by:	kib (mentor)
Differential Revision:	https://reviews.freebsd.org/D23378
2020-02-06 12:45:58 +00:00
Ryan Libby
28c0abcebb auditd_stop: wait_for_pids instead of sleeping
It's faster and more reliable to wait_for_pids than to sleep 1.

cem@ suggested just to remove auditd_stop() and use the rc.subr default
stop action (SIGTERM instead of audit -t), which has a built-in
wait_for_pids.  That may be a better solution.

Discussed with:	cem
Reviewed by:	asomers
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D23223
2020-02-06 08:32:30 +00:00
Ryan Libby
bae55c4aec uma: remove UMA_ZFLAG_CACHEONLY flag
UMA_ZFLAG_CACHEONLY was essentially the same thing as UMA_ZONE_VM, but
with a more confusing name.  Remove the flag, make UMA_ZONE_VM an
inherit flag, and replace all references.

Reviewed by:	markj
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D23516
2020-02-06 08:32:25 +00:00
Xin LI
f99e4a2d11 MFV r357608: Limit memory usage in xz(1) instead of in tuklib.
Apply upstream 353970510895f6a80adfe60cf71b70a95adfa8bc to limit memory
usage on 32-bit binary to 4020 MiB.

Submitted by:	Lasse Collin <lasse.collin at tukaani.org>
Reviewed by:	kib, bcr
Differential Revision:	https://reviews.freebsd.org/D23474
2020-02-06 07:47:28 +00:00
Xin LI
9657691eff Apply a reduced version of upstream 353970510895f6a80adfe60cf71b70a95adfa8bc
which implements memory limit in xz(1) when running in 32-bit mode.

The change is applied directly in vendor area to ease future import.
2020-02-06 07:45:07 +00:00
Justin Hibbits
31091dea96 powerpc: Fix altivec disabling in set_mcontext()
We somewhat blindly copy the srr1 from the new context to the trap frame,
but disable FPU and VSX unconditionally, relying on the trap to re-enable
them.  This works because the FPU manages the VSX extended FP registers,
which is governed by the PCB_FPFREGS flag.  However, with altivec, we
would blindly disable PSL_VEC, without touching PCB_VEC.  Handle this case
by disabling altivec in both srr1 and pcb_flags, if the mcontext doesn't
have _MC_AV_VALID set.

Reported by:	pkubaj
2020-02-06 01:25:30 +00:00
Navdeep Parhar
21935a41fd cxgbe(4): Add native netmap support to the main interface.
This means that extra virtual interfaces (VIs) created with
hw.cxgbe.num_vis are no longer required to use netmap.  Use this
tunable to enable native netmap support on the main interface:

hw.cxgbe.native_netmap="3"

There is no change in default behavior.

Suggested by:	jch@
MFC after:	2 weeks
Sponsored by:	Chelsio Communications
2020-02-05 22:29:01 +00:00
Mark Johnston
a4b3b53557 Define SMP for standalone module builds.
Suggested and reviewed by:	kevans
Differential Revision:	https://reviews.freebsd.org/D23519
2020-02-05 20:57:45 +00:00
Alfredo Dal'Ava Junior
f272c8de6e [virtio] Fix r/w to PCI configuration area on big endian platforms
In legacy VirtIO drivers, the header must be PCI endianness (little) and the
device-specific region is encoded in the native endian of the guest.

This patch makes the access (read/write) to VirtIO header using the little
endian order. Other read and write access are native endianness. This also
sets the device's IO region as big endian if on big endian machine.

PR:		205178
Submitted by:	Andre Silva <afscoelho@gmail.com>
Reported by:	Kenneth Salerno <kennethsalerno@yahoo.com>
Reviewed by:	bryanv, bdragon, luporl, alfredo
Approved by:	jhibbits (mentor)
Differential Revision:	https://reviews.freebsd.org/D23401
2020-02-05 20:39:18 +00:00
John Baldwin
4a9b01b262 Fix EXCP_MASK to include all relevant bits from scause.
While cause codes higher than 16 are reserved, the exception code
field of the register is defined to be all bits but the upper-most
bit.

Reviewed by:	mhorne
MFC after:	1 week
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D23510
2020-02-05 20:34:22 +00:00
John Baldwin
ac2b208d08 Use csr_read() to read sstatus instead of inline assembly.
While here, remove a local variable to avoid the CSR read in non-debug
kernels.

Reviewed by:	mhorne
MFC after:	1 week
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D23511
2020-02-05 20:32:37 +00:00
John Baldwin
b68892fe61 Remove stale workaround for the htif console.
In practice this discarded all characters entered at the DDB prompt.

Reviewed by:	br
MFC after:	1 week
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D23509
2020-02-05 20:11:08 +00:00
Ed Maste
0f61170882 libssp_nonshared: use only on i386 and ppc
libssp_nonshared.a defines one symbol, __stack_chk_fail_local.  This
is used only on i386 and powerpc; other archs emit calls directly to
__stack_chk_fail.  Simplify linking on other archs by omitting it.

PR:		242941 [exp-run]
2020-02-05 20:08:01 +00:00
John Baldwin
37bd6bb849 Read the breakpoint instruction to determine its length in BKPT_SKIP.
This fixes continuing from debug.kdb.enter=1 after enabling the use of
compressed instructions since the compiler can emit the two byte
c.ebreak instead of the 4 byte ebreak.

Reviewed by:	br
MFC after:	1 week
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D23507
2020-02-05 20:06:35 +00:00
Brandon Bergren
7283901ae9 [PowerPC] [DTrace] Add ELFv2 support in libdtrace
PPC64 ELFv2 acts like a "normal" platform in that it no longer needs
function descriptors. So, ensure we are only enabling them on ELFv1.

Additionally, ELFv2 requires that the ELF header have a nonzero e_flags,
so ensure that the synthesized ELF header in dt_link.c is setting it.

Reviewed by:	jhibbits, markj
Approved by:	gnn
Differential Revision:	https://reviews.freebsd.org/D22403
2020-02-05 19:39:48 +00:00
Ed Maste
42ee7a9a9b delete empty directories after r357455 2020-02-05 19:18:04 +00:00
Ed Maste
fb2644971d beri: correct kernel printf typo
(From review D23453)

Submitted by:	Gordon Bergling <gbergling_gmail.com>
Reviewed by:	rwatson
2020-02-05 19:15:36 +00:00
Pedro F. Giffuni
abfc5e8591 ethernet: Add a couple more Ethertypes.
Powerlink and Sercos III are used in automation. Both have been standardized
and In the case of Ethernet Powerlink there is a BSD-licensed stack.
2020-02-05 19:11:07 +00:00
Mark Johnston
858e8e41dd Stop compiling dtrace modules with -DSMP.
I believe this is left over from when dtrace was being ported and
developed out-of-tree.  Now it just ensures that dtrace.ko and a non-SMP
kernel have incompatible KBIs.

PR:		243711
Sponsored by:	The FreeBSD Foundation
2020-02-05 19:08:45 +00:00
Mark Johnston
c3d326fd44 Define MAXCPU consistently between the kernel and KLDs.
This reverts r177661.  The change is no longer very useful since
out-of-tree KLDs will be built to target SMP kernels anyway.  Moveover
it breaks the KBI in !SMP builds since cpuset_t's layout depends on the
value of MAXCPU, and several kernel interfaces, notably
smp_rendezvous_cpus(), take a cpuset_t as a parameter.

PR:		243711
Reviewed by:	jhb, kib
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D23512
2020-02-05 19:08:21 +00:00
Kyle Evans
28e68bc000 O_SEARCH test: drop O_SEARCH|O_RDWR local diff
In FreeBSD's O_SEARCH implementation, O_SEARCH in conjunction with O_RDWR or
O_WRONLY is explicitly rejected. In this case, O_RDWR was not necessary
anyways as the file will get created with or without it.

This was submitted upstream as misc/54940 and committed in rev 1.8 of the
file.
2020-02-05 17:21:36 +00:00
Ed Maste
83372bda16 libfetch: disallow invalid escape sequences
Per RFC1738 escape is "% hex hex"; other sequences do not form a valid URL.

Suggested by:	Matthew Dillon
Reviewed by:	Matthew Dillon
MFC after:	1 week
2020-02-05 16:55:00 +00:00
Ed Maste
690a8a6acd regen linuxulator sysent after r357577 2020-02-05 16:54:16 +00:00
Ed Maste
fc7510aef7 linuxulator: implement sendfile
Submitted by:	Bora Özarslan <borako.ozarslan@gmail.com>
Submitted by:	Yang Wang <2333@outlook.jp>
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D19917
2020-02-05 16:53:02 +00:00
Mark Johnston
a3a706387e Fix a use of an uninitialized pointer in xdr_rpcbs_rmtcalllist().
This appears to have been introduced in r173763.  Also fix the confusing
indentation that probably led to the bug in the first place.

PR:		243759
Diagnosed by:	martin@lispworks.com
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2020-02-05 16:10:09 +00:00
Mark Johnston
51d7f2ed58 Improve validation of the sockaddr length in iruserok_sa().
Negative numbers are not valid sockaddr lengths.

PR:		243747
Submitted by:	Andrew Reiter <areiter@veracode.com>
MFC after:	1 week
2020-02-05 16:09:44 +00:00
Mark Johnston
d3631aa582 Avoid releasing object PIP in vn_sendfile() if no pages were grabbed.
sendfile(2) optionally takes a set of headers that get prepended to the
file data.  If the request length is less than that of the headers,
sendfile may not allocate an sfio structure, in which case its pointer
is null and we should be careful not to dereference.  This was
introduced in r356902.

Reported by:	syzkaller
Sponsored by:	The FreeBSD Foundation
2020-02-05 16:09:21 +00:00
Mark Johnston
7c390929d9 Fix map locking in the CLEAR_PKRU sysarch(2) handler.
Reported and tested by:	pho
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2020-02-05 16:09:02 +00:00
Kyle Evans
fbdf47586e wc(1): account for possibility of file == NULL
file could reasonably be NULL here if we we're using stdin. Albeit less
likely in normal usage, one could actually hit either of these warnings on
stdin.

ubmitted by:	sigsys@gmail.com
MFC after:	3 days
2020-02-05 14:00:27 +00:00
Toomas Soome
380977d557 followup on r357497: clean obsolete comment and use shift instead of multiplication
Based on illumos review feedback: leftover comment, but also
have consistent block size calculation and add missing else leg to if
statement.
2020-02-05 13:08:24 +00:00
Leandro Lupori
eb5a41cf2f Add SYSCTL to get KERNBASE and relocated KERNBASE
This change adds 2 new SYSCTLs, to retrieve the original and relocated KERNBASE
values. This provides an easy, architecture independent way to calculate the
running kernel displacement (current/load address minus original base address).

The initial goal for this change is to add a new libkvm function that returns
the kernel displacement, both for live kernels and crashdumps. This would in
turn be used by kgdb to find out how to relocate kernel symbols (if needed).

Reviewed by:	jhb
Differential Revision:	https://reviews.freebsd.org/D23284
2020-02-05 11:34:10 +00:00
Toomas Soome
7503958e4c zfsboot: vdev_read_pad2 does allocate buffer with wrong size
vdev_read_pad2() does read VDEV_PAD_SIZE of data, and will copy size bytes
of it, hence, we need buffer of VDEV_PAD_SIZE bytes.

Issue introduced in r357497.

Reported by:	se
2020-02-05 11:02:00 +00:00
Toomas Soome
a1746b2583 vdev_read_pad2: freeing wrong pointer
Shoud free previously allocated tmp buffer instead. Issue introduced in
r357497.

Reported by:	rpokala
2020-02-05 05:42:42 +00:00
Kyle Evans
0d0883728e Add RELNOTES entry for various daemons pulling in environment variables 2020-02-05 04:43:58 +00:00
Kyle Evans
7466dbd684 cron(8): set the environment variables of the user and/or login class
Prior to processing environment variable set in the crontab file as those
should be of higher precedent, pull in the user or login class environment.

This is another supporting feature for allowing one to configure system-wide
settings that may affect both regular cron jobs as well as services.

This is the final part of D21481.

Submitted by:	Andrew Gierth <andrew_tao173.riddles.org.uk>
2020-02-05 04:35:54 +00:00
Kyle Evans
736a5a6d1d service(8): set the environment of the "daemon" class before invoking
As mentioned in r357562, this gives the user a single place to configure
environment variables that need to be used for various services -- the
"daemon" class -- for, e.g., configuring a system-wide HTTP proxy.

This is a part of D21481.

Submitted by:	Andrew Gierth <andrew_tao173.riddles.org.uk>
2020-02-05 04:32:49 +00:00
Kyle Evans
85c8521e67 env(1): grow -L user/class and -U user/class options
This allows one to set the environment of the specified user either from
login.conf alone (-L) or both login.conf and ~/.login_conf if present (-U).

This is a supporting feature to allow service(8) to pull in the environment
of the "daemon" class before invoking the rc script.

This is a part of D21481.

Submitted by:	Andrew Gierth < andrew_tao173.riddles.org.uk>
2020-02-05 04:29:55 +00:00