Commit Graph

243512 Commits

Author SHA1 Message Date
Alan Somers
5e35df9474 ping6: Add missing static keyword for a global variable
This fixes -Wmissing-variable-declarations error when compiled with
WARNS=6.

Submitted by:	Ján Sučan <sucanjan@gmail.com>
MFC after:	2 weeks
Sponsored by:	Google, inc. (Google Summer of Code 2019)
Differential Revision:	https://reviews.freebsd.org/D21214
2019-08-11 15:27:34 +00:00
Alan Somers
0ef7ac044a ping6: Revoke root privilege earlier
It can be done just after the sockets have been created.

Submitted by:	Ján Sučan <sucanjan@gmail.com>
MFC after:	2 weeks
Sponsored by:	Google, inc. (Google Summer of Code 2019)
Differential Revision:	https://reviews.freebsd.org/D21213
2019-08-11 15:22:53 +00:00
Xin LI
51f61fc0c7 Upgrade to Bzip2 version 1.0.8.
MFC after:	3 days
2019-08-11 06:26:03 +00:00
Xin LI
fb69e223e5 Vendor import bzip2 -- upgrade to version 1.0.8. 2019-08-11 06:22:06 +00:00
Ian Lepore
2a002a0549 Remove use of intr_config_hook from the am335x_pmic and tda19988 drivers.
Long ago this was needed, but now low-level i2c controller drivers cleverly
defer attachment of the bus until interrupts are enabled (if they require
interrupts to function), so that every i2c slave device doesn't have to.
2019-08-10 20:08:37 +00:00
Ian Lepore
a51f005289 The am335x_ehrpwm driver now requires the pwmbus_if interface, add it. 2019-08-10 20:05:15 +00:00
Ian Lepore
4d52f81d43 Allow the sdhci timeout sysctl var to be set as a tunable. Also, add a
missing newline in a warning printf.
2019-08-10 20:03:14 +00:00
Emmanuel Vadot
d27bec74fe allwinner: Add support to min/max in aw_clk_frac
The Fractionals clock in Allwinner device have some min/max frequencies
that they can do.
Add support for it.
2019-08-10 19:02:50 +00:00
Emmanuel Vadot
e727f392bf Remove some duplicate code that end up in r350844 2019-08-10 18:58:25 +00:00
Emmanuel Vadot
8c8b86922a allwinner: Add a new clock aw_clk_m
We used the aw_clk_nm clock for clock with only one divider factor
and used a fake multiplier factor. This cannot work properly as we
end up writing the "fake" factor to the register (and so always set
the LSB to 1).
Create a new clock for those.
The reason for not using the clk_div clock is because those clocks are
a bit special. Since they are (almost) all related to video we also need
to set the parent clock (the main PLL) to a frequency that they can support.
As the main PLL have some minimal frequency that they can support we need to
be able to set the main PLL to a multiple of the desired frequency.
Let say you want to have a 71Mhz pixel clock (typical for a 1280x800 display)
and the main PLL cannot go under 192Mhz, you need to set it to 3 times the
desired frequency and set the divider to 3 on the hdmi clock.
So this also introduce the CLK_SET_ROUND_MULTIPLE flag that allow for this kind
of scenario.
2019-08-10 18:50:37 +00:00
Conrad Meyer
d52a918e3f .gitignore: Add LINT kernel configurations generated into SRCDIR 2019-08-10 18:22:22 +00:00
Emmanuel Vadot
cfc8861b06 allwinner: Rework the BUS_PASS on drivers
- Put all clock and control unit driver in BUS_PASS_RESOURCE except
  for the DE2 CCU as it needs the main CCU to be available.
- Use BUS_PASS_CPU for a20_cpu_cfg as it makes more sense.
- For aw_syscon use SCHEDULER pass as we need it early for drivers
  that attach in BUS_PASS_SUPPORTDEV
- For the rest we can use BUS_PASS_SUPPORTDEV
2019-08-10 17:58:30 +00:00
Ian Lepore
7596e192fb When responding to an interrupt in the am335x_pmic driver, use a taskqueue
thread to do the work that involves i2c IO, which sleeps while the IO is
in progress.
2019-08-10 17:48:11 +00:00
Ian Lepore
0ad8b8edc4 Garbage collect the no-longer-necessary MAX_IIC_DATA_SIZE (there is not a
buffer allocated at that fixed size anymore).
2019-08-10 17:28:14 +00:00
Ian Lepore
3f24d465fd Switch the am335x_pmic driver to using iicdev_readfrom/writeto.
PR:		239697
Submitted by:	Chuhong Yuan
2019-08-10 17:14:35 +00:00
Enji Cooper
84a457c6c0 tests/sys/opencrypto: enable armv8crypto on aarch64
This change makes required modifications in runtests to also only require the
aesni module on Intel (i386/amd64) platforms, as it is an Intel specific
module.

MFC after:	1 month
MFC to:		^/stable/12 (support not present on ^/stable/11)
Submitted by:	Greg V <greg@unrelenting.technology>
Differential Revision:	https://reviews.freebsd.org/D21018
2019-08-10 15:53:42 +00:00
Warner Losh
91c0020fb0 These are no longer a thing, remove them.
We don't need to omit ep and ex from LINT since they have been removed from the
tree.
2019-08-10 04:15:36 +00:00
Brooks Davis
4a045a66fd Don't add -Wno-class-memaccess with older gcc.
This is a gcc 8.0+ warning which needed to be silenced on for the riscv
build.  amd64-xtoolchain-gcc still uses gcc 6.4.0 and does not understand
this flag.

Reviewed by:	asomers
Feedback from:	imp
Differential Revision:	https://reviews.freebsd.org/D21195
2019-08-09 23:50:57 +00:00
Brandon Bergren
bdccf0bbac Implement _umtx_op_err.S on powerpc / powerpc64.
As per r177853, we need to avoid using errno inside user mutex code, since
 signal handlers can interfere with it and mess up libthr internal state.

So, implement _umtx_op_err() instead, which makes a raw syscall and
returns the error value directly instead of using errno.

Approved by: jhibbits (mentor)
Differential Revision: https://reviews.freebsd.org/D20946
2019-08-09 20:16:38 +00:00
Toomas Soome
6e5555adb1 loader: add error check for vdev_indirect calls
We can error out due to memory allocation errors, we can not recover from
those and need to get out.
2019-08-09 19:09:05 +00:00
Andrey V. Elsukov
bf1a213c07 Add missing new line in several log messages.
PR:		239694
MFC after:	1 week
2019-08-09 08:58:09 +00:00
Jonathan T. Looney
afd959f332 In m_pulldown(), before trying to prepend bytes to the subsequent mbuf,
ensure that the subsequent mbuf contains the remainder of the bytes
the caller sought. If this is not the case, fall through to the code
which gathers the bytes in a new mbuf.

This fixes a bug where m_pulldown() could fail to gather all the desired
bytes into consecutive memory.

PR:		238787
Reported by:	A reddit user
Discussed with:	emaste
Obtained from:	NetBSD
MFC after:	3 days
2019-08-09 05:18:59 +00:00
Justin Hibbits
3447ea90d7 autofs: Fix autounmountd's printing of mount time.
time_t should be printed as intmax_t.  Even though duration should be short, the
correct way to print is intmax_t, not long.

Reported by:	ian,imp
2019-08-09 02:20:26 +00:00
Conrad Meyer
162022d77d tools/tools/crypto: cryptokeytest: Fix build with newer OpenSSL
Also, drag into this decade.
2019-08-09 02:11:47 +00:00
Mark Johnston
bbb4c4d8bb Flesh out the STANDARDS and AUTHORS sections in the du(1) man page.
PR:		239722
Submitted by:	Gordon Bergling <gbergling@gmail.com>
MFC after:	3 days
2019-08-08 21:16:15 +00:00
Mark Johnston
ced9ddb250 Update RFC references in the whois(1) man page.
PR:		239720
Submitted by:	Gordon Bergling <gbergling@gmail.com>
MFC after:	3 days
2019-08-08 21:15:02 +00:00
Mark Johnston
b7e7ec5fe4 Add a reference to the NFSv3 RFC.
PR:		239721
Submitted by:	Gordon Bergling <gbergling@gmail.com>
MFC after:	3 days
2019-08-08 21:08:13 +00:00
Mark Johnston
d4c8b7594f Fix formatting.
PR:		239726
Submitted by:	Gordon Bergling <gbergling@gmail.com>
MFC after:	3 days
2019-08-08 20:56:52 +00:00
Warner Losh
5e34c4c505 Stopgap fix for gcc platforms.
Our in-tree gcc doesn't have a no-tree-vectorize optimization knob, so we get a
warning that it's unused. This causes the build to fail on all our gcc platforms.
Add a quick version check as a stop-gap measure to get CI building again.
2019-08-08 20:09:36 +00:00
Rick Macklem
6b1bc6f7dd Remove some harmless cruft from vn_generic_copy_file_range().
An earlier version of the patch had code that set "error" between
line#s 2797-2799. When that code was moved, the second check for "error != 0"
could never be true and the check became harmless cruft.
This patch removes the cruft, mainly to make Coverity happy.

Reported by:	asomers, cem
2019-08-08 20:07:38 +00:00
Rick Macklem
614633146f Fix copy_file_range(2) for an unlikely race during hole finding.
Since the VOP_IOCTL(FIOSEEKDATA/FIOSEEKHOLE) calls are done with the
vnode unlocked, it is possible for another thread to do:
- truncate(), lseek(), write()
between the two calls and create a hole where FIOSEEKDATA returned the
start of data.
For this case, VOP_IOCTL(FIOSEEKHOLE) will return the same offset for
the hole location. This could result in an infinite loop in the copy
code, since copylen is set to 0 and the copy doesn't advance.
Usually, this race is avoided because of the use of rangelocks, but the
NFS server does not do range locking and could do a sequence like the
above to create the hole.

This patch checks for this case and makes the hole search fail, to avoid
the infinite loop.

At this time, it is an open question as to whether or not the NFS server
should do range locking to avoid this race.
2019-08-08 19:53:07 +00:00
Toomas Soome
b1b9326846 loader: support com.delphix:removing
We should support removing vdev from boot pool. Update loader zfs reader
to support com.delphix:removing.

Reviewed by:	allanjude
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D18901
2019-08-08 18:08:13 +00:00
Warner Losh
56abac3fc3 First pass at a LINT for arm64.
Create a rough and ready NOTES file from GENERIC, remove the duplication from
sys/conf/NOTES and add relevant no* directives to make this compile.

Reviewed by: jhb, manu (earlier versions that differed only in comments)
Differential Revision: https://reviews.freebsd.org/D21184
2019-08-08 17:55:19 +00:00
Warner Losh
83959d613a Make arm64 32-bit mode compile with COMPAT_43
The COMPAT_43 option isn't quite like the other compat options, and arm64 makes
attempts to support it in 64-bit mode. In 32-bit compat mode, however, two
syscall implementations that COMPAT_FREEBSD32 assumes will be there are
missing. Provide implementations for these: ofreebsd32_sigreturn (which we'll
never encounter, so implement it as nosys as is done in kern_sig.c) and
ofreebsd32_getpagesize, where we'll always return 4096 since that's the only
PAGE_SIZE we support, similar to how the ia32 implementation does things.

Reviewed by: manu@
Differential Revision: https://reviews.freebsd.org/D21192
2019-08-08 17:48:07 +00:00
Marcin Wojtas
435672e322 Verify files loaded in chain command.
The chain command can be used to chain load another binary.
If veriexec is enabled we should verify it first.
Note that on EFI systems the verification was already done
through firmware, assuming that Secure Boot was enabled there.

Submitted by: Kornel Duleba <mindal@semihalf.com>
Reviewed by: sjg
MFC after: 1 week
Obtained from: Semihalf
Differential Revision: https://reviews.freebsd.org/D20952
2019-08-08 17:03:30 +00:00
Conrad Meyer
4d3f1eafc9 Update to Zstandard 1.4.2
The full release notes for 1.4.1 (skipped) and 1.4.2 can be found on Github:

  https://github.com/facebook/zstd/releases/tag/v1.4.1
  https://github.com/facebook/zstd/releases/tag/v1.4.2

These are mostly minor updates; 1.4.1 purportedly brings something like 7%
faster decompression speed.

Relnotes:	yes
2019-08-08 16:54:22 +00:00
Marcin Wojtas
e7c5d9d3f2 Fix mac_veriexec_parser build after r347938
In r347938 the definition of mac_veriexec_metadata_add_file
so adjust the argument list accordingly.

Submitted by: Kornel Duleba <mindal@semihalf.com>
2019-08-08 16:51:49 +00:00
Konstantin Belousov
10ae16c7fe Fix stack grow for init.
During early stages of kern_exec(), including strings copyout,
p_textvp for init is NULL.  This prevented stack grow from working for
init execution.

Without stack gap enabled, initial stack segment size is enough for
strings passed by kernel to init.  With the gap enabled, the used
address might fall out of the initial segment, which kills init.

Exclude initproc from the check for contexts which should not cause
stack grow in the target map.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2019-08-08 16:48:19 +00:00
Konstantin Belousov
b706be23b4 Update comment explaining create_init().
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2019-08-08 16:42:53 +00:00
Justin Hibbits
e6bb926199 mips: Fix register target for SP setting in libproc
Copy-paste-o from r233042
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D21188
2019-08-08 16:37:32 +00:00
Conrad Meyer
90f4bdbe91 import zstd 1.4.2 2019-08-08 15:37:56 +00:00
Conrad Meyer
fa94c7381a import zstd 1.4.1 2019-08-08 15:30:49 +00:00
Warner Losh
cca7237972 Add TCP_RFC7413
We should be linting this This isn't enabled on all platforms, but compiles on
them all.

Noticed by: jhb in another review
2019-08-08 15:11:37 +00:00
Ed Maste
8279d4b711 armv8crypto: add missing unlock for session (after r336439)
Attempts to use cryptodev (e.g. tests at /usr/src/tests/sys/opencrypto
with armv8crypto added to the module lists) were causing a panic.

Submitted by:	Greg V <greg_unrelenting.technology>
Differential Revision:	https://reviews.freebsd.org/D21012
2019-08-08 14:34:53 +00:00
Tom Jones
deb2aead4a Rename IPPROTO 33 from SEP to DCCP
IPPROTO 33 is DCCP in the IANA Registry:
https://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml

IPPROTO_SEP was added about 20 years ago in r33804. The entries were added
straight from RFC1700, without regard to whether they were used.

The reference in RFC1700 for SEP is '[JC120] <mystery contact>', this is an
indication that the protocol number was probably in use in a private network.

As RFC1700 is no longer the authoritative list of internet numbers and that
IANA assinged 33 to DCCP in RFC4340, change the header to the actual
authoritative source.

Reviewed by:	Richard Scheffenegger, bz
Approved by:	bz (mentor)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D21178
2019-08-08 11:43:09 +00:00
Bjoern A. Zeeb
1540a98e36 frag6: move public structure into file local space.
Move ip6asfrag and the accompanying IP6_REASS_MBUF macro from
ip6_var.h into frag6.c as they are not used outside frag6.c.
Sadly struct ip6q is all over the mac framework so we have to
leave it public.

This reduces the public KPI space.

MFC after:		3 months
X-MFC:			possibly MFC the #define only to stable branches
Sponsored by:		Netflix
2019-08-08 10:59:54 +00:00
Bjoern A. Zeeb
5778b399f1 frag6.c: cleanup varaibles and return statements.
Consitently put () around return values.
Do not assign variables at the time of variable declaration.
Sort variables.  Rename ia to ia6, remove/reuse some variables used only
once or twice for temporary calculations.

No functional changes intended.

MFC after:		3 months
Sponsored by:		Netflix
2019-08-08 10:15:47 +00:00
Bjoern A. Zeeb
23d374aa14 frag6.c: initial comment and whitespace cleanup.
Cleanup some comments (start with upper case, ends in punctuation,
use width and do not consume vertical space).  Update comments to
RFC8200.  Some whitespace changes.

No functional changes.

MFC after:		3 months
Sponsored by:		Netflix
2019-08-08 09:42:57 +00:00
Michael Tuexen
47d16bf9c1 Fix a typo.
Submitted by:		Thomas Dreibholz
MFC after:		1 week
2019-08-08 08:23:27 +00:00
Xin LI
22bbc4b242 Convert DDB_CTF to use newer version of ZLIB.
PR:		229763
Submitted by:	Yoshihiro Ota <ota j email ne jp>
Differential Revision:	https://reviews.freebsd.org/D21176
2019-08-08 07:27:49 +00:00