Commit Graph

251559 Commits

Author SHA1 Message Date
Cy Schubert
4fbd491ee3 Fix incorrect byte order in ipfstat -f output.
- make sure frag is initialized to 0
- initialize ipfr_p field

NetBSD PR:	55137
Submitted by:	christos@NetBSD.org
Reported by:	christos@NetBSD.org
Obtained from:	NetBSD fil.c r1.32, ip_frag.c r1.8
MFC after:	2 weeks
2020-07-17 19:07:59 +00:00
Cy Schubert
1b5e9f7d1e pfil_run_hooks() can be called recursively, so we have to
define FASTROUTE_RECURSION in fil.c

Submitted by:	christos@NetBSD.org
Reported by:	christos@NetBSD.org
Obtained from:	NetBSD r1.31
MFC after:	2 weeks
2020-07-17 19:07:56 +00:00
Cy Schubert
64a1886d5c -4 and -6 only make sense with -i, -o, and -t.
PR:		247952
MFC after:	1 week
2020-07-17 19:07:53 +00:00
Cy Schubert
ebdefe6cb4 The output from usage() need not contain usage for -t when STATETOP
is not compiled in.

PR:		247952
MFC after:	1 week
2020-07-17 19:07:50 +00:00
Cy Schubert
e082c89385 Make ipfstat -t header generic when IPv4 and IPv6 output are
displayed in the same display.

PR:		247952
MFC after:	1 week
2020-07-17 19:07:47 +00:00
Cy Schubert
08c24e2f88 ipfstat -t defaults to IPv4 output. Make consistent with ipfstat -i
and ipfstat -o where without an argument IPv4 and IPv6 states are
shown. Use -4 and -6 to limit the display to IPv4 or IPv6 respectively.

PR:		247952
MFC after:	1 week
2020-07-17 19:07:44 +00:00
Cy Schubert
88b86bb0f3 Historically ipfstat listings and stats only listed IPv4 or IPv6 output.
ipfstat would list IPv4 outputs by default while -6 would produce IPv6
outputs. This commit combines the ipfstat -i and -o outputs into one
listing of IPv4 and IPv6 rules. The -4 option lists only IPv4 rules
(as the default before) while -6 continues to list only rules that affect
IPv6.

PR:		247952
Reported by:	joeb1@a1poweruser.com
MFC after:	1 week
2020-07-17 19:07:40 +00:00
Cy Schubert
5317660176 fr_family (the protocol family) must be AF_INET or AF_INET6, as in
the kernel, not an arbitrary 4 or 6.

This only affected printing ipfilter stats and rules from a kernel
dump. (This is currently undocumented.)

PR:		247952
MFC after:	1 week
2020-07-17 19:07:37 +00:00
Cy Schubert
ce1c2aafce Only use the use_inet6 variable when INET6 is a build option.
This is a prerequisite to upcoming argument processing cleanups which
will resolve consistency as was done with ippool previously.

PR:		247952
MFC after:	1 week
2020-07-17 19:07:34 +00:00
Takanori Watanabe
b8c46d561e Fix L2CAP ACL packet PB(Packet Boundary) flag for LE PDU.
ACL packet boundary flag should be 0 instead of 2 for LE PDU.
Some HCI will drop LE packet with PB flag is 2, and if sent,
some target may reject the packet.

PR:	248024
Reported by:	Greg V
Reviewed by:	Greg V, emax
Differential Revision:	https://reviews.freebsd.org/D25704
2020-07-17 15:50:03 +00:00
Michael Tuexen
7f0ad2274b Improve the locking of address lists by adding some asserts and
rearranging the addition of address such that the lock is not
given up during checking and adding.

MFC after:		1 week
2020-07-17 15:09:49 +00:00
Ruslan Bukin
f3856e6881 Add acpi_iort_map_pci_smmuv3().
This new function allows us to find the SMMU instance assigned
for a particular PCI RID.

Reviewed by:	andrew
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D25687
2020-07-17 14:51:51 +00:00
Mark Johnston
e5587cbbc2 Clean up crypto_init().
The function is called from a KLD load handler, so it may sleep.

- Stop checking for errors from uma_zcreate(), they don't happen.
- Convert M_NOWAIT allocations to M_WAITOK.
- Remove error handling for existing M_WAITOK allocations.
- Fix style.

Reviewed by:	cem, delphij, jhb
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D25696
2020-07-17 14:45:16 +00:00
Andrew Turner
256c5d705a Don't overflow the trap frame when accessing lr or xzr.
When emulating a load pair or store pair in dtrace on arm64 we need to
copy the data between the stack and trap frame. When the registers are
either the link register or the zero register we will access memory
past the end of the trap frame as these are encoded as registers 30 and
31 respectively while the array they access only has 30 entries.

Fix this by creating 2 helper functions to perform the operation with
special cases for these registers.

Sponsored by:	Innovate UK
2020-07-17 14:39:07 +00:00
Piotr Pawel Stefaniak
c6a2e9a7ae Promote use of unprivileged users for building ports by documenting SU_CMD.
Phrasing by Daniel O'Connor.

Reviewed by:	0mp
MFC after:	14 days
Differential Revision:	https://reviews.freebsd.org/D25433
2020-07-17 06:33:20 +00:00
Conrad Meyer
4ae224c663 Revert r240317 to prevent leaking pmap entries
Subsequent to r240317, kmem_free() was replaced with kva_free() (r254025).
kva_free() releases the KVA allocation for the mapped region, but no longer
clears the pmap (pagetable) entries.

An affected pmap_unmapdev operation would leave the still-pmap'd VA space
free for allocation by other KVA consumers.  However, this bug easily
avoided notice for ~7 years because most devices (1) never call
pmap_unmapdev and (2) on amd64, mostly fit within the DMAP and do not need
KVA allocations.  Other affected arch are less popular: i386, MIPS, and
PowerPC.  Arm64, arm32, and riscv are not affected.

Reported by:	Don Morris <dgmorris AT earthlink.net>
Submitted by:	Don Morris (amd64 part)
Reviewed by:	kib, markj, Don (!amd64 parts)
MFC after:	I don't intend to, but you might want to
Sponsored by:	Dell Isilon
Differential Revision:	https://reviews.freebsd.org/D25689
2020-07-16 23:29:26 +00:00
John-Mark Gurney
bbbefa33c9 add script to help figure out what man pages need MLINKS updated... 2020-07-16 23:05:18 +00:00
John Baldwin
e9751a84dd Include FreeBSD ABI tag note in the ELF runtime loader.
Reviewed by:	kib
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D25306
2020-07-16 22:01:01 +00:00
John Baldwin
0bfad43298 Include ABI note tag in shared libraries.
Split the ELF feature note into a separate file that is linked into
*crt1.o the same as crtbrand.S was before.  crtbrand.o is now linked
into crti.o on all platforms in addition to *crt1.o.

Reviewed by:	kib
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D25304
2020-07-16 21:58:43 +00:00
John Baldwin
946b8f6fb0 Add crypto_initreq() and crypto_destroyreq().
These routines are similar to crypto_getreq() and crypto_freereq() but
operate on caller-supplied storage instead of allocating crypto
requests from a UMA zone.

Reviewed by:	markj
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D25691
2020-07-16 21:30:46 +00:00
Kenneth D. Merry
03caca368a Hold the mutex when releasing a callout.
In xpt_release_device(), callout_stop() was being called without
holding the mutex (send_mtx) that is used to protect the callout.

So, move the mtx_unlock() call so that it is protected.

MFC after:	1 week
Sponsored by:	Spectra Logic
2020-07-16 20:43:28 +00:00
Michael Tuexen
f903a308a1 (Re)-allow 0.0.0.0 to be used as an address in connect() for TCP
In r361752 an error handling was introduced for using 0.0.0.0 or
255.255.255.255 as the address in connect() for TCP, since both
addresses can't be used. However, the stack maps 0.0.0.0 implicitly
to a local address and at least two regressions were reported.
Therefore, re-allow the usage of 0.0.0.0.
While there, change the error indicated when using 255.255.255.255
from EAFNOSUPPORT to EACCES as mentioned in the man-page of connect().

Reviewed by:		rrs
MFC after:		1 week
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D25401
2020-07-16 16:46:24 +00:00
Allan Jude
2cc8a524af Add VIRTIO_BLK_T_DISCARD support to the virtio-blk driver
If the hypervisor advertises support for the DISCARD command then the
guest can perform TRIM commands, freeing space on the backing store.

If VIRTIO_BLK_F_DISCARD is enabled, advertise DISKFLAG_CANDELETE

Tested with FreeBSD guests on bhyve and KVM

Reviewed by:	jhb
Tested by:	freqlabs
MFC after:	1 month
Relnotes:	yes
Sponsored by:	Klara Inc.
Differential Revision:	https://reviews.freebsd.org/D21708
2020-07-16 16:32:16 +00:00
Mark Johnston
d272016da4 Add a RELNOTES entry for r363253.
Sponsored by:	The FreeBSD Foundation
2020-07-16 15:12:52 +00:00
Mark Johnston
e64080e79c Switch from SCTP to SCTP_SUPPORT in GENERIC configs.
This removes SCTP from in-tree kernel configuration files.  Now, SCTP
can be enabled by simply loading the module, as discussed on
freebsd-net@.

Reviewed by:	tuexen
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D25611
2020-07-16 15:09:04 +00:00
Kyle Evans
cef5fc74c2 tuntap: drop redundant if_mtu assignment in tuncreate
ether_ifattach will immediately clobber if_mtu with ETHERMTU anyways, just
let it happen.

MFC after:	1 week
2020-07-16 15:02:11 +00:00
Mark Johnston
39523b486b safexcel(4): Silence an integer truncation warning.
In practice overflow is not possible, but we might as well use the right
type for DMA ring sizes.

CID:		1430468
MFC after:	1 week
2020-07-16 14:21:55 +00:00
Warner Losh
34a8e7368f Relax the rule against declaring variables in nested scopes and for
initializations.

Relax some overly perscriptive rules against declarations: they may be at the
start of any blocks, even if things aren't super complicated. Allow more
initializations (those that call simple functions, like accessor functions for
newbus are fine). Allow the common idiom of declaring the loop variable in a for
loop.

This tries to codify what common exceptions are today, as well as give
some guidance on when it's best to do these things.

Reviewed by: tsoome, kp, markm, allanjude, jiles, cem, rpokala
	(earlier versions: seanc, melifaro, bapt, pjd, bz, pstef, arichards,
	 jhibits, vangyzen, jmallet, ian, glebius, jhb, dab, adrian,
	 sef, gnn)
Differential Revision: https://reviews.freebsd.org/D25312
2020-07-16 14:12:54 +00:00
Mateusz Guzik
3ea3fbe685 vfs: fix vn_poll performance with either MAC or AUDIT
The code would unconditionally lock the vnode to audit or call the
mac hoook, even if neither want to do anything. Pre-check the state
to avoid locking in the common case of nothing to do.

Note this code should not be normally executed anyway as vnodes are
always return ready. However, poll1/2 from will-it-scale use regular
files for benchmarking, presumably to focus on the interface itself
as the vnode handler is not supposed to do almost anything.

This in particular fixes poll2 which passes 128 fds.

$ ./poll2_processes -s 10
before: 134411
after:  271572
2020-07-16 14:09:18 +00:00
Mateusz Piotrowski
f2ed697e73 Remove old devd rules for ActiveWire and Entrega Serial DB25
Those rules have been broken at least since 8-STABLE, when the port
providing the ezdownload binary was removed (misc/ezload).

Reviewed by:	kevans, imp
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D25686
2020-07-16 14:04:29 +00:00
Mateusz Guzik
ab06a30517 vfs: fix MAC/AUDIT mismatch in vn_poll
Auditing would not be performed without MAC compiled in.
2020-07-16 14:04:28 +00:00
Kyle Evans
fa2ab81e32 ether_ifattach: set mtu before calling if_attach()
if_attach() -> if_attach_internal() will call if_attachdomain1(ifp) any time
an ethernet interface is setup *after*
SI_SUB_PROTO_IFATTACHDOMAIN/SI_ORDER_FIRST.  This eventually leads to
nd6_ifattach() -> nd6_setmtu0() stashing off ifp->if_mtu in ndi->maxmtu
*before* ifp->if_mtu has been properly set in some scenarios, e.g., USB
ethernet adapter plugged in later on.

For interfaces that are created in early boot, we don't have this issue as
domains aren't constructed enough for them to attach and thus it gets
deferred to domainifattach at SI_SUB_PROTO_IFATTACHDOMAIN/SI_ORDER_SECOND
*after* the mtu has been set earlier in ether_ifattach().

PR:		248005
Submitted by:	Mathew <mjanelle blackberry com>
MFC after:	1 week
2020-07-16 13:37:32 +00:00
Mateusz Guzik
c4e64133d8 amd64: patch ffsl to use the compiler builtin
This shortens fdalloc by over 60 bytes. Correctness verified by running both
variants at the same time and comparing the result of each call.

Note someone(tm) should make a pass at converting everything else feasible.
2020-07-16 11:28:24 +00:00
Toomas Soome
6b8b1bfef0 efibootmgr: typo in long option name
del-timout should be del-timeout

Reported by:	mjg
MFC after:	1 week
2020-07-16 10:20:35 +00:00
Adrian Chadd
0155d8f69d [ar71xx] fix watchdog to work on subsequent SoCs
The AR9341 AHB runs at 225MHz, much faster than the 33MHz of the
AR71xx AHB.  So not only is the math going to do weird things, it
will also wrap rather than being clamped.

So:

* clamp! don't wrap!
* tidy up some debugging
* add an option to throw an NMI rather than reset!

Tested:

* AR9341 SoC (TP-Link TL-WDR4300), patting/not patting the watchdog!
2020-07-15 19:34:19 +00:00
Ed Maste
ea64ebd08c openssh: refer to OpenSSL not SSLeay, part 2
This change was made upstream between 7.9p1 and 8.0p1.  We've made local
changes in the same places for handling the version_addendum; apply the
SSLeay_version to OpenSSL_version change in advance of importing 8.0p1.
This should have been part of r363225.

Obtained from:	OpenSSH-portable a65784c9f9c5
MFC with:	r363225
Sponsored by:	The FreeBSD Foundation
2020-07-15 18:49:00 +00:00
Gregory Neil Shapiro
dceff013b2 Note the merge of sendmail 8.16.1 from vendor "branch" 2020-07-15 18:32:09 +00:00
Gregory Neil Shapiro
5b0945b570 Merge sendmail 8.16.1 to HEAD: See contrib/sendmail/RELEASE_NOTES for details
Includes build infrastructure & config updates required for changes in 8.16.1

MFC after:	5 days
2020-07-15 18:28:54 +00:00
Andriy Gapon
289d6a3fa6 build DTS for Orange Pi PC Plus as well
Reviewed by:	manu
MFC after:	1 week
2020-07-15 18:04:01 +00:00
Alex Richardson
0fd54da0b0 Allow install(1)'s create_tempfile() to work on Linux hosts
GLibc expects six 'X' characters in the mkstemp template argument and
will return EINVAL otherwise.

Reviewed By:	emaste, imp, mjg
Differential Revision: https://reviews.freebsd.org/D25662
2020-07-15 17:24:39 +00:00
Alex Richardson
7425ce4b54 Remove warning that is no longer accurate after r361853
We now build the skein assembly with clangs integrated assembler.

Reviewed By:	emaste
Differential Revision: https://reviews.freebsd.org/D25664
2020-07-15 17:24:34 +00:00
Brooks Davis
7a61fe3a30 Don't imply that all action values can be OR'd.
This is neither POSIX compliant nor what the implementation does.
This could be allowed by changing the value of TCSAFLUSH from 2 to 3,
but that doesn't seem worthwhile after 25+ years.

Reviewed by:	imp
MFC after:	1 week
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D25659
2020-07-15 17:05:37 +00:00
Konstantin Belousov
c123ab20ec Improve description of the vector argument for i386 smp_targeted_tlb_shootdown().
Submitted by:	alc
MFC after:	20 days
2020-07-15 16:12:00 +00:00
Ed Maste
6471c6bd75 openssh: refer to OpenSSL not SSLeay
This change was made upstream between 7.9p1 and 8.0p1.  We've made local
changes in the same places for handling the version_addendum; apply the
SSLeay_version to OpenSSL_version change in advance of importing 8.0p1.

Obtained from:	OpenSSH-portable a65784c9f9c5
Sponsored by:	The FreeBSD Foundation
2020-07-15 15:35:26 +00:00
Allan Jude
af84ca2603 zpool-features(7): Note that the boot loader has support for large_blocks
Since r304321 (-current: Aug 18, 2016) and r328866 (stable/11: Feb 5, 2018)
the FreeBSD loader has supported reading from datasets with the
large_blocks feature active.

PR:		247992
Reported by:	Anton Saietskii <vsasjason@gmail.com>
MFC after:	2 weeks
Sponsored by:	Klara Inc.
2020-07-15 14:38:15 +00:00
Allan Jude
0fd4ac1ec4 vlan(4): Minor grammar corrections
Note: date not bumped because "content" was not changed, just inserted some
missing words.

PR:		248001
Submitted by:	Jose Luis Duran <jlduran@gmail.com>
MFC after:	2 weeks
Sponsored by:	Klara Inc.
2020-07-15 14:27:23 +00:00
Leandro Lupori
4c0c2fb1ad [PowerPC] Use PVO_PADDR to get the PA from PVO
Use PVO_PADDR macro to get the physical address from a PVO, instead of
explicitly ANDing pvo_pte.pa with LPTE_RPGN where it is needed.  Besides
improving readability, this is needed to support superpages (D25237), where
the steps to get the PA from a PVO are different.

Reviewed by:	markj
Sponsored by:	Eldorado Research Institute (eldorado.org.br)
Differential Revision:	https://reviews.freebsd.org/D25654
2020-07-15 13:43:48 +00:00
Eric van Gyzen
8ca1ed33ec Fix style in r363220
Apply the style change Kostik suggested in the review.

Reported by:	kib
MFC after:	2 weeks
X-MFC with:	r363220
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D25676
2020-07-15 13:26:15 +00:00
Eric van Gyzen
d13def78cc Fix Coverity issues in OFED
read_ibdiag_config NULL deref
read_ibdiag_config mem leak
ib_mad_inv_field_str Missing comma in a string array initialization
print_node_header NULL deref
diff_node_ports copy-paste error
ibportstate.c main() missing break in switch
set_thresholds NULL ptr deref
dump_unicast_tables leaks mapnd
umad_cm_attr_str dead code
__ibv_close_device close(-1)
check return value of listen()
mlx5 bitmap.h - bad bit shift - UB
get_dst_addr check return value of inet_pton
osm_perfmgr_init check return value of cl_spinlock_init
osm_port_new memory leak on error path
sa_mad_ctrl_rcv_callback missing break in switch case

I did not include CID numbers because these were found by an internal
run at Isilon.

Reviewed by:	cem kib
MFC after:	2 weeks
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D25676
2020-07-15 13:17:16 +00:00
Alex Richardson
ea6c594cbc Fix BUILD_WITH_STRICT_TMPPATH builds
We need dd in $PATH for some of the MK_BOOT code and some tests also use it.

Obtained from:	CheriBSD
2020-07-15 12:08:06 +00:00