Commit Graph

292511 Commits

Author SHA1 Message Date
Simon J. Gerraty
8d5c8e21c6 Merge bmake-20240625
Merge commit 'dbb5be7f07456d02ce444484c683b130439acb45'
2024-06-28 17:22:11 -07:00
Simon J. Gerraty
dbb5be7f07 Import bmake-20240625
Intersting/relevant changes since bmake-20240520

ChangeLog since bmake-20240520

2024-06-25  Simon J Gerraty  <sjg@beast.crufty.net>

	* VERSION (_MAKE_VERSION): 20240625
	Merge with NetBSD make, pick up
	o job.c: ensure shellPath is always duped, avoid upsetting free()

2024-06-16  Simon J Gerraty  <sjg@beast.crufty.net>

	* VERSION (_MAKE_VERSION): 20240616
	Merge with NetBSD make, pick up
	o clean up collection of context information for error messages
	o in warnings, move the word "warning" to the front
	o var.c: throw an error on attempt to override an internal
	read-only variable

2024-06-10  Simon J Gerraty  <sjg@beast.crufty.net>

	* VERSION (_MAKE_VERSION): 20240610
	Merge with NetBSD make, pick up
	o for.c: remove redundant shortcut for building the .for loop body

2024-06-02  Simon J Gerraty  <sjg@beast.crufty.net>

	* VERSION (_MAKE_VERSION): 20240602
	Merge with NetBSD make, pick up
	o rename some VarEvalMode constants to better match debug names.
	o var.c: avoid out-of-bounds read when parsing indirect modifiers.

2024-06-01  Simon J Gerraty  <sjg@beast.crufty.net>

	* VERSION (_MAKE_VERSION): 20240601
	Merge with NetBSD make, pick up
	o add .export-all rather than allow .export with no argument
	which can happen accidentally.
	o if lua is available, run check-expect.lua after unit-tests
	o main.c: use snprintf rather than strncpy
	fix memory leak when purging realpath cache.

2024-05-28  Simon J Gerraty  <sjg@beast.crufty.net>

	* VERSION (_MAKE_VERSION): 20240528
	Merge with NetBSD make, pick up
	o fix a number of memory leaks
	o replace magic numbers with POSIX FILENO constants
	o hash.c: remove dead code from HashTable_DeleteEntry
	o main.c: when complaining about unusable .OBJDIR
	call PrintOnError if MAKE_DEBUG_OBJDIR_CHECK_WRITABLE is true.
	o parse.c: use fewer technical terms in debug message for dependency

mk/ChangeLog since bmake-20240520

2024-06-22  Simon J Gerraty  <sjg@beast.crufty.net>

	* install-mk (MK_VERSION): 20240616

	* dirdeps.mk: apply DEP_DIRDEPS_BUILD_DIR_FILTER after we have
	computed build dirs, since some filters cannot be easily expressed via
	DEP_DIRDEPS_FILTER.

2024-05-31  Simon J Gerraty  <sjg@beast.crufty.net>

	* dirdeps.mk: move reset of DIRDEPS_EXPORT_VARS
	until after we a finished with it if building a cache.
2024-06-28 17:16:32 -07:00
Colin Percival
59c21ed6e8 release: Bump default VM size for riscv64 to 6 GB
Due to issues with the riscv64 toolchain, some binaries end up
significantly larger on riscv64 than they should be.  This results
in riscv64 VM images -- and at present *only* riscv64 images -- not
fitting within the default 5 GB filesystem size.

Bump the default size for riscv64 to 6 GB until the toolchain issues
can be resolved.

MFC after:	1 week
Sponsored by:	Amazon
2024-06-28 15:47:11 -07:00
Ed Maste
5654b42142 libusb: claim to be version 1.0.16
We are not 100% compatible with 1.0.16, but implement some
functionality from that version that is required by certain ports.

PR:		277799
PR:		279555 (exp-run)
Event:		Kitchener-Waterloo Hackathon 202406
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D45514
2024-06-28 12:18:34 -04:00
Sebastian Huber
fc3e5334ab Fix "%hhi" conversion for kvprintf()
The signedness of "char" is implementation-dependent.

Reviewed by: imp,zlei,nightquick@proton.me
Pull Request: https://github.com/freebsd/freebsd-src/pull/1290
2024-06-28 08:57:39 -06:00
wy-chung
2eb64df7f5 riscv: remove a redundant check on PGA_WRITEABLE
This is achieved by the preceding call to pmap_page_is_write_mapped().
It appears the second check and comment were left mistakenly when the
intent was to remove them.

Reviewed by:	mhorne
MFC after:	1 week
Fixes:	638f867814 ("(6/6) Convert pmap to expect busy in write... ")
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1304
2024-06-28 11:10:57 -03:00
Mariusz Zaborski
d3bb35d4e5 jail: allow adjustment of host time
Add a special permission to the jail to adjust and to set the host time.
This can be useful if we want to compartmentalize the NTP daemon
from the rest of the system.

Reviewed by:	olce, imp
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D45545
2024-06-28 12:23:31 +02:00
Zhenlei Huang
aa3860851b net: Remove unneeded NULL check for the allocated ifnet
Change 4787572d05 made if_alloc_domain() never fail, then also do the
wrappers if_alloc(), if_alloc_dev(), and if_gethandle().

No functional change intended.

Reviewed by:	kp, imp, glebius, stevek
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D45740
2024-06-28 18:16:29 +08:00
Ryan Libby
0d8da0df41 tcp_rack: avoid gcc -Werror=pointer-to-int-cast on 32-bit arch
Reviewed by:	tuexen
Differential Revision:	https://reviews.freebsd.org/D45752
2024-06-27 20:40:12 -07:00
Ryan Libby
c02a8caf50 tcp_bbr: avoid gcc -Werror=pointer-to-int-cast on 32-bit arch
Reviewed by:	tuexen
Differential Revision:	https://reviews.freebsd.org/D45751
2024-06-27 20:37:26 -07:00
Ahmad Khalifa
ab08da5328 loader: Increase buffer size to accommodate longer commands
The longest command we have is "efi-autoresizecons". That combined with
the two spaces before and after the command gives us a total of 23
characters including the null-terminator.

Also move the two trailing spaces to their own pager_output call so they
don't get truncated if the command is too long and increase the minimum
string length to 20 in order to fix alignment issues caused by the
increased buffer size.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1277
2024-06-27 18:40:15 -06:00
Alexander Ziaee
cf9c4b32cc RELNOTES: mention moving filesystems to section 4
Fixes:		1687d7 (move filesystems to s4)
Reported by:	mhorne
Reviewed by:	imp, mhorne
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1289
2024-06-27 18:37:20 -06:00
Alexander Ziaee
a85d870007 man.sh: revert trapping SIGPIPE
PR:		279542
Fixes:		14a5c1068d
Reported by:	emaste
Reviewed by: imp, emaste, jilles
Pull Request: https://github.com/freebsd/freebsd-src/pull/1283
2024-06-27 18:34:33 -06:00
Alexander Ziaee
088cc7d221 man filesystems: fix more xrefs after move to s4
Fixes: 1a720cbec5
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1282
2024-06-27 18:32:05 -06:00
Alexander Ziaee
cfe55a8af8 fwget.8: polish
MFC after:	3 days
Reviewed by:	imp
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1269
2024-06-27 18:28:32 -06:00
Mitchell Horne
32d2a1de3d arm64: correct physmap bounds in pmap_bootstrap()
physmap_idx now contains the raw value; we should not multiply it.

Reviewed by:	markj
Fixes:	d03e1ffbea ("arm64: Remove some redundant calculations...")
2024-06-27 16:32:44 -03:00
Doug Moore
995730a635 swap_pager: cleanup swapoff_object
Function swap_pager_swapoff_object calls vm_pager_unswapped (via
swp_pager_force_dirty) for every page that must be unswapped. That
means that there's an unneeded check for lock ownership (the caller
always owns it), a needless PCTRIE_LOOKUP (the caller has already
found it), a call to free one page of swap space only, and a check to
see if all blocks are empty, when the caller usually knows that the
check is useless.

Isolate the essential part, needed however swap_pager_unswapped is
invoked, into a smaller function swap_pager_unswapped_acct.  From
swapoff_object, invoke swp_pager_update_freerange for each appropriate
page, so that there are potentially fewer calls to
swp_pager_freeswapspace.  Consider freeing a set of blocks (a struct
swblk) only after having invalidated all those blocks.

Replace the doubly-nested loops with a single loop, and refetch and
rescan a swblk only when the object write lock has been released and
reacquired.

After getting a page from swap, dirty it immediately to address a race
condition observed by @kib.

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D45668
2024-06-27 14:06:09 -05:00
Michael Tuexen
14fee5324a tcp: improve failure handling in tcp_newtcpcb()
In case of a failure of tcp_newtcpcb, where NULL is returned,
* call CC_ALGO(tp)->cb_destroy, after CC_ALGO(tp)->cb_init was called.
* call khelp_destroy_osd(), after khelp_init_osd() was called.

Reviewed by:		glebius, rscheff
MFC after:		1 week
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D45753
2024-06-27 08:26:34 +02:00
Mitchell Horne
a35f665109 if_genet: don't load DMA mapping when tx_queue is full
gen_encap() always calls bus_dmamap_load_mbuf_sg() into 'map' (which is
the current tx_queue). If the tx_queue is full, it will load with a
'map' that already has a currently active mapping. This violates the
busdma(9) KPI.

Checking for a full queue and returning ENOBUFS will allow
gen_start_locked() to set the IFF_DRV_OACTIVE faster without having to
needlessly check if the mbuf will fit (it won't).

PR:		256482
Reviewed by:	mhorne
MFC after:	1 week
Submitted by:	ghuckriede@blackberry.com
2024-06-27 14:44:36 -03:00
Michael Tuexen
3703e1a73e tcp: improve error handling in syncache_socket()
If syncache_socket() fails after calling tcp_newtcpcb(), the resources
allocated in tcp_newtcpcb() needs to be freed. Just call
tcp_discardcb() to do this.
Thanks to jtl for making me aware of the issue and proposing a fix.
Reviewed by:		glebius, jtl, rscheff
MFC after:		1 week
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D45749
2024-06-27 07:25:15 +02:00
Alexander Ziaee
18a27dd641 wpa_cli.8: describe better + tag spdx + linter nit
"how do I switch active wifi network on console"
"% apropos wifi"

MFC after:	3 days
Reviewed by:	mhorne, imp
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1299
2024-06-27 11:55:41 -03:00
Alexander Motin
87085c12ba Fix SATA NCQ error recovery after 25375b1415
Since that commit ahci(4), siis(4) and mvs(4) drivers ended up
using wrong command to fetch error information for NCQ commands.
Since ATA errors are not very informative to begin with, the only
noticeable effect is a lack of retries on those errors by CAM.

MFC after:	1 week
PR:		279978
2024-06-27 09:29:23 -04:00
Andriy Gapon
a743e280ea rk_i2c: use the register read mode even if the read ends with IIC_M_NOSTOP
Tested with max44009(4).

MFC after:	2 weeks
2024-06-27 13:32:47 +03:00
Andriy Gapon
0deaf4be34 rk_i2c: emulate repeated start
rk_i2c_send_stop is modified so that it sends a stop condition, like it
always did, if there is no IIC_M_NOSTOP flag.
But if the flag is set then the function completely resets the control
register and sets the driver state to transfer completed.
Something like this was previously done for a write with IIC_M_NOSTOP.
Now it is done for a read with IIC_M_NOSTOP as well.

Linux code says that the hardware does not support the repeated start
condition and the documentation, indeed, does not mention it.
But according to the Linux driver clearing the control register and then
sending a start condition acts as if it were a repeated start.

While here, add braces around a single-line 'if' branch to balance it
with a multi-line 'else' branch.

Tested with max44009(4).

MFC after:	2 weeks
2024-06-27 13:32:15 +03:00
Baptiste Daroussin
cde6642431 nuageinit: check for both user_data and user-data
openstack, ec2 and other implementation of cloudinit disagrees on the
name of the file "user-data" or "user_data", test both and use the first
found

PR:	279876
2024-06-27 10:32:14 +02:00
Zhenlei Huang
ef4f4a44d9 ifnet: Restore curvnet earlier
This improves readability a little. As a side effect, a redundant
CURVNET_RESTORE is removed.

No functional change intended.

Reviewed by:	glebius
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45595
2024-06-27 12:38:04 +08:00
Ryan Libby
b195d7498b nvme: avoid gcc -Werror=int-to-pointer-cast on 32-bit arch
Reviewed by:	chuck (previous version), imp
Differential Revision:	https://reviews.freebsd.org/D45750
2024-06-26 20:50:04 -07:00
Enji Cooper
303596eac3 Update config/build info for OpenSSL
This is a companion commit to the OpenSSL 3.0.14 update.

MFC after:      3 days
MFC with:       44096ebd22
2024-06-26 16:51:25 -07:00
Enji Cooper
44096ebd22 Update to OpenSSL 3.0.14
This release resolves 3 upstream found CVEs:
- Fixed potential use after free after SSL_free_buffers() is called (CVE-2024-4741)
- Fixed an issue where checking excessively long DSA keys or parameters may be very slow (CVE-2024-4603)
- Fixed unbounded memory growth with session handling in TLSv1.3 (CVE-2024-2511)

MFC after:	3 days
Merge commit '1070e7dca8223387baf5155524b28f62bfe7da3c'
2024-06-26 16:50:13 -07:00
Vladimir Kondratyev
8c5c572125 LinuxKPI: Add DEFINE_DEBUGFS_ATTRIBUTE_SIGNED to linux/debugfs.h
Sponsored by:	Serenity CyberSecurity, LLC
MFC after:	1 week
Reviewed by:	manu
Differential Revision:	https://reviews.freebsd.org/D45615
2024-06-26 23:51:34 +03:00
Vladimir Kondratyev
e1b0f431a1 LinuxKPI: Remove vmas argument from get_user_pages on KPI layer
To chase Linux kernel 6.5

Sponsored by:	Serenity CyberSecurity, LLC
MFC after:	1 week
Reviewed by:	manu, emaste
Differential Revision:	https://reviews.freebsd.org/D45614
2024-06-26 23:51:04 +03:00
Vladimir Kondratyev
889f74af66 LinuxKPI: Add linux/nodemask.h
and dummy num_possible_nodes() implementation.
We do not fully support NUMA in LinuxKPI yet.

Sponsored by:	Serenity CyberSecurity, LLC
MFC after:	1 week
Reviewed by:	manu, bz
Differential Revision:	https://reviews.freebsd.org/D45613
2024-06-26 23:49:52 +03:00
Vladimir Kondratyev
256eb8d536 LinuxKPI: Remove linux/sched.h include from linux/kernel.h header
This include prevents usage of any kernel.h helpers in sched.h and
all of dependencies. Linux does not have it too.
Fix building of kernel and drm-kmod after than.

Sponsored by:	Serenity CyberSecurity, LLC
MFC after:	1 week
Reviewed by:	manu, bz
Differential Revision:	https://reviews.freebsd.org/D45692
2024-06-26 23:47:12 +03:00
Vladimir Kondratyev
d21316ff22 LinuxKPI: Add header polution to compile linux/numa.h
Sponsored by:	Serenity CyberSecurity, LLC
MFC after:	1 week
Reviewed by:	manu, bz, emaste
Differential Revision:	https://reviews.freebsd.org/D45612
2024-06-26 23:44:56 +03:00
Vladimir Kondratyev
597ffdc1d3 LinuxKPI: Add smp_store_release and smp_load_acquire functions
Sponsored by:	Serenity Cyber Security, LLC
MFC after:	1 week
Reviewed by:	manu
Differential Revision:	https://reviews.freebsd.org/D45611
2024-06-26 23:44:37 +03:00
Vladimir Kondratyev
460908ea55 LinuxKPI: Remove owner argument from class_create function on KPI layer
to chase Linux 6.4

Sponsored by:	Serenity Cyber Security, LLC
MFC after:	1 week
Reviewed by:	manu, emaste
Differential Revision:	https://reviews.freebsd.org/D45610
2024-06-26 23:44:12 +03:00
Vladimir Kondratyev
73f3589120 LinuxKPI: Add kmap_local_page function
kmap_local_page maps a page for temporary usage

Sponsored by:	Serenity CyberSecurity, LLC
MFC after:	1 week
Reviewed by:	manu
Differential Revision:	https://reviews.freebsd.org/D45609
2024-06-26 23:43:43 +03:00
Vladimir Kondratyev
a5cac2e672 LinuxKPI: Add rb_add_cached function
rb_add_cached inserts node into the leftmost cached tree

Sponsored by:	Serenity CyberSecurity, LLC
MFC after:	1 week
Reviewed by:	manu
Differential Revision:	https://reviews.freebsd.org/D45608
2024-06-26 23:43:16 +03:00
Vladimir Kondratyev
249e24d76a x86/pci_early_quirks: Sync Intel 11th+ gen PCI IDs with Linux
Sponsored by:	Serenity Cyber Security, LLC
MFC after:	1 week
Reviewed by:	manu, imp
Differential Revision:	https://reviews.freebsd.org/D45617
2024-06-26 23:42:25 +03:00
Warner Losh
0c00c3d75b test: Change bug number
There was already a bug on this, so change to old bug

PR: 279354
Sponsored by:		Netflix
2024-06-26 09:18:50 -06:00
Mitchell Horne
609cdb12b9 ofw: convert boolean_t to bool
Most of these already treat it as a proper bool, i.e. using true/false.
Also fix-up callers of OF_install().

No functional change intended.

Reviewed by:	andrew, emaste
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D45733
2024-06-26 11:14:36 -03:00
Zhenlei Huang
2cb7605a24 lo: Use new KPI to create the first loop interface
While here remove a pointless static local variable lo_cloner.

No functional change intended.

Reviewed by:	kp
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45728
2024-06-26 18:00:37 +08:00
Doug Moore
8502c68d29 x86_iommu: use roundup_pow_of_two
Drop a private implementation of roundup_pow_of_two and use the global
one instead.

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D45739
2024-06-26 04:23:54 -05:00
Andrew Turner
5afc347944 arm: Start to remove the now unneeded acle-compat.h
All supported compilers provide the acle macros so we don't need the
backup versions.

Keep the file around for anything that included it directly, but make
it an error to not support the acle macros.

Reviewed by:	imp
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D45726
2024-06-26 08:52:08 +00:00
Doug Moore
7d37fcbf52 cxgbe: replace a loop with rounddown_pow_of_two
Replace a loop with a function call.

Reviewed by:	np, alc
Differential Revision:	https://reviews.freebsd.org/D45716
2024-06-26 03:19:16 -05:00
Konstantin Belousov
7e5574f9e5 sched_unpin(): assert that curthread was pinned
Reviewed by:	emaste, imp, markj, olce
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D45736
2024-06-26 10:04:10 +03:00
Warner Losh
b2351a4ba5 test: disable sys.kern.unix_seqpacket_test.random_eor_and_waitall
It's been failing for a while, at least some of the time.

PR: 279994
Sponsored by:		Netflix
2024-06-25 19:35:13 -06:00
Kyle Evans
3da568710f stand: module: unlink the entire tail when dependencies fail to load
Assume you have loader configured to load linux64, which has a
dependency on both linux_common and mqueuefs but neither the kernel
nor kernel config in question have the mqueuefs module included.

When the load command for linux64 fails to find mqueuefs, it will
free both linux64 and linux_common as they were loaded first, but only
linux64 gets removed from the module list.  As a result, future
traversals hit an easy use-after-free with linux_common.

Fix it so that we unlink the entire tail of the list.  Anything after
the initially loaded module is, by definition, a dependency on the
loaded module while we're still in the load command, so we can just
discard the entire tail.  If linux_common were loaded before linux64, it
should not move to a position during this load where it would suddenly
be missing from the view presented to the kernel.

Reported by:	philip
Reviewed by:	imp, philip, tsoome
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D45731
2024-06-25 15:32:08 -05:00
Mark Johnston
7d6932d20a ctladm: Fix a race when loading ctl.ko
If multiple ctladm processes try to load ctl.ko at the same time, only
one will succeed.  Handle this possibility by retrying the operation
(open /dev/cam/ctl) if kldload returns EEXIST, rather than bailing.
This at least helps ensure that ctladm tests can be run in parallel
when ctl.ko is not preloaded.

Reviewed by:	asomers
MFC after:	1 week
2024-06-25 15:29:03 -04:00
Ryan Libby
f29bdea047 ext4_ext_tree_init: correct memset initialization
gcc -Wmemset-elt-size diagnosed this.  The code was only initializing
1/4 of the array.  However, it was actually harmless, as the only caller
had done an M_ZERO allocation anyway.

Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D45701
2024-06-25 10:41:11 -07:00