Commit Graph

276409 Commits

Author SHA1 Message Date
Mateusz Piotrowski
0438e9beb5 sysctl.8: Reference sysctl(9)
MFC after:	1 week
2022-06-30 16:22:01 +02:00
Mateusz Piotrowski
383ccaa405 sysctl.conf.5: Document rc.d/sysctl and rc.d/sysctl_lastload
Also, update the BUGS section. The example describes an issue, which is
not true anymore thanks to sysctl_lastload. Point readers to rcorder(8)
instead.

MFC after:	2 weeks
2022-06-30 16:22:01 +02:00
Kristof Provost
c21cbaca2b dummynet: handle IPV6 layer 2 traffic
When pf sends layer 2 traffic into dummynet it still marks IPv6 with
IPFW_ARGS_IPV6 (which dummynet translates to PROTO_V6). That in turn
results in it not matching the 'DIR_IN | PROTO_LAYER2' case, and
triggering the 'bad switch' error message.

Add extra cases for LAYER2 | PROTO_IPV6.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2022-06-30 13:36:26 +02:00
Mateusz Piotrowski
7963c02c9b rescure.8: Do not recommend release artifact disc2
The FreeBSD project does not publish disc2 image anymore.

MFC after:	2 weeks
2022-06-30 13:30:02 +02:00
Peter Holm
ec8c9e7ac3 stress2: Rework test to improve error reporting 2022-06-30 09:46:26 +02:00
Roger Pau Monné
77cb05db0c x86/xen: stop assuming kernel memory loading order in PVH
Do not assume that start_info will always be loaded at the highest
memory address, and instead check the position of all the loaded
elements in order to find the last loaded one, and thus a likely safe
place to use as early boot allocation memory space.

Reported by: markj, cperciva
Sponsored by: Citrix Systems R&D
Reviewed by: markj
Differential revision: https://reviews.freebsd.org/D35628
2022-06-30 08:53:16 +02:00
Dag-Erling Smørgrav
038405f32f Enable CRC64 checksums in xz.
Reviewed by:	imp
Sponsored by:	Juniper Networks, Inc.
Sponsored by:	Klara, Inc.
MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D35668
2022-06-29 20:25:52 +00:00
Konstantin Belousov
ad175a107b vfs_mount.c: convert explicit panics and KASSERTs to MPASSERT/MPPASS
Reviewed by:	imp, mjg
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D35652
2022-06-29 21:31:47 +03:00
Konstantin Belousov
61ae7a355c Add MPASSERT() and MPPASS() macros
Suggested by:	mjg
Reviewed by:	imp, mjg
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D35652
2022-06-29 21:31:47 +03:00
Konstantin Belousov
1e54362824 vfs_op_exit(): assert that mnt_vfs_ops stays non-zero for unmount or suspend
Reviewed by:	mjg
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D35639
2022-06-29 21:31:47 +03:00
Jamie Gritton
7060da62ff jail: Remove a prison's shared memory when it dies
Add shm_remove_prison(), that removes all POSIX shared memory segments
belonging to a prison.  Call it from prison_cleanup() so a prison
won't be stuck in a dying state due to the resources still held.

PR:		257555
Reported by:	grembo
2022-06-29 10:47:39 -07:00
Jamie Gritton
a9f7455c38 jail: add prison_cleanup() to release resources held by a dying jail
Currently, when a jail starts dying, either by losing its last user
reference or by being explicitly killed,
osd_jail_call(...PR_METHOD_REMOVE...) is called.  Encapsulate this
into a function prison_cleanup() that can then do other cleanup.
2022-06-29 10:33:05 -07:00
Andrew Turner
cb91f112a3 Decode the arm64 SVE ID register
The field values are only valid when the ID_AA64PFR0_EL1.SVE or
ID_AA64PFR1_EL1.SME vields are non-zero. When this is not the case
the register is reserved as zero so is safe to read, but the SVEver
field will be incorrect so only print the decoded register when
the SVE or SME fields indicate it is valid.

Sponsored by:	The FreeBSD Foundation
2022-06-29 17:50:04 +01:00
Andrew Turner
66ba742d2e Allow use of the arm64 unnamed register form
On arm64 all registers have a name that encodes op0, op1, CRn, CRm, and
op2 that are used to encode the register in the instruction. As some
registers we need to access may not be supportedby older compilers, or
are only supported when specific extensions are enabled support this
alternative form.

Sponsored by:	The FreeBSD Foundation
2022-06-29 17:50:04 +01:00
Gleb Smirnoff
48a55bbfe9 unix: change error code for recvmsg() failed due to RLIMIT_NOFILE
Instead of returning EMSGSIZE pass the error code from fdallocn() directly
to userland.  That would be EMFILE, which makes much more sense.  This
error code is not listed in the specification[1], but the specification
doesn't cover such edge case at all.  Meanwhile the specification lists
EMSGSIZE as the error code for invalid value of msg_iovlen, and FreeBSD
follows that, see sys_recmsg().  Differentiating these two cases will make
a developer/admin life much easier when debugging.

[1] https://pubs.opengroup.org/onlinepubs/9699919799/functions/recvmsg.html

Reviewed by:		markj
Differential revision:	https://reviews.freebsd.org/D35640
2022-06-29 09:42:58 -07:00
Andrew Turner
baf8f20a4a Split out vfp_new_thread
To keep the vfp thread creation code in one place move into vfp.c. This
will also help with adding SVE support as it depends on VFP.

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D35615
2022-06-29 15:15:43 +01:00
En-Wei Wu
cf337fcd74
Remove store-only variable and unnecessary bzero()
- Remove the variable set but not used to fix build on -CURRENT
- Remove bzero() on the space malloc'd with M_ZERO flag.

Signed-off-by:  En-Wei Wu <enweiwu@FreeBSD.org>

Sponsored by:	Google, Inc. (GSoC 2022)
Differential Revision:	https://reviews.freebsd.org/D35624
2022-06-29 20:02:01 +08:00
Peter Holm
bc49526a56 stress2: Fix broken random number generation 2022-06-29 12:28:18 +02:00
Konstantin Belousov
026502d9ed UFS quotaoff: start write before unbusying
Otherwise the mount point could be unmounted meantime.

Reported and tested by:	pho
Reviewed by:	jah
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D35638
2022-06-29 12:36:59 +03:00
Hubert Mazur
b439f64ac1 Improve parameters handling in veriexec
Provide more robust parameter parsing in veriexec. Do a little cleanup as well.

Differential revision:	https://reviews.freebsd.org/D33246
Obtained from:		Semihalf
Reviewed by:		sjg, sebastien.bini_stormshield.eu
2022-06-29 10:57:01 +02:00
Wojciech Macek
e6ef5042e4 libsecureboot: Do not propagate empty string
If Trust Anchors are provided by UEFI and not compiled into
libsecureboot the segmentation fault occurs due to empty
or NULL string usage.

Obtained from:		Semihalf
Reviewed by:		sjg
Differential revision:	https://reviews.freebsd.org/D35120
2022-06-29 10:50:23 +02:00
Wojciech Macek
15c362aeb7 mac_veriexec: Authorize reads of secured sysctls
Writes to sysctls flagged with CTLFLAG_SECURE are blocked if the appropriate secure level is set. mac_veriexec does not behave this way, it blocks such sysctls in read-only mode as well.

This change aims to make mac_veriexec behave like secure levels, as it was meant by the original commit ed377cf41.

Reviewed by:		sjg
Differential revision:	https://reviews.freebsd.org/D34327
Obtained from:		Stormshield
2022-06-29 10:48:01 +02:00
Emmanuel Vadot
8cff8e6e13 Bump __FreeBSD_version after linuxkpi changes. 2022-06-29 09:57:03 +02:00
Emmanuel Vadot
2b743f65f1 linuxkpi: Add pwm.h
Provide dummy functions needed for drm-kmod.

Reviewed by:	bz
MFC after:      1 week
Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D35572
2022-06-29 09:55:26 +02:00
Emmanuel Vadot
0e45856f9a linuxkpi: Add asm/set_memory.h
Provide functions needed for drm-kmod.

MFC after:      1 week
Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D35571
2022-06-29 09:55:23 +02:00
Emmanuel Vadot
137e91dbf6 linuxkpi: Add asm/iosfmbi.h
Provide dummy functions needed for drm-kmod.

Obtain from:	OpenBSD (via drm-kmod)
MFC after:      1 week
Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D35570
2022-06-29 09:55:19 +02:00
Emmanuel Vadot
631bf94fe9 linuxkpi: Add typecheck.h
typecheck macro check if the type of a variable matches a type.

MFC after:      1 week
Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D35569
2022-06-29 09:55:15 +02:00
Emmanuel Vadot
456a92d5d3 linuxkpi: Add pm_runtime.h
Provide dummy functions needed for drm-kmod.

Obtain from:	OpenBSD (via drm-kmod)
MFC after:      1 week
Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D35568
2022-06-29 09:55:12 +02:00
Emmanuel Vadot
cfe72b9f09 linuxkpi: Add mmu_notifier.h
Provide dummy structure needed for drm-kmod.

MFC after:      1 week
Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D35567
2022-06-29 09:55:08 +02:00
Emmanuel Vadot
a95f28800a linuxkpi: Add mmu_context.h
Provide dummy functions needed for drm-kmod.

Reviewed by:	bz
MFC after:      1 week
Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D35566
2022-06-29 09:55:04 +02:00
Emmanuel Vadot
7e4f9ebeaa linuxkpi: Add media-bus-format.h
Provide macros needed for drm-kmod.

Obtain from:	OpenBSD (via drm-kmod)
MFC after:      1 week
Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D35565
2022-06-29 09:55:00 +02:00
Emmanuel Vadot
8730ba418e linuxkpi: Add kmemleak.h
Provide macros needed for drm-kmod.

Obtain from:	OpenBSD (via drm-kmod)
MFC after:      1 week
Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D35564
2022-06-29 09:54:57 +02:00
Emmanuel Vadot
088b746cbd linuxkpi: Add kfifo.h
Provide macros needed for drm-kmod.

Reviewed by:	bz
MFC after:      1 week
Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D35563
2022-06-29 09:54:53 +02:00
Emmanuel Vadot
57c9ec539c linuxkpi: Add console.h
Provide dummy functions needed for drm-kmod.

Reviewed By:	bz
MFC after:      1 week
Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D35562
2022-06-29 09:54:49 +02:00
Emmanuel Vadot
7674baeb37 linuxkpi: Add circ_buf.h
Provide macros needed for drm-kmod.

Reviewed by:	bz
MFC after:	1 week
Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D35561
2022-06-29 09:54:45 +02:00
Dmitry Chagin
c8e7070ce3 linprocfs: Decode SGX CPU feature in cpuinfo
MFC after:		2 weeks
2022-06-29 10:37:52 +03:00
Dmitry Chagin
7ab03740ae linprocfs: Decode more CPU flags in cpuinfo
Differential revision:	https://reviews.freebsd.org/D35556
MFC after:		2 weeks
2022-06-29 10:37:30 +03:00
Dmitry Chagin
050f5a8405 amd64: Reload CPU ext features after resume or cr4 changes
Reviewed by:		kib
Differential revision:	https://reviews.freebsd.org/D35555
MFC after:		2 weeks
2022-06-29 10:34:43 +03:00
Dmitry Chagin
8da00a514e linprocfs: Decode constant_tsc CPU feature
Differential revision:	https://reviews.freebsd.org/D35554
MFC after:		2 weeks
2022-06-29 10:34:04 +03:00
Zhenlei Huang
ccc48995c2 ifconfig.8: Prefer consistent terminologies
Reviewed by:	pauamma_gundo.com, email_luiz.eng.br
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D35384
2022-06-29 08:57:07 +02:00
Mateusz Piotrowski
454adf0fa4 rc.conf.5: Fix example of how rc.conf.d works
While here, fix a typo.

MFC after:	1 week
2022-06-29 00:42:49 +02:00
Mateusz Piotrowski
c618ee7277 hier.7: Add some missing Xr's
MFC after:	3 days
2022-06-28 15:20:06 +02:00
Mateusz Piotrowski
bad2f716f4 ftp: Use /var/spool/ftp as ftp's home consistently
The home directory of the ftp user is /var/spool/ftp according to
hier(7). Update the manual page of ftpd(8) to reflect that.

MFC after:	2 weeks
2022-06-28 15:20:05 +02:00
Mateusz Piotrowski
ecd3759719 hier.7: Refer to build(7) for details about /usr/obj
MFC after:	3 days
2022-06-28 15:20:04 +02:00
Bjoern A. Zeeb
b11f52f4db USB: dwc3: use device_{has,get}_property()
Switch the driver to use device based functions which will work not
only with FDT but also ACPI.

While here make dr_mode a local variable as it is only used during
probe and not needed later in the softc.

MFC after:	2 weeks
Reviewed by:	mw
Differential Revision: https://reviews.freebsd.org/D33170
2022-06-28 13:02:11 +00:00
Bjoern A. Zeeb
945eaca155 ACPI: change arguments to internal acpi_find_dsd()
acpi_find_dsd() is not a bus function and we only need the acpi_device (ad).
The only caller has already looked up the ad (from ivars) for us.
Directly pass the ad to acpi_find_dsd() instead of bus, dev and remove
the extra call to device_get_ivars(); the changed argument also means we
now call AcpiEvaluateObject directly on the handle.

This optimisation was done a while ago while debugging a driver which
ended up with a bad bus, dev combination making the old version fail.

MFC after:	2 weeks
Reviewed by:	mw
Differential Revision: https://reviews.freebsd.org/D35558
2022-06-28 12:57:04 +00:00
Alexander V. Chernikov
513ce835b5 testing: pass ATF vars to pytest via env instead of arguments.
This change is a continuation of 9c42645a1e workaround.
Apparently pytest argument parser is not happy when parsing values
 with spaces or just more than one --atf-var argument.
Switch wrapper to send these kv pairs as env variables. Specifically,
 use _ATF_VAR_key=value format to distinguish from the other vars.

Add the `atf_vars` fixture returning all passed kv pairs as a dict.

Reviewed by:	lwhsu
Differential Revision: https://reviews.freebsd.org/D35625
MFC after:	2 weeks
2022-06-28 12:20:16 +00:00
Kristof Provost
8e1c23341c pf: reduce the risk of src/dst mis-use
NULL out src/dst and check them rather than relying of 'af' to indicate
these variables are valid.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D35573
2022-06-28 14:01:07 +02:00
Kristof Provost
1e5ef2a7e1 if_ovpn tests: extend multi_client test with an iroute test
OpenVPN allows us to push routes for client networks with the 'iroute'
directive. Test that this works as expected.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2022-06-28 13:51:41 +02:00
Kristof Provost
a7a273546e if_ovpn tests: test multiple simultaneous clients
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2022-06-28 13:51:41 +02:00