Commit Graph

282008 Commits

Author SHA1 Message Date
Rick Macklem
0bb08f21cc rc.d: Fix NFS server startup scripts to enable vnet prison use
Now that commit cbbb22031f is in main,
it is possible to run nfsd(8), nfsuserd(8), mountd(8),
gssd(8) and rpc.tlsservd(8) in an appropriately configured vnet
prison if the "allow.nfsd" option is specified in jail.conf.

This patch fixes the rc scripts for this.
Mostly just replaces the "nojail" KEYWORD with "nojailvnet",
but also avoids setting vfs.nfsd.srvmaxio in a prison, since it
must be set outside of the prisons and applies to all
nfsd(8) instances.

Reviewed by:	jamie
MFC after:	3 months
Differential Revision:	https://reviews.freebsd.org/D38809
2023-03-12 14:34:25 -07:00
Mateusz Guzik
35c872422c vfs: whack leftover cn_origflags
Unused since 5b5b7e2ca2 ("vfs: always retain path buffer after lookup")

Reported by:	dchagin
2023-03-12 19:06:46 +00:00
Ihor Antonov
298a392ec3 daemon: move variables into struct daemon_state
The fact that most of the daemon's state is stored on the stack
of the main() makes it hard to split the logic smaller chunks.
Which in turn leads to huge main func that does a a lot of things.
struct log_params existed because some variables need to be passed
into other functions together.

This change renames struct log_params into daemon_state
and moves the rest of the variables into it. This is a necessary
preparation step for further refactroing.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/687
2023-03-12 10:57:41 -06:00
Justin Hibbits
6f0b2a235a powerpc/pmap: Add pmap_sync_icache() for radix pmap
DTrace pid provider writes to user space to set breakpoints.  Failing to
sync the icache can lead to SIGTRAP.  Radix pmap is the only one missing
a pmap_sync_icache() method, so the pid provider would only potentially
crash a process on a POWER9 or later system.
2023-03-12 11:51:42 -04:00
Alfredo Dal'Ava Junior
63715498ac powerpc: enable ZFS on 32 bit powerpc/powerpcspe
Enable ZFS on powerpc 32 bit since it appears to build and work
correctly.

MFC after:	3 weeks
Relnotes:	yes
2023-03-12 03:20:11 -03:00
Konstantin Belousov
c5c9d980c4 libc/csu: rename ignore_init.c to libc_start1.c
The current name was a historical curiosity that started when init array
support was added, and then the file appeared a convenient place for the
addition of the MI common code to csu.  It is now referenced by name in
single place and the rename is easy, so do it.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 weeks
2023-03-12 00:56:46 +02:00
Konstantin Belousov
0c6f0c0db7 libc: move declaration of 'char **environ' to common private header
Suggested by:	imp
Reviewed by:	markj
Tested by:	markj (aarch64)
Sponsored by:	The FreeBSD Foundation
MFC after:	3 weeks
Differential revision:	https://reviews.freebsd.org/D37220
2023-03-12 00:50:04 +02:00
Konstantin Belousov
0303938539 x86: microoptimize static PIE startup
Do not call CPUID on each ireloc, instead call it once and cache
results, similar to how it is done on powerpc64.

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	3 weeks
Differential revision:	https://reviews.freebsd.org/D37220
2023-03-12 00:50:04 +02:00
Konstantin Belousov
51015e6d0f csu: move common code to libc
Why? Most trivial point, it shaves around 600 bytes from the dynamic
binaries on amd64. Less trivial, the removed code is no longer part of
the ABI, and we can ship updates to it with libc updates. Right now most
of the csu is linked into the binaries and require us to do somewhat
tricky ABI compat when it needs to change. For instance, the init_array
change would be much simpler and does not require note tagging if we
have init calling code in libc.

This could be improved more, by splitting dynamic and static
initialization. For instance, &_DYNAMIC tests can be removed then.
Such change, nonetheless, would require building libc three times.
I left this for later, after this change stabilizes, if ever.

Reviewed by:	markj
Discussed with:	jrtc27 (some objections, see the review), imp
Tested by:	markj (aarch64)
Sponsored by:	The FreeBSD Foundation
MFC after:	3 weeks
Differential revision:	https://reviews.freebsd.org/D37220
2023-03-12 00:50:03 +02:00
Mateusz Guzik
3c3a434f8e vm: avoid lock upgrade if possible in vm_fault_next
In my tests during buildkernel fs->m was always NULL at that stage.

Note the change has no impact on vm obj contention during said workload.

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D39027
2023-03-11 21:52:01 +00:00
Maxim Konovalov
1a79144827 rc.conf.5: a stray whitespace removed
PR:	270124
2023-03-11 21:08:04 +00:00
Vincenzo Maffione
22bf2a479f netmap: get rid of WNA() macro
MFC after:	7 days
2023-03-11 17:19:40 +00:00
Justin Hibbits
3e1155ade1 dtrace/powerpc: "Fix" stack traces across trap frames
In function boundary tracing the link register is not yet saved to the
save stack location, so the save point contains whatever the previous
'lr' save was, or even garbage, at the time the trap is taken.  Address
this by explicitly loading the link register from the trap frame instead
of the stack, and propagate that out.
2023-03-11 11:35:27 -05:00
Justin Hibbits
635ecbf470 dtrace/powerpc: Adjust AFRAMES for fbt and profile
FBT_AFRAMES was skipping over too many frames, while PROFILE_AFRAMES was
skipping over too few.  Adjust them empirically.
2023-03-11 11:35:27 -05:00
Justin Hibbits
3caaaa56bb phyp_llan: Mechanically convert to IfAPI
Sponsored by:	Juniper Networks, Inc.
2023-03-11 11:35:27 -05:00
Justin Hibbits
1510005c94 dtsec: Complete mechanical conversion to IfAPI
Some changes were missed in 0083fc5c76.

Sponsored by:	Juniper Networks, Inc.
2023-03-11 11:34:42 -05:00
Ceri Davies
682bd8ecaa rc.conf.5: fix typo of route6d that I introduced while nitpicking 2023-03-11 14:56:40 +00:00
Ceri Davies
effb053522 rc.conf.5: dhclient came from OpenBSD, but now isn't the OpenBSD client 2023-03-11 14:54:11 +00:00
Mateusz Guzik
fdb1dbb1cc vm: read-locked fault handling for backing objects
This is almost the simplest patch which manages to avoid write locking
for backing objects, as a result mostly fixing vm object contention
problems.

What is not fixed:
1. cacheline ping pong due to read-locks
2. cacheline ping pong due to pip
3. cacheling ping pong due to object busying
4. write locking on first object

On top of it the use of VM_OBJECT_UNLOCK instead of explicitly tracking
the state is slower multithreaded that it needs to be, done for
simplicity for the time being.

Sample lock profiling results doing -j 104 buildkernel on tmpfs:
before:
71446200 (rw:vmobject)
14689706 (sx:vm map (user))
4166251 (rw:pmap pv list)
2799924 (spin mutex:turnstile chain)

after:
19940411 (rw:vmobject)
8166012 (rw:pmap pv list)
6017608 (sx:vm map (user))
1151416 (sleep mutex:pipe mutex)

Reviewed by:	kib
Reviewed by:	markj
Tested by:	pho
Differential Revision:	https://reviews.freebsd.org/D38964
2023-03-11 11:08:21 +00:00
Mateusz Guzik
bdfd1adc99 vm: add VM_OBJECT_UNLOCK
Reviewed by:	kib
Reviewed by:	markj
Tested by:	pho
Differential Revision:	https://reviews.freebsd.org/D38964
2023-03-11 11:08:21 +00:00
Mateusz Guzik
73b951cd39 vm: move up object lock asserts in fault functions
No functional changes.

Reviewed by:	kib
Reviewed by:	markj
Tested by:	pho
Differential Revision:	https://reviews.freebsd.org/D38964
2023-03-11 11:08:21 +00:00
Mark Johnston
44b31d37ad qat: Reconnect qat.4 to the build
It was disconnected when the new QAT driver was imported, and never
reconnected.
2023-03-10 18:30:50 -05:00
Mark Johnston
e1ccf64b88 netbsd-tests: Serialize message queue tests
They can fail when run in parallel since they all share a global queue
key.

MFC after:	1 week
2023-03-10 17:07:06 -05:00
Mark Johnston
478de7f8e2 netbsd-tests: Remove some pointless sleeps from message queue tests
- In the msgctl tests, there is no point in sleeping after a fork().
  Just block immediately in wait().
- In non-blocking send/recv tests, just wait for the child to exit once
  it's reached a message limit.  If a bug prevents the child from
  exiting promptly, the test will time out.

MFC after:	1 week
2023-03-10 17:06:46 -05:00
Warner Losh
3916fdd2f2 opts: fix silly typo
It's powerpcspe not powerpcspc

Pointy Hat To:		imp
Noticed by:		jhibbits
Fixes:			41cf798e82
Sponsored by:		Netflix
2023-03-10 09:00:38 -07:00
Warner Losh
41cf798e82 opts: popwerpcspc is also 32-bit
Mark ZFS broken here too, add comment about why.  Add comments about
OFED being disabled on 32-bit arm, add comment about why too.

Sponsored by:		Netflix
2023-03-10 08:49:04 -07:00
Warner Losh
9503d2704c opts: Minor cleanup of ZFS options
Remove redundant CPUARCH test: we really just want a plain MACHINE_ARCH
here.

Second, always turn off LOADER_ZFS when we turn off ZFS. Not 100%
required, but we did it some places and not others. There's no current
mechanism to say that if X is disabled then X_Y must be too.

Sponsored by:		Netflix
2023-03-10 07:14:04 -07:00
Dag-Erling Smørgrav
1955ad42b3 tftpd: Gracefully skip tests if networking is not enabled.
Sponsored by:	Klara, Inc.
Reviewed by:	asomers
Differential Revision:	https://reviews.freebsd.org/D39012
2023-03-10 13:25:16 +00:00
Dag-Erling Smørgrav
64c2a712d6 tftp: Add tests.
Sponsored by:	Klara, Inc.
Reviewed by:	asomers
Differential Revision:	https://reviews.freebsd.org/D38969
2023-03-10 13:25:16 +00:00
Dag-Erling Smørgrav
77e83935b7 tftpd: Don't forget to close stderr on startup.
Just like stdin and stdout, stderr is a copy of the listen socket inherited from inetd.  We need to close it so inetd can process further requests, be restarted, etc.

Sponsored by:	Klara, Inc.
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D38968
2023-03-10 13:25:16 +00:00
Dag-Erling Smørgrav
b4736c90ad tftpd: Don't consume arbitrary requests when failing to fork.
We've already consumed one request, which is sufficient to prevent inetd from endlessly restarting us in this particular and extremely unlikely case.

Sponsored by:	Klara, Inc.
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D38967
2023-03-10 13:25:16 +00:00
Dag-Erling Smørgrav
e3b4cb1b32 tftpd: Use poll() instead of alarm() + setjmp().
While there, don't log an error when timing out waiting for a possible retransmit after a successful transfer.

Sponsored by:	Klara, Inc.
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D38966
2023-03-10 13:25:16 +00:00
Dag-Erling Smørgrav
9f6f64941c tftpd: Make the -d option behave as documented.
Sponsored by:	Klara, Inc.
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D38965
2023-03-10 13:25:16 +00:00
Dag-Erling Smørgrav
92570f67c7 tftp: Correctly propagate transfer errors.
Sponsored by:	Klara, Inc.
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D38958
2023-03-10 13:25:16 +00:00
Dag-Erling Smørgrav
36242fc0e5 tftpd: Make the transfer functions return success / failure.
Sponsored by:	Klara, Inc.
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D38957
2023-03-10 13:25:16 +00:00
Dag-Erling Smørgrav
7c21545c46 tftpd: Ensure that tftp_log() preserves errno.
Sponsored by:	Klara, Inc.
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D38956
2023-03-10 13:25:16 +00:00
Dag-Erling Smørgrav
a6dfd2015c tftpd: Fix max block size calculation.
Sponsored by:	Klara, Inc.
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D38953
2023-03-10 13:25:15 +00:00
Stefan Eßer
175a4d1042 contrib/bc: update to version 6.4.0
This version contains a fix for an issue that can affect complex
bc scripts that use multiple read() functions that receive input from
an interactive user. The same value could be returned multiple times.

MFC after:	2 weeks
2023-03-10 11:33:33 +01:00
Kyle Evans
cc0fe048ec kern: physmem: don't create a new exregion for different flags...
... if the region we're adding is an exact match to one that we already
have.  Simply extend the flags of the existing entry as needed so that
we don't end up with duplicate regions.

It could be that we got the exclusion through two different means, e.g.,
FDT memreserve and the EFI memory map, and we may derive different
characteristics from each.  Apply the most restrictive set to the
region.

Reported by:	Mark Millard <marklmi yahoo com>
Reviewed by:	mhorne
2023-03-09 23:27:39 -06:00
Xin LI
75798f9b01 cap_*(2): Document ENOSYS behavior.
Summary:
All cap_* system calls would fail when capability mode support is
not present.

MFC after:	2 weeks
Reviewed by:	emaste, pauamma
Differential Revision: https://reviews.freebsd.org/D38976
2023-03-09 18:10:50 -08:00
Cy Schubert
5abaf08664 heimdal: Fix CVE-2022-4152, signature validation error
When CVE-2022-3437 was fixed by changing memcmp to be a constant
time and the workaround for th e compiler was to add "!=0". However
the logic implmented was inverted resulting in CVE-2022-4152.

Reported by:	Timothy E Zingelman <zingelman _AT_ fnal.gov>
MFC after:	1 day
Security:	CVE-2022-4152
Security:	https://www.cve.org/CVERecord?id=CVE-2022-45142
Security:	https://nvd.nist.gov/vuln/detail/CVE-2022-45142
Security:	https://security-tracker.debian.org/tracker/CVE-2022-45142
Security:	https://bugs.gentoo.org/show_bug.cgi?id=CVE-2022-45142
Security:	https://bugzilla.samba.org/show_bug.cgi?id=15296
Security:	https://www.openwall.com/lists/oss-security/2023/02/08/1
2023-03-09 17:18:49 -08:00
Michael Tuexen
4a2b92d99f sctp: initial implementation of draft-tuexen-tsvwg-sctp-zero-checksum 2023-03-10 01:45:46 +01:00
Mark Johnston
626d1e4a82 netmap: Remove obsolete compatibility defines
No functional change intended.

Reviewed by:	vmaffione
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D39001
2023-03-09 18:16:53 -05:00
Brooks Davis
3ac71149ba Add WITH_LOADER_VERIEXEC_VECTX description
PR:		270017
Reviewed by:	emaste
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D39002
2023-03-09 21:39:41 +00:00
Michael Butler
21735dfaeb include: Remove no longer existing netgraph/atm
Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D39005
2023-03-09 21:39:41 +00:00
Ceri Davies
465171322e man5/rc.conf.5: finally retire references to pccard_ifconfig variable
It was removed in June 2005.
2023-03-09 21:38:46 +00:00
Ceri Davies
654b1e38c4 man5/rc.conf.5: minor nitpicks to formatting, grammar, spelling 2023-03-09 21:35:03 +00:00
Ceri Davies
efa3c0af37 rc.conf: update comment referring to /etc/motd 2023-03-09 21:28:30 +00:00
Baptiste Daroussin
e5dd5bfa55 pkg(7): now that we do use libmd, use it completly
Use SHA256_Fd and SHA256_Data instead of home made equivalent.
wrap those functions into hash.c to avoid header collition between
openssl and libmd

Suggested by:	kevans
2023-03-09 21:31:30 +01:00
Ceri Davies
5b3f109816 man5/rc.conf.5: document hostid and machine-id related variables 2023-03-09 20:05:52 +00:00