Commit Graph

270989 Commits

Author SHA1 Message Date
Kristof Provost
e51be99e8a test-includes: update badfiles.inc
Rebuild badfiles.inc after recent fixes.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D33506
2021-12-17 12:38:36 +01:00
Kristof Provost
2f3c018ba8 test-includes: use the same header set for badfiles.inc as for testing
This ensures we don't end up listing files we've excluded (e.g. those
starting with _).
Add a slight hack to preserve the existing order (sys, then net) in
badfiles.inc.

Reviewed by:	imp
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D33505
2021-12-17 12:38:35 +01:00
Kristof Provost
e3f06e2580 sys: make filedesc.h self-contained
Sponsored by:   Rubicon Communications, LLC ("Netgate")
2021-12-17 12:38:35 +01:00
Kristof Provost
e7809dceb5 pf: make if_pfsync.h self-contained
Reviewed by:	imp
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D33504
2021-12-17 12:38:35 +01:00
Kristof Provost
dc04fa802d pf: make if_pflog.h self-contained
Reviewed by:	imp
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D33503
2021-12-17 12:38:35 +01:00
Kristof Provost
e9167358e4 net: make if_bridgevar.h self-contained
Reviewed by:	imp
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D33502
2021-12-17 12:38:35 +01:00
Kristof Provost
f4096a7c8a net: make ethernet.h self-contained
Reviewed by:	imp
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D33501
2021-12-17 12:38:35 +01:00
Kristof Provost
959af5a89b sys: make callout.h self-contained
Avoid including sys/types.h from sys/_callout.h (as we try to avoid having
headers starting with underscores depending on non-underscore headers)
by introducing __sbintime_t in sys/_types.h and including that header
instead.

Reviewed by:	imp
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D33500
2021-12-17 12:38:34 +01:00
Kristof Provost
c658610b92 pf: make pfvar.h self-contained
Ensure that the pfvar.h header can be included without including any
other headers.

Reviewed by:	imp
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D33499
2021-12-17 12:38:34 +01:00
Kristof Provost
b29c145cc1 if_stf: make if_stf.h self-contained
Ensure that the if_stf.h header can be included without including any
other headers.

Reviewed by:	imp
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D33498
2021-12-17 12:38:34 +01:00
Andriy Gapon
8eca341d9b follow up to 18679ab1, actually change size of mmc_sim::name to 16
The change was made locally but was not squashed into the commit.

Fixes:		18679ab1 mmc_sim: fix setting of the mutex name
MFC after:	8 days
2021-12-17 13:24:53 +02:00
Hans Petter Selasky
2fcd7d380b snd_uaudio(4): Loosen up the USB MIDI permissions.
This makes USB MIDI more userfriendly for desktop users.

PR:		260489
MFC after:	1 week
Sponsored by:	NVIDIA Networking
2021-12-17 11:54:19 +01:00
Hubert Mazur
3e5fe3d5bf pcf85063: Set RTC device to work in 24h mode
Sometimes the device did not set default hour mode setting correctly,
which lead to conversion errors. Explicitly set device to work in 24h
mode by clearing flag in register, instead of allowing defaults.

Reviewed by:		imp
Obtained from:		Semihalf
Sponsored by:		Alstom Group
Differential revision:	https://reviews.freebsd.org/D33497
2021-12-17 11:07:07 +01:00
Alfonso Siciliano
be0236ebd8 tzsetup: Fix unicode support
Differential revision:	https://reviews.freebsd.org/D33532
2021-12-17 09:25:07 +01:00
David CARLIER
65dd321054 sched.h: Use pid_t type for pid argument
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D33533
2021-12-17 08:22:21 +02:00
Math Ieu
caacda7a3e sched_get/setaffinity(3): pid 0 should designate current process
while FreeBSD' native sched_get/setaffinity use pid -1 for this.

PR:	260487
MFC after:	1 week
2021-12-17 07:31:09 +02:00
Kyle Evans
8ea3921f93 sysent: regenerate files every time
This forces everything to be regenerated by marking makesyscalls.lua
as .PHONY, which may be helpful in, e.g., rebase scenarios, which may
have unexpected effects on mtimes but still really need a regen.

For now we apply this to the default sysent target, which is ran
manually and not as a part of buildkernel.  We can reconsider this if
someone manually running it has issues with the runtime, but the top
level sysent target can run each in parallel; I recommend -j4 or so.

Requested by:	kib
Reviewed by:	brooks, kib (both earlier version)
Differential Revision:	https://reviews.freebsd.org/D33357
2021-12-16 20:56:28 -06:00
Kyle Evans
e6f760f0e8 sysent: regenerate 2021-12-16 20:56:28 -06:00
Kyle Evans
8494666658 sysent: move away from allowing all compat options for other ABIs
Notably, the current compat_options only makes sense for native and
freebsd32 ABIs.  For the others, it just adds cruft. Switch to having
sets of compat options, and default to the native set.  Setup the other
ABIs where it doesn't make sense to opt-out of the native set.

This removes some redundant COMPAT_FREEBSD* stuff from Linuxolator bits.

line_expr in makesyscalls.lua is fixed to allow empty strings to be
specified, since they're harmless.

Reviewed by:	brooks, kib (both earlier version)
Differential Revision:	https://reviews.freebsd.org/D33356
2021-12-16 20:56:28 -06:00
Gleb Smirnoff
d8b45c8e14 inpcb: don't leak the port zone in in_pcbinfo_destroy() 2021-12-16 15:15:02 -08:00
Rick Macklem
150da1e3cd nfscl: Partially revert commit 867c27c23a
Commit 867c27c23a enabled the n_directio_opens code
in open/close, which sets/clears NNONCACHE, for
IO_APPEND. This code should not be enabled unless
newnfs_directio_enable is non-zero.

This patch reverts that part of commit 867c27c23a.

A future patch that fixes the case where the
file that is being written IO_APPEND is mmap()'d.

MFC after:	3 months
2021-12-16 14:30:37 -08:00
John Baldwin
a62478aa05 cryptocheck: Test Camellia-CBC cipher and RIPEMD-160 HMAC.
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D33518
2021-12-16 13:48:39 -08:00
John Baldwin
2cd838281b cryptosoft: Remove CBC handling from swcr_encdec.
All of the CBC ciphers now handle block chaining in the enc_xform.

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D33489
2021-12-16 13:48:15 -08:00
John Baldwin
f84d708b48 crypto: Move CBC handling into enc_xform_camellia.
Add an IV to the context that is initialized by the reinit hook.
Encrypt and decrypt operations handle cipher block chaining along with
updating the IV saved in the context.

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D33488
2021-12-16 13:48:02 -08:00
John Baldwin
d55df8dcf7 crypto: Move CBC handling into enc_xform_aes_cbc.
Add an IV to the context that is initialized by the reinit hook.
Encrypt and decrypt operations handle cipher block chaining along with
updating the IV saved in the context.

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D33487
2021-12-16 13:47:44 -08:00
John Baldwin
246982c196 crypto: Consistently use AES instead of Rijndael128 for the AES-CBC cipher.
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D33486
2021-12-16 13:47:27 -08:00
John Baldwin
47fc049585 crypto: Define POLY1305_BLOCK_LEN constant.
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D33485
2021-12-16 13:47:16 -08:00
John Baldwin
8b4af206f6 Sort libsodium sources by path in sys/modules/crypto/Makefile.
This matches the order used in sys/conf/files to make it easier to
keep these two files in sync.

Reviewed by:	imp
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D33484
2021-12-16 13:47:03 -08:00
John Baldwin
eb2d9adb24 Sort libsodium entries by path in sys/conf/files.
Reviewed by:	imp
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D33483
2021-12-16 13:46:48 -08:00
Doug Moore
f7aa44763d Correct type size format error in KASSERT.
Reported by:	jenkins
Fixes:	6f1c890827 vm: Don't break vm reserv that can't meet align reqs
2021-12-16 13:48:58 -06:00
Ed Maste
301d1de6ba Remove 'All Rights Reserved' from xlocale FreeBSD Foundation copyrights
Sponsored by:	The FreeBSD Foundation
2021-12-16 14:29:12 -05:00
Doug Moore
6f1c890827 vm: Don't break vm reserv that can't meet align reqs
Function vm_reserv_test_contig has incorrectly used its alignment
and boundary parameters to find a well-positioned range of empty pages
in a reservation.  Consequently, a reservation could be broken
mistakenly when it was unable to provide a satisfactory set of pages.

Rename the function, correct the errors, and add assertions to detect
the error in case it appears again.

Reviewed by:	alc, markj
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D33344
2021-12-16 12:20:56 -06:00
Alexander Motin
02732f945e loader.efi: Do not use as frame buffer BLT-only GOPs.
Kernel needs physical frame buffer address and size, which Block
Transfer-only Graphics Output Protocol instances do not have.

Some recent ASUS boards like PRIME Z690M-PLUS D4 and PRIME H570-Plus
report two GOPs, out of which the second one support ConOut protocol,
that made it preferable, but is BLT-only, that made console unusable.

Discussed with:	tsoome (previous version)
MFC after:	1 week
2021-12-16 11:44:34 -05:00
Cy Schubert
c610426c4d ipfilter: MSN RPC proxy is not complete
The MSN RPC proxy is incomplete and does not do any address
translation. Remove it.

MFC after:	1 week
2021-12-16 06:51:16 -08:00
Jung-uk Kim
5c154c6b6b OpenSSL: Do not remove symbolic links readded in 1.1.1m
Reported by:	Herbert J. Skuhra <herbert@mailbox.org>
2021-12-16 09:31:46 -05:00
Mark Johnston
4a61d8ef42 aesni: Fix an out-of-bounds read in AES_GCM_decrypt()
This is the same as 4285655adb ("aesni: Avoid a potential
out-of-bounds load in AES_GCM_encrypt()") except for the decryption
path.

Reported by:	Jenkins (KASAN job)
Reviewed by:	cem
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D33474
2021-12-16 09:17:06 -05:00
Mark Johnston
014f98b119 udp: Fix a use-after-free in udp_multi_input()
"ip" is a pointer into the input mbuf chain, so we shouldn't access it
after the chain is freed.

Fix style at the call site while here.

Reported by:	syzbot+7c8258509722af1b6145@syzkaller.appspotmail.com
Reviewed by:	tuexen, glebius
Fixes:		de2d47842e ("SMR protection for inpcbs")
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D33473
2021-12-16 09:17:05 -05:00
Martin Matuska
681ce946f3 zfs: merge openzfs/zfs@f291fa658 (master) into main
Notable upstream pull request merges:
  #11711 Vdev Properties Feature
  #12717 VOP_RENAME fixes for FreeBSD
  #12746 Enable strict hole reporting by default
  #12770 ZFS send/recv with ashift 9->12 leads to data corruption
  #12828 FreeBSD: Add vop_standard_writecount_nomsyn
  #12828 zfs: Fix a deadlock between page busy and the teardown lock
  #12828 FreeBSD: Catch up with more VFS changes

Obtained from:	OpenZFS
OpenZFS commit:	f291fa658e
2021-12-16 14:38:34 +01:00
Mateusz Guzik
858ed097c4 ida: plug set-but-not-used vars
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2021-12-16 13:23:30 +00:00
Kristof Provost
cfca19c28e tests: sys.netpfil.pf.pfsync.defer fails in CI
sys.netpfil.pf.pfsync.defer has been failing for a while in CI now.
Disable it for now.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2021-12-16 13:09:59 +01:00
Emmanuel Vadot
c4dc907254 loader: lua: test that /boot exists first
Otherwise on fs like tftp where no directory listing is possible we fail
on the .dir method.

Reviewed by:	imp, kevans
MFC after:	2 weeks
Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D33414
2021-12-16 11:50:45 +01:00
Emmanuel Vadot
8ed8b4203a loader: bcache: Fix debug printf
Use %j to it works on 64 and 32 bits system.

Reviewed by:	imp, tsoome
MFC after:	2 weeks
Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D33430
2021-12-16 11:50:43 +01:00
Emmanuel Vadot
3eb019000c loader: tftp: Add preload method
The preload method will transfer the whole file in a buffer and cache it
so read/lseek operations are faster.

Reviewed by:	imp, tsoome
MFC after:	2 weeks
Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D33410
2021-12-16 11:50:41 +01:00
Emmanuel Vadot
c25d9aff46 loader: Add preload operation to fs_ops
When we load an ELF file (kernel or module) we do seek(2) a lot to
parse/load the different sections of the ELF file.
Protocol like TFTP suffers a lot from this as there is no resume or
a way to start the tranfer from a specified offset in the file.
fs_preload is added to help those protocol.
Call preload just after opening the ELF file that we need to load so
the underlying method can cache the hole file and then read/lseek operations
are faster.

Reviewed by:	imp
MFC after:	2 weeks
Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D33409
2021-12-16 11:50:38 +01:00
Emmanuel Vadot
c5f24f5e0d loader: ip: Do not call getsecs so much
getsecs is very costly, reuse the values we got before.

Fetching a ~30MB kernel with the tftp command use to take ~26 seconds
and now it's ~18 seconds.

Reviewed by:	imp, tsoome
MFC after:	2 weeks
Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D33408
2021-12-16 11:50:36 +01:00
Emmanuel Vadot
4f36ed513c loader: tftp: Don't let tftp timeout
When we load a kernel or module we open/close it a few times.
Since we're using the same port number each time and that we requested
the same file the ACK that we send are valid on the server side and the
server send us the file multiple times.
This makes tftp loading time very inconsistant due to the UDP "flood" that
we have to process.

Reviewed by:	imp, tsoome
MFC after:	2 weeks
Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D33407
2021-12-16 11:50:34 +01:00
Emmanuel Vadot
70661eaafa loader: Add a readtest command
readtest will simply load the file in memory, useful for timing
loading on some filesystems.

Reviewed by:	tsoome
MFC after:	2 weeks
Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D33411
2021-12-16 11:50:31 +01:00
Emmanuel Vadot
bf07f2f862 loader: tftp: Don't error on tftp error 0
tftp-hpa sends NAK with tftp error set to 0 when trying to get
a directory and this is the first thing that loader tries to do
and this make it hangs.

Reviewed by:	imp, tsoome
MFC after:	2 weeks
Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D33406
2021-12-16 11:50:29 +01:00
Alan Somers
b214fcceac Change VOP_READDIR's cookies argument to a **uint64_t
The cookies argument is only used by the NFS server.  NFSv2 defines the
cookie as 32 bits on the wire, but NFSv3 increased it to 64 bits.  Our
VOP_READDIR, however, has always defined it as u_long, which is 32 bits
on some architectures.  Change it to 64 bits on all architectures.  This
doesn't matter for any in-tree file systems, but it matters for some
FUSE file systems that use 64-bit directory cookies.

PR:             260375
Reviewed by:    rmacklem
Differential Revision: https://reviews.freebsd.org/D33404
2021-12-15 20:54:57 -07:00
Alan Somers
32fbc5d824 nfs: don't truncate directory cookies to 32-bits in the NFS server
In NFSv2, the directory cookie was 32-bits.  NFSv3 widened it to
64-bits and SVN r22521 widened the corresponding argument in
VOP_READDIR, but FreeBSD's NFS server continued to treat the cookies as
32-bits, and 0-extended to fill the field on the wire.  Nobody ever
noticed, because every in-tree file system generates cookies that fit
comfortably within 32-bits.

Also, have better type safety for txdr_hyper.  Turn it into an inline
function that type-checks its arguments.  Prevents warnings about
shift-count-overflow.

PR:		260375
MFC after:	2 weeks
Reviewed by:	rmacklem
Differential Revision: https://reviews.freebsd.org/D33404
2021-12-15 20:54:57 -07:00