Commit Graph

247445 Commits

Author SHA1 Message Date
oshogbo
ffc175f780 Document the DNS Casper service.
Reviewed by:	brueffer@, bcr@
Differential Revision:	https://reviews.freebsd.org/D13762
2018-01-08 09:20:08 +00:00
asomers
fa15b01717 geli: optimize tests
Reduce the geli tests' runtime by about a third:

* In integrity_test:copy, use a file-backed md(4) device instead of a
  malloc'd one.  That way we can corrupt the underlying storage without
  needing to detach and reattach the geli device.

* In integrity_test:{copy, hmac, data} and onetime_test:{onetime,
  onetime_a}, move reads of /dev/random out of the loop.

MFC after:	2 weeks
2018-01-08 00:10:45 +00:00
ed
fd459f1474 Use mallocarray(9) in CloudABI kernel code where possible.
Submitted by:	pfg@
2018-01-07 22:38:45 +00:00
asomers
339093aef3 geli: convert remaining TAP tests to ATF
MFC after:	2 weeks
2018-01-07 22:21:07 +00:00
asomers
08ca9706de Fix typo from r327666
MFC after:	13 days
X-MFC-With:	327666
2018-01-07 21:57:52 +00:00
jhibbits
fd8b79ff61 Add missing file to gpiobus module
ofw_gpiobus.c is needed when FDT is used.

MFC after:	2 weeks
2018-01-07 20:28:17 +00:00
ian
f47ac564b6 Use EVENTHANDLER_DIRECT_INVOKE for [un]mount events, for better performance. 2018-01-07 18:07:22 +00:00
ian
bdbecc7f3f Use EVENTHANDLER_DIRECT_INVOKE() for device events, for better performance. 2018-01-07 18:06:30 +00:00
kp
849a5573cb vchiq: Use mallocarray() to provide kcalloc()
This means we now also provide integer overflow protection, like the
Linux kcalloc().
2018-01-07 13:41:06 +00:00
kp
51600b48e4 linuxkpi: Implement kcalloc() based on mallocarray()
This means we now get integer overflow protection, which Linux code
might expect as it is also provided by kcalloc() in Linux.
2018-01-07 13:39:12 +00:00
kp
e26bdc0f34 pf: Avoid integer overflow issues by using mallocarray() iso. malloc()
pfioctl() handles several ioctl that takes variable length input, these
include:
- DIOCRADDTABLES
- DIOCRDELTABLES
- DIOCRGETTABLES
- DIOCRGETTSTATS
- DIOCRCLRTSTATS
- DIOCRSETTFLAGS

All of them take a pfioc_table struct as input from userland. One of
its elements (pfrio_size) is used in a buffer length calculation.
The calculation contains an integer overflow which if triggered can lead
to out of bound reads and writes later on.

Reported by:	Ilja Van Sprundel <ivansprundel@ioactive.com>
2018-01-07 13:35:15 +00:00
kp
69291826ac Introduce mallocarray() in the kernel
Similar to calloc() the mallocarray() function checks for integer
overflows before allocating memory.
It does not zero memory, unless the M_ZERO flag is set.

Reviewed by:	pfg, vangyzen (previous version), imp (previous version)
Obtained from:	OpenBSD
Differential Revision:	https://reviews.freebsd.org/D13766
2018-01-07 13:21:01 +00:00
delphij
d85f21b483 stddef.h is not used by cat.c, remove the include. 2018-01-07 07:08:59 +00:00
eadler
a12d99e384 ldconfig(8): clarify language for files
The previous language did not make it clear that 'Files' are
the files specified above. Clarify it.

Reported by:	dana <dana@dana.is>
Reviewed by:	dana <dana@dana.is>
MFC After:	1 week
2018-01-07 05:38:53 +00:00
kevans
2207d053fe aw_sid(4): Add support for Allwinner H3
The sid controller on the H3 is generally identical in location, size, and
efuse offset to the a64 and the a83t. The main difference is that the H3 has
a silicon bug that sometimes causes the rootkey (at least) to be garbled
unless first read by the prctl registers.

This device is currently not in our DTS and, as of now, is not yet present
in mainline Linux DTS.

Tested on:	OrangePi One
2018-01-07 04:59:28 +00:00
kevans
e49410983a aw_sid: Add method for reading keys via prctl registers
Technically supported on the later SoCs, this will only really be used to
add support for the H3 sid. The H3 has a silicon bug that manifests itself
by returning garbled rootkeys unless first read via the prctl registers.
2018-01-07 03:31:55 +00:00
asomers
7edc58b100 geli: fix parallel execution of tests
The trick is not to destroy an md(4) device during a test.  That can create
a "double-free" situation, because we also destroy md devices during test
cleanup.

MFC after:	2 weeks
2018-01-07 02:30:08 +00:00
kevans
1482e17120 Fix bogus pass for syscon_generic introduced in r327621
ian@ pointed out that BUS_PASS_DEFAULT + $anything is bogus, given that
BUS_PASS_DEFAULT is defined as __INT_MAX. Instead, we take a page out of
imx6_usbphy's book and use BUS_PASS_DEFAULT - 1000 to achieve the desired
effect of syscon_generic attaching before if_awg and other potential
consumers, but late enough that more specialized implementations should have
no problem attaching instead.

Reported by:	ian
2018-01-07 02:19:54 +00:00
asomers
e763de9c0f geli: convert most tests from TAP to ATF
I'm leaving readonly_test and nokey_test alone for now. In a future commit
they should be broken up into several smaller test cases and distributed
between multiple files.

Reviewed by:	ngie
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D13717
2018-01-07 00:44:22 +00:00
manu
bf42fe375e arm64: Remove old clock driver for Allwinner 64bit SoC
All the clocks are now handled by the clkng driver.

Tested On: Pine64-LTS (A64)
Tested On: OrangePi PC2 (H5)
2018-01-06 20:32:14 +00:00
kib
5274803f49 Document kern.smp.disabled tunable.
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2018-01-06 16:29:00 +00:00
eadler
008145ac99 morse(6): update documentation
- bump Dd
- use 'r' instead of 'D' from the original submission
2018-01-06 15:52:28 +00:00
kevans
9d128fc579 Move syscon_generic to attach much later
It still needs to be before if_awg at least in order to be available for
other operations, but it should not be attaching before interrupt
controllers at the very least.

This should make errors involving syscon register space colliding with other
devices a little more innocent, but these conflicts should really be tracked
down and resolved. One such conflict is with the Raspberry Pi 3 local
interrupt controller, noticed by tuexen@

Reported by:	tuexen
2018-01-06 14:21:32 +00:00
imp
c92659280b The source strings are from the password database which guarantees
that the data going into it is sane.  Out of an abundance of caution,
limit the string copies to prevent an overflow.

CID: 1019035
2018-01-06 12:46:04 +00:00
imp
9b8c88f693 Sanity check sysconf return value to ensure it's positive before we
use it. Use proper cast to convert long to size_t (instead of
blksize_t) to preclude sign extension issues.

CID: 1193754
2018-01-06 12:45:59 +00:00
imp
ab687701c5 Sanity check media size and sector counts to ensure that we don't
produce negative sector numbers in the testing algorithm.

CID: 1198994
2018-01-06 12:34:03 +00:00
lwhsu
0a7ff7d651 Unbreak build after r327614
Approved by:	mjg (on IRC)
Differential Revision:	https://reviews.freebsd.org/D13782
2018-01-06 09:48:04 +00:00
eadler
b25f1d3db6 morse(6): minor nits
- Use copyright comment header
- Make it easier to compile on !FreeBSD
- Diff reduction against DragonFlyBSD
2018-01-06 07:48:17 +00:00
eadler
1ffe779759 morse(6): implement support for decoding morse code
- Use `-r` for "reverse" mode and to match DragonFlyBSD.
- Move defines around to clear up logic
- use `errx` instead of `fprintf` and `exit`

PR:		35109
Submitted By:	philipp.mergenthaler@stud.uni-karlsruhe.de
Submitted on:	2002-02-19
Reviewed by:	kevans
2018-01-06 07:02:24 +00:00
imp
b3e85e1a3d Invent new #defines for the biospci_{read,write}_config function to
specify the width and use them everywhere.

Sponsored by: Netflix
2018-01-06 06:00:45 +00:00
imp
23082ef0c7 There's no need / benefit from deleting the variable before we set it.
Sponsored by: Netflix
2018-01-06 06:00:40 +00:00
imp
fe5bd3196d Fix usage strings. -d and -p were removed before this was committed to
FreeBSD, but the strings weren't updated.

Sponsored by: Netflix
2018-01-06 06:00:34 +00:00
jkim
59f59f2bf7 Fix a header inclusion missed in the previous commit.
Reported by:	Michael Butler (imb at protected-networks dot net)
2018-01-06 03:41:35 +00:00
sbruno
f3b156e370 Handle misconfigured/nonexistent pcidev for comconsole instead of BTX panic.
PR:		203319
Reviewed by:	imp jhb
MFC after:	2 weeks
Sponsored by:	Limelight Networks
Differential Revision:	https://reviews.freebsd.org/D13776
2018-01-05 23:50:50 +00:00
jkim
21828eb45a Merge ACPICA 20180105. 2018-01-05 23:21:47 +00:00
jkim
e0b56c6ef7 Import ACPICA 20180105. 2018-01-05 23:02:12 +00:00
jkim
441915263d Revert r327599. I missed a new file.
Pointyhat to:	jkim
2018-01-05 22:59:03 +00:00
jkim
95c53489d6 Import ACPICA 20180105. 2018-01-05 22:51:18 +00:00
jhb
05a463ec47 Remove LINK_MAX.
After recent changes to change filesystems to use filesystem-specific
limits, LINK_MAX is no longer used in the base system.  Applications
should in theory be able to cope with a lack of LINK_MAX by using
pathconf().

PR:		224628 (exp-run)
Approved by:	imp, kib
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D13658
2018-01-05 22:26:23 +00:00
kib
dc8d51112c Make it possible to re-evaluate cpu_features.
Add cpuctl(4) ioctl CPUCTL_EVAL_CPU_FEATURES which forces re-read of
cpu_features, cpu_features2, cpu_stdext_features, and
std_stdext_features2.

The intent is to allow the kernel to see the changes in the CPU
features after micocode update.  Of course, the update is not atomic
across variables and not synchronized with readers.  See the man page
warning as well.

Reviewed by:	imp (previous version), jilles
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D13770
2018-01-05 21:06:19 +00:00
glebius
6947b91466 In sendfile_iodone() both pru_abort and sorele need to be executed
with proper VNET context set.

Reported by:	sbruno
MFC after:	2 weeks
2018-01-05 20:21:46 +00:00
avg
85a273200a Fix a couple of comments in AMD Virtual Machine Control Block structure
MFC after:	1 week
2018-01-05 19:15:24 +00:00
jhb
4d93d4b094 Correct comment. procfs_doprocfile implements 'file', not 'self'. 2018-01-05 18:32:46 +00:00
fsu
9384204e2e Add 64bit feature support.
Reviewed by:    kevlo, pfg (mentor)
Approved by:    pfg (mentor)
MFC after:      6 months

Differential Revision:    https://reviews.freebsd.org/D11530
2018-01-05 10:04:01 +00:00
oshogbo
e01adbb00f Build service tests with Casper support. 2018-01-05 09:31:41 +00:00
lwhsu
264c73d886 Fix typo & build
Approved by:	kevlo
2018-01-05 08:29:32 +00:00
imp
f65f3ca610 Remove dead code (comma is either 0 or 1 for sure, no need to test).
Close /dev/pci when we're done with it.

CID: 1007450, 1007449, 1008615, 1008614
2018-01-05 07:29:02 +00:00
imp
5c40977dc4 bits is never null when we call ot. Add an assert to that effect and
remove test for NULL.

CID: 270774
2018-01-05 07:28:58 +00:00
imp
087eed5da1 Tag 'a' case as one we're intentionally falling through to
the 'F' case.

CID: 1008176
2018-01-05 07:28:48 +00:00
eadler
cb0262a41a units(1): add missing ':' for two short arguments
PR:		209850
MFC After:	3 days
2018-01-05 07:24:43 +00:00