1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-11-24 07:40:52 +00:00
Commit Graph

294249 Commits

Author SHA1 Message Date
Konstantin Belousov
bdd5eb33ca iommu: change iommu_domain_map_ops to take iommu_map_entry
instead of base/size.

Sponsored by:	Advanced Micro Devices (AMD)
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2024-09-27 20:34:23 +03:00
Konstantin Belousov
d50403a691 iommu: add per-unit sysctls reporting the state of DMA and interrupt remapping
Sponsored by:	Advanced Micro Devices (AMD)
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2024-09-27 20:34:23 +03:00
Konstantin Belousov
10ebd230f4 intel_idpgtbl.c: rename domain_* functions to dmar_*
Sponsored by:	Advanced Micro Devices (AMD)
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2024-09-27 20:34:23 +03:00
Colin Percival
fc2efd283b RELNOTES: RSA host keys for SSH are deprecated
Ficticious hash since there's no actual code change; but the release
notes for FreeBSD 15 should say that RSA host keys for SSH will no
longer be generated by default in FreeBSD 16.

Discussed on:	freebsd-arch
Sponsored by:	Amazon
2024-09-27 09:28:44 -07:00
Konstantin Belousov
5ac9320ddf procstat(1): add rlimitusage subcommand
Reviewed by:	markj, olce
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D46747
2024-09-27 18:02:34 +03:00
Konstantin Belousov
6126f4ea64 libprocstat: add procstat_getrlimitusage()
Reviewed by:	markj, olce
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D46747
2024-09-27 18:02:29 +03:00
Konstantin Belousov
c85d3064c4 sysctl: add KERN_PROC_RLIMIT_USAGE
Reviewed by:	markj, olce
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D46747
2024-09-27 18:02:23 +03:00
Konstantin Belousov
927f379180 Regen 2024-09-27 18:02:23 +03:00
Konstantin Belousov
9b29fc89ae Userspace enablement for getrlimitusage(2)
Reviewed by:	markj, olce
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D46747
2024-09-27 18:02:09 +03:00
Konstantin Belousov
f028f44ef3 Add getrlimitusage(2)
Reviewed by:	markj, olce
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D46747
2024-09-27 18:02:04 +03:00
Konstantin Belousov
9c3e516ad0 Add proc_nfiles(9)
which returns a snapshot of the count of the opened files in the
process.

Reviewed by:	markj, olce
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D46747
2024-09-27 18:01:56 +03:00
Pierre Pronchery
869d760cb9 bhyve: avoid TOCTOU on iov_len in virtio_vq_recordon()
Avoid a race condition when accessing guest memory, by reading memory
contents only once.

This has also been applied to _vq_record() in
sys/dev/beri/virtio/virtio.c, as per markj@'s suggestion.

Reported by:	Synacktiv
Reviewed by:	markj
Security:	HYP-10
Sponsored by:	The Alpha-Omega Project
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D45735
2024-09-27 10:20:53 -04:00
Pierre Pronchery
94693ec7c8 bhyve: initialize register value
In case of an error in a code pattern like

```
uint64_t val;
error = memread(vcpu, gpa, &val, 1, arg);
error = vie_update_register(vcpu, reg, val, size);
```

uninitialized stack data would be used.

Reported by:    Synacktiv
Reviewed by:	markj
Security:       HYP-21
Sponsored by:   The Alpha-Omega Project
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D46107
2024-09-27 08:59:36 -04:00
Kajetan Staszkiewicz
7fe42038b2 pf: fix max-src-conn when rules are added via netlink
Reviewed by:	kp
Differential Revision:	https://reviews.freebsd.org/D46797
2024-09-27 14:29:20 +02:00
Kristof Provost
e8ff5e565c pf: fix incorrect parsing of state export filter
We saved the af parameter to the proto field.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2024-09-27 11:50:00 +02:00
Kevin Bowling
9bf9164fc8 e1000: Clean up ITR/EITR in preparation for AIM
Provide macros to derive the various needed values and make it a bit
more clear the differences between em and igb.

The igb default EITR was not landing at the right offset.

Respect the 'max_interrupt_rate' tunable.

MFC after:	1 week
Sponsored by:	BBOX.io
2024-09-27 01:30:05 -07:00
Kevin Bowling
1c578f1c93 e1000: Clean up legacy absolute and packet timers
The absolute and packet timers only apply to lem and em with some only
applying to the later.

This cleans up the sysctl tree to only show these where applicable and
stops writing to unexpected registers for igb.

MFC after:	1 week
Sponsored by:	BBOX.io
2024-09-26 23:45:04 -07:00
Konstantin Belousov
b0f9f970ec Regen 2024-09-27 01:54:25 +03:00
Konstantin Belousov
eade2001aa jemalloc: set LG_VADDR to 64 on amd64
and allow to revert it back to 48 with WITHOUT_JEMALLOC_LG_VADDR_WIDE build
option.

Reviewed by:	andrew, emaste
Sponsored by:	Advanced Micro Devices (AMD)
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D46686
2024-09-27 01:54:25 +03:00
Dag-Erling Smørgrav
f10f288faf diff3: Remove debugging remnant.
Fixes:		cf73401c4f
MFC after:	3 weeks
2024-09-26 23:12:39 +02:00
Pierre Pronchery
71fa171c64 bhyve: Initialize stack buffer in pci_ahci
In the function ahci_handle_dsm_trim, if the call to read_prdt fails,
the variable buf[512] is used while it contains uninitialized data.

It is easy to make the call to read_prdt fail, for instance if
hdr->prdtl == NULL, the function will return without writing anything in
buf.

In addition, this code could be hardened by checking the value of done
before accessing &buf[done].

Reported by:	Synacktiv
Reviewed by:	markj
Security:	HYP-15
Sponsored by:	The Alpha-Omega Project
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D46090
2024-09-26 14:06:10 -04:00
Doug Rabson
a3d5dec420 release(7): fix the spelling of git.FreeBSD.org 2024-09-26 16:20:42 +01:00
Kajetan Staszkiewicz
f28d5ac5c4 pf tests: fix max_states test
Ensure our rule with '(max 3)' only matches the TCP states we're counting.

Reviewed by:	kp
Differential Revision:	https://reviews.freebsd.org/D46795
2024-09-26 16:50:45 +02:00
Justin Hibbits
21525fe03c sdhci: Add sysctl to report quirks on the slot
Summary:
It can be useful to see what quirks are applied on an SDHCI slot.

Obtained from:	Juniper Networks, Inc.
Reviewed By: manu
Differential Revision: https://reviews.freebsd.org/D46790
2024-09-26 09:58:54 -04:00
Jose Luis Duran
120740221f release: basic-cloudinit improve default image
- Add the firstboot-freebsd-update package, as long as we do not have
  pkgbase, this is needed
- Support SLAAC by default to complement DHCPv4 (use SYNCDHP instead)

Signed-off-by: Jose Luis Duran <jlduran@gmail.com>
2024-09-26 13:01:03 +02:00
Jose Luis Duran
e72457c4f5 nuageinit: tests: Cleanup
- Export NUAGE_FAKE_ROOTDIR only once
- Use the header section of the test to require the root user
- Use the PWD environment variable
- Set the root/sys shell as /bin/sh
- Use RFC 5737 reserved IP addresses

Signed-off-by: Jose Luis Duran <jlduran@gmail.com>
2024-09-26 13:00:16 +02:00
Jose Luis Duran
b9ce743c54 nuageinit: Fix passwords
The hashed password usually contains a "$" sign, which, when used on a
shell, must be escaped.  Also, the plain text password may contain
special characters that require escaping.

Add a quick fix by enclosing it in single quotes.  Note that if the
plain text password contains a "'", it will still fail.  This will be
properly fixed in later commits.

Some here documents require the document to be a string literal,
especially when passing invalid characters.  Enclose it in single
quotes.

Signed-off-by: Jose Luis Duran <jlduran@gmail.com>
2024-09-26 12:59:56 +02:00
Jose Luis Duran
38bb6f79e3 nuageinit: Standardize user-facing error messages
Signed-off-by: Jose Luis Duran <jlduran@gmail.com>
2024-09-26 12:59:24 +02:00
Jose Luis Duran
945632ca76 nuageinit: Standardize warning/error messages
Standardize the utilities from nuage.lua, to return nil on failure, plus
an error message as a second result, and some value different from nil
on success.

Make warnmsg() and errmsg() append "nuageinit: " by default.  Pass an
optional second parameter as false to avoid printing this tag.

Signed-off-by: Jose Luis Duran <jlduran@gmail.com>
2024-09-26 12:59:14 +02:00
Jose Luis Duran
9b2d92addc nuageinit: Replace os.execute with Lua libraries
Prefer posix.sys.stat's chmod() to os.execute().  While here, change the
name of the locals to be more descriptive.

Signed-off-by: Jose Luis Duran <jlduran@gmail.com>
2024-09-26 12:59:00 +02:00
Jose Luis Duran
d71e2c037c nuageinit: Silence an fstyp(8) warning
Silence a warning emitted by fread(3) in fstyp(8)'s read_buf(), when
detecting the file system type of the cloud-init device:

    % fstyp /dev/iso9660/cidata
    fstyp: fread: Invalid argument
    cd9660

Also rephrase slightly a comment while here.

Signed-off-by: Jose Luis Duran <jlduran@gmail.com>
2024-09-26 12:58:42 +02:00
Jose Luis Duran
504981357a nuageinit: Lua check and lint files
Mostly white space, style, and luacheck compliance.

Signed-off-by: Jose Luis Duran <jlduran@gmail.com>
2024-09-26 12:58:00 +02:00
Tom Jones
99adbd1b3f gpioc: Fix handling of priv data during open
Fix the ordering of priv data creation with setting priv data. This
handles failure better and resolves a panic when repeatedly running
tools/tools/gpioevents.

Explicitly initialise more fields in priv data while we are here.

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D46568
2024-09-26 10:16:17 +01:00
Michael Tuexen
78e1b031d2 tcp: improve MAC error handling for SYN segments
Don't leak a maclabel when SYN segments are processed which results
in an error due to MD5 signature handling.
Tweak the #idef MAC to allow additional upcoming changes.

Reviewed by:		markj
MFC after:		1 week
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D46766
2024-09-26 08:10:01 +02:00
Michael Tuexen
2fb778fab8 MAC: improve handling of listening sockets
so_peerlabel can only be used when the socket is not listening.

Reviewed by:		markj
MFC after:		1 week
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D46755
2024-09-26 08:06:24 +02:00
Michael Tuexen
3f2792166a MAC: improve consistency in error handling
Whenever mac_syncache_init() returns an error, ensure that
*label = NULL. This simplifies the error handling by the caller.

Reviewed by:		rscheff
MFC after:		1 week
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D46701
2024-09-26 08:04:54 +02:00
Greg Lehey
b7b7800043 Explain the relationship between -p and -Z. 2024-09-26 12:07:02 +10:00
John Baldwin
ef052adf09 nvmf: Narrow scope of sim lock in nvmf_sim_io
nvmf_submit_request() handles races with concurrent queue pair
destruction (or the queue pair being destroyed between
nvmf_allocate_request and nvmf_submit_request), so the lock is not
needed here.  This avoids holding the lock across transport-specific
logic such as queueing mbufs for PDUs to a socket buffer, etc.

Holding the lock across nvmf_allocate_request() ensures that the queue
pair pointers in the softc are still valid as shutdown attempts will
block on the lock before destroying the queue pairs.

Sponsored by:	Chelsio Communications
2024-09-25 21:14:06 -04:00
John Baldwin
aec2ae8b57 nvmf: Always use xpt_done instead of xpt_done_direct
The last reference on a pending I/O request might be held by an mbuf
in the socket buffer.  When this mbuf is freed, the I/O request is
completed which triggers completion of the CCB.  However, this can
occur with locks held (e.g. with so_snd locked when the mbuf is freed
by sbdrop()) raising a LOR between so_snd and the CAM device lock.
Instead, defer CCB completion processing to a thread where locks are
not held.

Sponsored by:	Chelsio Communications
2024-09-25 21:10:44 -04:00
Val Packett
6a4f0c0637 pci_iov: Add a device_printf if out of bus numbers
Reviewed by:	imp
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D20591
2024-09-25 15:17:16 -07:00
Krzysztof Galazka
36a0019238 iflib: Simplify iflib_legacy_setup
Follow the pattern from iflib_irq_alloc_generic function and use
iflib_fast_intr as a handler for RX only interrupts.

Also remove some intermediate variables and use consistent
way for referencing queue's structures.

Signed-off-by: Krzysztof Galazka <krzysztof.galazka@intel.com>

Reviewed by:	markj
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D46061
2024-09-25 13:33:34 -07:00
Dag-Erling Smørgrav
d2c2d5f494 stdio: Disable USE_XPRINTF envar.
As xprintf has not kept up with our standard printf(3) implementation,
it is becoming increasingly dangerous to continue to allow it to take
over if USE_XPRINTF is defined.  Remove that code, while still allowing
applications which know about xprintf to select it.

Reviewed by:	phk
Differential Revision:	https://reviews.freebsd.org/D46765
2024-09-25 19:14:55 +02:00
Dag-Erling Smørgrav
cf73401c4f diff3: Fix merge mode.
This is mostly thj@'s work, with some tweaks and cleanup by me.  There
are still some cases where our output differs from GNU diff3, but it's
much better than before and I'd rather commit what I have now than let
it continue to languish in a metaphorical drawer.

MFC after	3 weeks
Sponsored by:	Klara, Inc.
Reviewed by:	thj
Differential Revision:	https://reviews.freebsd.org/D46762
2024-09-25 19:14:55 +02:00
Kajetan Staszkiewicz
67bd1d0721 pf tests: Add max states test
Reviewed by:	kp
Differential Revision:	https://reviews.freebsd.org/D46774
2024-09-25 17:26:17 +02:00
John Baldwin
b1d324d987 ctl: Move extern for control_softc into <cam/ctl/ctl_private.h>
Reviewed by:	imp
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D46778
2024-09-25 10:21:18 -04:00
John Baldwin
0063ef79f9 ctl_report_supported_opcodes: Rename invalid label to invalid_options
This error handling is specific to an invalid value in the REPORTING
OPTIONS field of a REPORT SUPPORTED OPERATION CODES command.

While here, reuse the label for another case.

Reviewed by:	imp, emaste
Differential Revision:	https://reviews.freebsd.org/D46775
2024-09-25 10:20:22 -04:00
Alexander Ziaee
c7a33fe37d ntp: Improve descriptions in man pages
+ ntpd added to ntp.conf(5) description (search keywords)
+ expand NTP so these pages are shown when `apropos time`
+ "standard" => "reference" for increased consistency
- removed redundant or duplicated search keywords

ntp.org bug:	https://bugs.ntp.org/show_bug.cgi?id=3936
MFC after:	3 days
Reviewed by:	Harlan Stenn <stenn@nwtime.org>
Reviewed by:	Cy Schubert <cy@nwtime.org>
2024-09-25 05:40:17 -07:00
Kajetan Staszkiewicz
85ea699293 pf tests: Make TCP port numbers configurable
This will be useful for state maximums testing.

Reviewed by:	kp
Differential Revision:	https://reviews.freebsd.org/D46773
2024-09-25 12:46:48 +02:00
Kristof Provost
6d51791d28 pf: remove pointless CURVNET_SET
We're already in the correct vnet when the pfil hook is called. Remove the
pointless set/restore.

Reviewed by:	glebius, zlei
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D46648
2024-09-25 12:44:34 +02:00
Kristof Provost
905db4aa88 pf: dedupe layer 4 protocol code in pf_setup_pdesc()
In pf_setup_pdesc() the code for analysing TCP and UDP headers was
the same for v4 and v6.  Deduplicate by moving the protocol switch
after the address family switch.
ok henning@ claudio@

Obtained from:	OpenBSD, bluhm <bluhm@openbsd.org>, 72cf18cc6e
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D46647
2024-09-25 12:44:30 +02:00