1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-11-30 08:19:09 +00:00
Commit Graph

294227 Commits

Author SHA1 Message Date
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
Kristof Provost
dd04fa71a8 pf: remove unused argument 'h' from various function
Reviewed by:	zlei
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D46598
2024-09-25 12:44:22 +02:00
Kristof Provost
4f9e688708 pf: merge pf_scrub_ip() and pf_scrub_ip6()
Merge pf_scrub_ip() and pf_scrub_ip6() into a single function.  Call
pf_scrub with the right arugments in the rule case so that match
rules will work as expected.

OK henning@

Obtained from:	OpenBSD, claudio <claudio@openbsd.org>, 48c45e6969
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D46597
2024-09-25 12:44:18 +02:00
Kajetan Staszkiewicz
6aeaadf68d pf tests: Remove nargs from single arguments
Using nargs=1 causes arguments to produce lists from which we must then
get the real value. The same applies to defaults, the must be provided
as arrays too.

Remove nargs=1 so that values and defaults can be accessed directly.

Reviewed by:	kp
Differential Revision:	https://reviews.freebsd.org/D46772
2024-09-25 12:43:27 +02:00
Joyu Liao
930a1e6f3d e1000: Delay safe_pause switch until SI_SUB_CLOCKS
Based on sysinit_sub_id, SI_SUB_CLOCKS is after SI_SUB_CONFIGURE.

SI_SUB_CONFIGURE  = 0x3800000,  /* Configure devices */  
At this stage, the variable “cold” will be set to 0.

SI_SUB_CLOCKS    = 0x4800000,  /* real-time and stat clocks*/
At this stage, the clock configuration will be done, and the real-time
clock can be used.

In the e1000 driver, if the API safe_pause_* are called between
SI_SUB_CONFIGURE and SI_SUB_CLOCKS stages, it will choose the wrong
clock source. The API safe_pause_* uses “cold” the value of which is
updated in SI_SUB_CONFIGURE, to decide if the real-time clock source is
ready. However, the real-time clock is not ready til the SI_SUB_CLOCKS
routines are done.

Obtained from:	Juniper Networks
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D42920
2024-09-25 02:37:37 -07:00
Igor Ostapenko
7b7e39221e pf tests: Speed up divert-to.sh test cases
Reviewed by:	kp
Approved by:	kp (mentor)
Differential Revision:	https://reviews.freebsd.org/D46671
2024-09-25 09:18:06 +00:00
Mark Johnston
c9c2452a25 unix tests: Skip random_eor_and_waitall unconditionally
This test always fails, I don't see any reason to make it conditional on
the "CI" test parameter.

There is at least one test bug here, we're using the wrong sysctl to
obtain the receive buffer size, but fixing that is not sufficient.

PR:		279354
Reviewed by:	glebius
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D46726
2024-09-25 07:44:14 -04:00
Navdeep Parhar
ee3da604dd cxgbe(4): Clobber all tracer state on stop and redo only traceq on restart.
Tracers have to be recreated after a restart but that's okay given that
they are used for debugging only.

MFC after:	1 week
Sponsored by:	Chelsio Communications
2024-09-24 16:52:22 -07:00
Bjoern A. Zeeb
5b8f97d8db usb: change LIST to SLIST to avoid LinuxKPI conflicts
In order to better integrate modern LinuxKPI USB this tries to reduce
a contention point of "LIST".  Given there is no need to use a LIST here
change it to SLIST to avoid conflicts.
It is a workaround which does not solve the actual problem (overlapping
namespaces) but it helps us a lot for now.

Sponsored by:	The FreeBSD Foundation
X-MFC?		unclear
Reviewed by:	emaste
Differential Revision: https://reviews.freebsd.org/D46534
2024-09-24 22:53:28 +00:00
Gleb Smirnoff
a00c3a94bf tcp: remove remnants of 20+ year old disabled code from d912c694ee
Fixes:	90ad2dc287
2024-09-24 14:36:10 -07:00
Bjoern A. Zeeb
e3b12ef6f7 Merge remote-tracking branch 'freebsd/vendor/Linux/rtw89'
Sponsored by:	The FreeBSD Foundation
2024-09-24 21:17:56 +00:00
Bjoern A. Zeeb
3c0de76f06 Merge remote-tracking branch 'freebsd/vendor/Linux/rtw88'
Sponsored by:	The FreeBSD Foundation
2024-09-24 21:17:45 +00:00
Bjoern A. Zeeb
c9f9342a48 Merge remote-tracking branch 'freebsd/vendor/Linux/mt76'
Sponsored by:	The FreeBSD Foundation
2024-09-24 21:17:31 +00:00
Bjoern A. Zeeb
bbd5885bfc Merge remote-tracking branch 'freebsd/vendor/Linux/iwlwifi'
Sponsored by:	The FreeBSD Foundation
2024-09-24 21:17:18 +00:00
Bjoern A. Zeeb
d8f6658c9a Merge remote-tracking branch 'freebsd/vendor/Linux/ath12k'
Sponsored by:	The FreeBSD Foundation
2024-09-24 21:17:04 +00:00
Bjoern A. Zeeb
182375d342 Merge remote-tracking branch 'freebsd/vendor/Linux/ath11k'
Sponsored by:	The FreeBSD Foundation
2024-09-24 21:16:49 +00:00
Bjoern A. Zeeb
114f709b08 Merge remote-tracking branch 'freebsd/vendor/Linux/ath10k'
Sponsored by:	The FreeBSD Foundation
2024-09-24 21:16:34 +00:00
Bjoern A. Zeeb
413c5e9082 Merge remote-tracking branch 'freebsd/vendor/Linux/ath-common'
Sponsored by:	The FreeBSD Foundation
2024-09-24 21:06:19 +00:00
Warner Losh
604919c47f loader: Fix 0 vs 1 confusion for column numbers
In two places we use '0' for a column number. However, the upper left
hand corner of the screen is 1, 1. Fix those two confusions. Also, fix
a comment that flipped the coordinates in a comment (I'm used to the
vt100 convention where it's row, column (eg y, x)) and didn't notice
the rest of the code uses x, y.

Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D46777
2024-09-24 14:18:42 -06:00
John Baldwin
1b3fa1ac36 nvmft: Defer datamove operations to a pool of taskqueue threads
Some block devices may request datamove operations from an ithread
context while holding locks.  Queue datamove operations to a taskqueue
backed by a thread pool to safely permit blocking allocations, etc. in
datamove handling.

Reviewed by:	asomers
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D46551
2024-09-24 16:16:11 -04:00
Ed Maste
3cf834d069 linuxulator: ignore AT_NO_AUTOMOUNT for all stat variants
Commit ff39d74aa9 ignored AT_NO_AUTOMOUNT for statx(), but did not
change fstat64() or newfstatat(), which also take an equivalent flags
argument.  Add a linux_to_bsd_stat_flags() helper and use it in all
three places.

PR:		281526
Reviewed by:	trasz
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D46711
2024-09-24 13:58:42 -04:00
Graham Percival
ce251baf42 ipf.5: revert C style(9) applied to man page
These changes were made by accident in:
    ipfilter: Adjust userland returns to conform to style(9)
    2582ae5740

That commit made similar mistakes in other man pages, but those have
already been fixed.

Signed-off-by:	Graham Percival <gperciva@tarsnap.com>
Reviewed by:	mhorne
Sponsored by:	Tarsnap Backup Inc.
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1433
2024-09-24 14:29:39 -03:00
Warner Losh
3fb656f8ef loader: Use printc instead of print to fit in 24,80
print automatically adds a newline, while printc does not. Use printc in
preference to print for managing the autoboot message. This means we can
use line 24 safely on a 24x80 terminal, restoring some functionality
that was lost in 101afbc6ee.

Note: we still set the default curosor position to 25,1 in screen.lua,
but real VT100s (and successors) will treat any row larger than the
pnumber of rows in a cursor motion command to be the last physical row
(this is so you can move to 9999,9999 and do a cursor location query to
get the size of the screen). Keeping that as is looks better on a
typical VGA console.

Fixes: 101afbc6ee
Sponsored by: Netflix
Reviewed by: kevans
Differential Revision:	https://reviews.freebsd.org/D46771
2024-09-24 10:57:11 -06:00