Commit Graph

242734 Commits

Author SHA1 Message Date
Sean Chittenden
a0bc451f0b usr.sbin/bhyveload: don't leak an fd if a device can't be opened
Coverity CID:	1194167
Approved by:	markj, jhb
Differential Revision:	https://reviews.freebsd.org/D20935
2019-07-12 18:38:18 +00:00
Scott Long
422a8a4d3a Tie the name limit of a VM to SPECNAMELEN from devfs instead of a
hard-coded value. Don't allocate space for it from the kernel stack.
Account for prefix, suffix, and separator space in the name. This
takes the effective length up to 229 bytes on 13-current, and 37 bytes
on 12-stable. 37 bytes is enough to hold a full GUID string.

PR:		234134
MFC after:	1 week
Differential Revision:	http://reviews.freebsd.org/D20924
2019-07-12 18:37:56 +00:00
Sean Chittenden
dbb1521165 usr.sbin/bhyve: only unassign a pt device after obtaining bus/slot/func
Coverity CID:	1194302, 1194303, 1194304
Approved by:	jhb, markj
Differential Revision:	https://reviews.freebsd.org/D20933
2019-07-12 18:33:58 +00:00
Sean Chittenden
ba1ca6d2e3 usr.sbin/bhyve: free resources when erroring out of pci_vtcon_sock_add()
Coverity CID:	1362880
Approved by:	markj, jhb
Differential Revision:	https://reviews.freebsd.org/D20916
2019-07-12 18:20:56 +00:00
Sean Chittenden
cb84aeda17 usr.sbin/bhyve: prevent use-after-free in virtio scsi request handling
Coverity CID:	1393377
Approved by:	araujo, jhb
Differential Revision:	https://reviews.freebsd.org/D20915
2019-07-12 18:17:35 +00:00
Sean Chittenden
ae2c5fe32f usr.sbin/bhyve: don't leak a FD if the device is not a tty
Coverity CID:	1194193
Approved by:	markj, jhb
Differential Revision:	https://reviews.freebsd.org/D20934
2019-07-12 18:13:58 +00:00
Mark Johnston
194a6e146d Apply some light cleanup to uses of pmap_pte_dirty().
- Check for ATTR_SW_MANAGED before anything else.
- Use pmap_pte_dirty() in pmap_remove_pages().

No functional change intended.

Reviewed by:	alc
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2019-07-12 15:24:25 +00:00
Randall Stewart
55f795883f add back the comment around the pending DSACK fixes. 2019-07-12 11:45:42 +00:00
Andrey V. Elsukov
2dab0de635 Do not modify cmd pointer if it is already last opcode in the rule.
MFC after:	1 week
2019-07-12 09:59:21 +00:00
Andrey V. Elsukov
4ee2f4c180 Correctly truncate the rule in case when it has several action opcodes.
It is possible, that opcode at the ACTION_PTR() location is not real
action, but action modificator like "log", "tag" etc. In this case we
need to check for each opcode in the loop to find O_EXTERNAL_ACTION.

Obtained from:	Yandex LLC
MFC after:	1 week
Sponsored by:	Yandex LLC
2019-07-12 09:48:42 +00:00
Poul-Henning Kamp
ccbb355988 Support multiple serial ports per device.
Enable this for the NovAtel OEMv2 GPS receiver.

Not fixed:  The receiver shows up as "<Interface 0>" in the device
tree, because that is literally what the descriptor-string is.

Reviewed by:	hselasky@
2019-07-12 09:02:12 +00:00
Warner Losh
28c8ec2f7e Retire the -DRELEASE_CRUNCH define.
The RELEASE_CRUNCH ifdefs save about 100 bytes of text space. The
complexity is not worth it as they eliminate error messages.

Left the RELEASE_CRUNCH ifdef to eliminate a lot of stuff in place.
That saves an interesting amount of space and change some behaviors,
so absent a more detailed analysis, maintain the status quo.
2019-07-12 06:19:25 +00:00
Sean Chittenden
e47c192236 usr.sbin/bhyve: unconditionally initialize the NVMe completion status
Follow-up work to improve the handling of unsupported/invalid opcodes
is being developed by chuck@.

Coverity CID:	1398928
Reviewed by:	chuck
Approved by:	araujo, imp
Differential Revision:	https://reviews.freebsd.org/D20914
2019-07-12 05:53:13 +00:00
Warner Losh
c99e4e6b8b Retire support for -DMINIMALISTIC
We've not used this in years since we retired sysinstall, and it
hasn't compiled in at least a year. A full camcontrol is only 180k, so
making it smaller is not as important as it once was.

OK'd by: ken@, scottl@
2019-07-12 05:35:45 +00:00
Sean Chittenden
c7cb7db87d usr.sbin/bhyve: free resources when erroring out of pci_vtnet_init()
Coverity CID:	1402978
Approved by:	vmaffione
Reviewed by:	jhb
Differential Revision:	https://reviews.freebsd.org/D20912
2019-07-12 05:19:37 +00:00
Warner Losh
5603490248 There is no SMALLER define anymore here
Stop defining SMALLER. Since we replaced cpio with libarchive version,
there's no options to make it smaller. Also, the comment about the
FreeBSD installer is obsolete. Remove them both.
2019-07-12 05:19:06 +00:00
Warner Losh
2cfe8b8d46 Remove unused defines since r147075
When the OpenBSD dhclient was brought in 14 years ago, we stopped
supporting building a reduced sized dhclient, yet retained the options
here.  Also, the OpenBSD dhclient doesn't need lint defined, so it can
go too.
2019-07-12 04:44:50 +00:00
Cy Schubert
75118b47fc Move the new ipf_pcksum6() function from ip_fil_freebsd.c to fil.c.
The reason for this is that ipftest(8), which still works on FreeBSD-11,
fails to link to it, breaking stable/11 builds.

ipftest(8) was broken (segfault) sometime during the FreeBSD-12 cycle.
glebius@ suggested we disable building it until I can get around to
fixing it. Hence this was not caught in -current.

The intention is to fix ipftest(8) as it is used by the netbsd-tests
(imported by ngie@ many moons ago) for regression testing.

MFC after:	immediately
2019-07-12 01:59:08 +00:00
Justin Hibbits
1ea717577f Allow efi loader to get network params from uboot
Summary:
efi loader does not work with static network parameters. It always uses
BOOTP/DHCP and also uses RARP as a fallback.  Problems with DHCP servers can
cause the loader to fail to populate network parameters.

Submitted by:	Siddharth Tuli <siddharthtuli_gmail.com>
Reviewed by:	imp
Sponsored by:	Juniper Networks, Inc.
Differential Revision:	https://reviews.freebsd.org/D20811
2019-07-12 00:54:20 +00:00
Sean Chittenden
fe1329e446 usr.sbin/bhyve: send an initialized value to wake up blocking kqueue
This is a no-op initialization because nothing reads this value.  "This
wasn't wrong previously, but this is more correct now." -imp

Coverity CID:	1194307
Approved by:	markj, imp, scottl
Differential Revision:	https://reviews.freebsd.org/D20921
2019-07-11 23:54:50 +00:00
Simon J. Gerraty
3ae2a848ae libsecureboot: avoid recusion in ve_trust_init
set our guard value immediately.
also replace call to ve_trust_init in opgp_sig.c:initialize with
call to openpgp_trust_init.

Reported by:	mindal@semihalf.com
Reviewed by:	jhibbits obrien
MFC after:	1 week
2019-07-11 22:06:59 +00:00
Doug Moore
3f3f7c056f Address problems in blist_alloc introduced in r349777. The swap block allocator could become corrupted
if a retry to allocate swap space, after a larger allocation attempt failed, allocated a smaller set of free blocks
that ended on a 32- or 64-block boundary.

Add tests to detect this kind of failure-to-extend-at-boundary and prevent the associated accounting screwup.

Reported by: pho
Tested by: pho
Reviewed by: alc
Approved by: markj (mentor)
Discussed with: kib
Differential Revision: https://reviews.freebsd.org/D20893
2019-07-11 20:52:39 +00:00
Sean Chittenden
bf51e078b6 usr.sbin/bhyve: commit miss from r349918
Submitted by:	markj
Approved by:	markj
Differential Revision:	https://reviews.freebsd.org/D20918
2019-07-11 19:51:33 +00:00
Sean Chittenden
bab8915c94 usr.sbin/bhyve: free leaked memory during option parsing
Also update to use strsep(3) instead of strtok(3).

Most of this commit inadvertently ended up in r349914.

Coverity CID:	1357337
Approved by:	markj
PR:		233038
Differential Revision:	https://reviews.freebsd.org/D20918
2019-07-11 19:41:14 +00:00
Cy Schubert
c5dddb272d Remove a tautological test for adding a rule in the block that
adds rules.

MFC after:	1 week
2019-07-11 19:36:18 +00:00
Cy Schubert
3133f9c2a3 Correct r349898. The default is add a rule.
MFC after:	1 week
X-MFC with:	r349898
2019-07-11 19:36:14 +00:00
Sean Chittenden
cdd80cac4a usr.sbin/bhyve: initialize return value in xhci device interrupt handler
Coverity CID:	1357340
Approved by:	scottl, markj
Differential Revision:	https://reviews.freebsd.org/D20917
2019-07-11 19:26:35 +00:00
Sean Chittenden
2a1950b9cc usr.sbin/bhyve: free resources if there is an initialization error in rfb
Coverity CID:	1357335
Approved by:	markj, jhb
Differential Revision:	https://reviews.freebsd.org/D20919
2019-07-11 19:07:45 +00:00
Konstantin Belousov
e2e0470dfa Ensure that mds_handler always points to a valid method.
Depending on system configuration, version, and architecture,
mds_handler might be dereferenced from doreti before
hw_mds_recalculate_boot() initialized it.  Statically assign void
method to cover all cases.

Reported by:	"Schuendehuette, Matthias (LDA IT PLM)" <matthias.schuendehuette@siemens.com>
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2019-07-11 16:22:49 +00:00
Konstantin Belousov
3212ada519 Restore ability to pass NULL name argument to pthread_set_name_np(3)
to clear the thread name.

PR:	239142
Submitted by:	Lewis Donzis <lew@perftech.com>
MFC after:	3 days
2019-07-11 16:19:33 +00:00
Mark Johnston
a9da8477af Fix some ISS bit definitions for data aborts.
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2019-07-11 15:36:59 +00:00
Warner Losh
4b1ac5c2d8 More fully implement the state machine.
When a command is finished running, we must transition it from INQUEUE
to busy state. We were failing to do that, so we hit a panic when the
commands were freed. This only affects mpr, mps already did simmilar
things. Now both the polling and interrupt paths properly set BUSY as
appropriate.
2019-07-11 06:22:15 +00:00
Randall Stewart
1cf999a5f3 Update to jhb's other suggestion, use #error when
we are missing  HPTS.
2019-07-11 04:40:58 +00:00
Randall Stewart
9cf3c235c0 Update copyright per JBH's suggestions.. thanks. 2019-07-11 04:38:33 +00:00
Justin Hibbits
9ac516a6f1 powerpc: Only worry about the lower 32 bits of SP in a 32-bit process
Summary:
Running a 32-bit process on a 64-bit POWER CPU may still use all 64-bits
in calculations, while ignoring the upper 32 bits for addressing
storage.  It so happens that some processes end up with r1 (SP) having
bit 31 set in some cases (33-bit address).  Writing out to this 33-bit
address obviosly fails.  Since the CPU ignores the upper bits, we should
as well.

sendsig() and cpu_fetch_syscall_args() appear to be the only functions
that actually rely on userspace register values for copy in/out, and
cpu_fetch_syscall_args() doesn't seem to be bitten in practice yet.

Reviewed By: luporl
Differential Revision: https://reviews.freebsd.org/D20896
2019-07-11 03:29:25 +00:00
Alan Cox
46a7f2ebd4 According to Section D5.10.3 "Maintenance requirements on changing System
register values" of the architecture manual, an isb instruction should be
executed after updating ttbr0_el1 and before invalidating the TLB.  The
lack of this instruction in pmap_activate() appears to be the reason why
andrew@ and I have observed an unexpected TLB entry for an invalid PTE on
entry to pmap_enter_quick_locked().  Thus, we should now be able to revert
the workaround committed in r349442.

Reviewed by:	markj
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D20904
2019-07-11 02:43:23 +00:00
Mark Johnston
32e42e4a89 Add vm_page_hold.9 to ObsoleteFiles.inc.
Add a missing .gz suffix to pwm.9 while here.
2019-07-11 02:15:50 +00:00
Cy Schubert
d37052fc86 ipfilter commands, in this case ipf(8), passes its operations and rules
via an ioctl interface. Rules can be added or removed and stats and
counters can be zeroed out. As the ipfilter interprets these
instructions or operations they are stored in an integer called
addrem (add/remove). 1 is add, 2 is remove, and 3 is clear stats and
counters. Much of this is not documented. This commit documents these
operations by replacing simple integers with a self documenting
enum along with a few basic comments.

MFC after:	1 week
2019-07-11 00:08:46 +00:00
Mark Johnston
f84a04c8bc Rename pmap_page_dirty() to pmap_pte_dirty().
This is a precursor to implementing dirty bit management.

Discussed with:	alc
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2019-07-10 22:52:26 +00:00
Philip Paeps
6071f00ffe telnet: fix minor style violation
While here also fix a very unlikely NULL pointer dereference.

Submitted by:	Shawn Webb <shawn.webb@hardenedbsd.org>
2019-07-10 22:36:14 +00:00
Warner Losh
f6ccd325fc Enforce a 4GB DMA boundary on isci(4)
This device cannot cross a 4GB boundary with DMA.  Removing the
boundary in r346386 resulted in low frequency memory corruption on
machines with isci(4) controllers.

Submitted by: gallatin@
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D20910
2019-07-10 22:23:59 +00:00
Randall Stewart
3b0b41e613 This commit updates rack to what is basically being used at NF as
well as sets in some of the groundwork for committing BBR. The
hpts system is updated as well as some other needed utilities
for the entrance of BBR. This is actually part 1 of 3 more
needed commits which will finally complete with BBRv1 being
added as a new tcp stack.

Sponsored by:	Netflix Inc.
Differential Revision:	https://reviews.freebsd.org/D20834
2019-07-10 20:40:39 +00:00
Mark Johnston
2ffee5c1b2 Inherit P2_PROTMAX_{ENABLE,DISABLE} across fork().
Thus, when using proccontrol(1) to disable implicit application of
PROT_MAX within a process, child processes will inherit this setting.

Discussed with:	kib
MFC with:	r349609
Sponsored by:	The FreeBSD Foundation
2019-07-10 19:57:48 +00:00
Ian Lepore
6325d2df9e Reorganize the SRCS lists as one file per line, and then alphabetize them.
No functional changes.
2019-07-10 19:32:50 +00:00
Philip Paeps
e68ce1cc10 telnet: fix a couple of snprintf() buffer overflows
Obtained from:	Juniper Networks
MFC after:	1 week
2019-07-10 17:42:04 +00:00
Warner Losh
e787ccc3f9 Fix compile errors with the CI20
Fix mutex includes and fix a typo. The CI20 kernel is not built as
part of universe.

PR: 239115
Submitted by: Kai Nacke
2019-07-10 17:21:59 +00:00
Ian Lepore
b522e138c5 De-pollute arm's sysarch.h.
Instead of including stdint.h for uintptr_t, include sys/_types.h and use
__types for everything that isn't a native C keyword type.

Remove the #include of cdefs.h.  It appears after the include of armreg.h
which has a precondition of cdefs.h being included before it, so everyone
including sysarch.h is already including cdefs.h.  (When armv5 support
goes away, there will be no need include armreg.h here either.)

Unfortunately, the unprefixed struct member names "addr" and "len" cannot
be changed, because 3rd-party software is relying on them (libcompiler_rt
is one known consumer).
2019-07-10 14:34:52 +00:00
Andriy Gapon
c66f5b079d linuxcommon: add module version
MFC after:	2 weeks
2019-07-10 13:47:10 +00:00
Leandro Lupori
8b55f9f853 [PPC64] pseries: fix realmaxaddr calculation
On POWER9/pseries, QEMU passes several regions of memory,
instead of a single region containing all memory, as the
code was expecting.

Reviewed by:	jhibbits
Differential Revision:	https://reviews.freebsd.org/D20857
2019-07-10 13:36:17 +00:00
Andriy Gapon
01f1fff003 owc_gpiobus: small formatting cleanup
MFC after:	1 week
2019-07-10 12:40:07 +00:00