Commit graph

289292 commits

Author SHA1 Message Date
Minsoo Choo 6bd60e15b1 libc: Specify parameter types for function pointer
Reviewed by:	dab
MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D43726
2024-02-03 20:08:59 -05:00
Jessica Clarke 1e75e61d5c bsdinstall: Fix broken netconfig persistence for installed system
The replacement of echo >> with sysrc -f used sysrc key value, which
means "read variables key and value" and thus did nothing useful (and in
fact emitted errors to the log about neither existing). Instead use the
correct sysrc key=value form so the installed system comes back up with
working networking.

Fixes:	60b37735f3 ("bsdinstall netconfig: avoid duplicate entries in rc.conf")
2024-02-03 22:50:47 +00:00
Gleb Smirnoff d682c1eaa5 unix: synchronize shutdown(2) with read(2)
unp_dispose() is called on shutdown(2) and thus needs to acquire socket
I/O receive sx(9) to synchronize with read(2) that may read top of the
buffer without socket buffer mutex.  Notice in the last chunk of the diff
that the function used to be called with the lock already acquired in the
past.
2024-02-03 13:08:41 -08:00
Gleb Smirnoff ce69e37369 Revert "sockets: retire sorflush()"
Provide a comment in sorflush() why the socket I/O sx(9) lock is actually
important.

This reverts commit 507f87a799.
2024-02-03 13:08:41 -08:00
Mark Johnston 9ed713d97b cdefs: Introduce __result_use_or_ignore_check
Try to paper over inconsistent semantics for __warn_unused_result__
between clang and gcc.  See
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66425 for a spirited
discussion of these semantics.

Introduce __result_use_or_ignore_check, which allows callers to
explicitly ignore the return value with a cast to void.  Use that to
restore some checking for copyout() and friends, previously removed in
commit d07acc58d8 ("systm: Relax __result_use_check annotations").

Reviewed by:	olce, rpokala, kib, emaste
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D43426
2024-02-03 14:16:50 -05:00
Minsoo Choo f73124b077 ctfmerge: Remove function cast of strcompare() for qsort()
Reviewed by:	emaste
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D43715
2024-02-03 14:09:52 -05:00
Minsoo Choo f846c5b346 pmap: Reflect commit 1f1b228 in man page
Reviewed by:	mhorne
Fixes:		1f1b2286fd ("pmap: Convert boolean_t to bool.")
Differential Revision:	https://reviews.freebsd.org/D43722
2024-02-03 14:07:44 -05:00
Bjoern A. Zeeb 49619f7315 net80211: make sure calls to (*iv_update_bss)() are locked
It turned out thare various calls into (*iv_update_bss)(), that is
direct changes to vap->iv_bss in the old days, happened without
synchronisation.

Use locking assertions to document the requirement or status quo
at some callers given ic locking will eventually have to be dealt
with.

MFC after:	3 days
Reviewed by:	cc
Differential Revision: https://reviews.freebsd.org/D43512
2024-02-03 13:55:29 +00:00
Bjoern A. Zeeb 8a5a3e3d04 net80211: fix a NULL deref in ieee80211_sta_join1()
When ieee80211_sta_join1() gets an obss without ni_nt trying to lock
that will cause a NULL pointer deref.  Check for the table to be
valid and deal with the obss node accordingly.

This can happen if sta_newstate() calls ieee80211_reset_bss() for
nstate == INIT and ostate != INIT.  ieee80211_reset_bss() itself
calls ieee80211_node_table_reset() which calls node_reclaim()
which ends up in ieee80211_del_node_nt() which does remove the
node from the table and sets ni_table to NULL.
That node (former iv_bss) can then be returned as obss in the
(*iv_update_bss)() call in join1().

MFC after:	3 days
Reviewed by:	adrian, cc
Differential Revision: https://reviews.freebsd.org/D43469
2024-02-03 13:52:33 +00:00
Bjoern A. Zeeb 2d9d35837d LinuxKPI: implement memset_after()
memset_after() is needed by iwlwifi d3.c.

MFC after:	3 days
Reviewed by:	emaste
Differential Revision: https://reviews.freebsd.org/D43644
2024-02-03 13:50:32 +00:00
Bjoern A. Zeeb 8f7c32a41a iwlwifi: add the d3 (PM) bits to the Makefile (disabled)
Add the logic to conditionally enable PM for iwlwifi.
This should help suspend/resume in the future.
For now leave it disabled until other preconditional problems are
sorted.

Sponsored by:	The FreeBSD Foundation (2023)
MFC after:	3 days
Reviewed by:	cc
Differential Revision: https://reviews.freebsd.org/D43647
2024-02-03 13:48:27 +00:00
Bjoern A. Zeeb e1d31d0685 iwlwifi: adjust to make d3.c compile
struct iwl_mvm_wep_key_cmd ends in a variable sized array but later
is included in another struct followed by the actual
struct iwl_mvm_wep_key in d3.c.  Make the array[0] instead of []
to avoid the warning about it being a GNU-extension.
Also include string.h explicitly for memset_after().

MFC after:	3 days
Reviewed by:	cc
Differential Revision: https://reviews.freebsd.org/D43647
2024-02-03 13:47:34 +00:00
Bjoern A. Zeeb 2f029bf911 LinuxKPI: 802.11: extend ieee80211_key_seq and WLAN_KEY_LEN_* defines
For iwlwifi(4) d3.c we need another struct in struct ieee80211_key_seq
and related WLAN_KEY_LEN_* defines in.

MFC after:	3 days
Reviewed by:	cc, emaste
Differential Revision: https://reviews.freebsd.org/D43646
2024-02-03 13:31:50 +00:00
Bjoern A. Zeeb 828ce22f07 LinuxKPI: 802.11: fix field order in ieee80211_key_conf
When adding the new field link_id to struct ieee80211_key_conf, it
was erroneously placed at the end of the struct;  the zero-length
(variable sized) array for the key always needs to stay last.
Resort fields and add hopefully helpful comment to avoid the problem
in the future.

Fixes:		adff403fe7
MFC after:	3 days
Reviewed by:	cc
Differential Revision: https://reviews.freebsd.org/D43635
2024-02-03 13:28:25 +00:00
Emmanuel Vadot b6e9a7a2e2 Reapply "pkgbase: Create a FreeBSD-dtb package"
This reverts commit 9bbe06b004.

Before that dtbs where included in each kernel packages which prevents
us to install multiple kernels.

Fix mtree-to-plist.awk to only generate a dtb.plist when we create
the kernel one (because dtb are installed during make installkernel).

Sponsored by:   Beckhoff Automation GmbH & Co. KG
2024-02-03 09:49:12 +01:00
Gleb Smirnoff 70f5c6e34f tests/netinet: push variable 'sin' into function scope
This should fix build with GCC 13.

Fixes:	861274c9f8
2024-02-02 21:09:02 -08:00
Elyes Haouas c1f6704bf8 ipf: Fix some typos
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
2024-02-02 21:36:27 -07:00
Alexander Ziaee 7bd6cbbf69 vt.4: explain console fonts
Add explaination about console fonts, how to convert them, which subset
of things support them and how to use them.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1063
2024-02-02 21:21:45 -07:00
Andrew Turner 78cc457123 .github: Enable manually running github actions
Sponsored by:	Arm Ltd

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/878
2024-02-02 21:05:49 -07:00
Andrew Turner f81301744e .github: Build stable/14
Sponsored by:	Arm Ltd

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/878
2024-02-02 21:05:49 -07:00
Martin Oliveira 4309f9f234 include/math.h: fix warning with -Wconversion
The way the __fp_type_select macro uses the _Generic expression causes
gcc to throw a warning on valid code if the -Wconversion flag is used.

For example, consider the following program:

    #include <math.h>
    int main()
    {
    	double x = 1.0;
    	isnan(x);
    	return 0;
    }

which throws a warning:

    $ gcc -Wconversion a.c
    a.c:5:15: warning: conversion from 'double' to 'float' may change value [-Wfloat-conversion]
        5 |         isnan(x);
          |               ^

This happens because the functions are invoked inside of the _Generic.
Looking at the example of _Generic in the C11 specification, one sees
that the parameters are outside of the _Generic expression (see page 79
here: https://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf).

Reference: https://stackoverflow.com/a/68309379
Signed-off-by: Martin Oliveira <martin.oliveira@eideticom.com>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/841
2024-02-02 21:05:49 -07:00
Jose Luis Duran ef35e5eaee release: Add the Ed25519 vagrant insecure key
Both insecure keys, RSA and Ed25519, are required.

Obtained from:	b40f6e5fda
Reviewed by:	imp
Pull Request:	https://github.com/freebsd/freebsd-src/pull/835
2024-02-02 21:05:49 -07:00
Jose Luis Duran 0fa637ffee release: Allow sudo -g anyone and sudo -u anyone -g anytwo
When only the user (ALL) is specified explicitly, and the group is
implied, only sudo -u works.  Specifying both the user and group, like
(ALL:ALL), is required to:

1. Use sudo -g by itself (with no -u user)
2. Use sudo -u and -g together, with a -g group that is different from
   the -u user's primary group

Obtained from:	1d13533ea3
Reviewed by:	imp
Pull Request:	https://github.com/freebsd/freebsd-src/pull/835
2024-02-02 21:05:49 -07:00
Graham Perrin 521013e7e8 urndis(4): retrospective, address for hselasky
PR:		273530
Fixes:		08c9016bc6 Add a manpage for the urndis driver.
Signed-off-by:	Graham Perrin <grahamperrin@gmail.com>
Reviewed-by:	imp, zlei
Pull-request:	https://github.com/freebsd/freebsd-src/pull/834
2024-02-02 21:05:26 -07:00
Jose Luis Duran 864780bca0 traceroute: Remove $FreeBSD$ rcsid tags
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/901
2024-02-02 20:14:09 -07:00
Jose Luis Duran 5eb1aebf8d traceroute: Lint manuals
Fix a number of warning mandoc -Tlint and igor turned up.  No changes
intended.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/901
2024-02-02 20:14:09 -07:00
Jose Luis Duran ba09352b73 traceroute: Standardize usage
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/901
2024-02-02 20:14:09 -07:00
Jose Luis Duran 00aa635337 traceroute: Update values in examples
Standardize the documentation and update it to reflect the current
values.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/901
2024-02-02 20:14:09 -07:00
Jose Luis Duran af87ba6522 traceroute: Silence compiler warning
Silence the warning:

argument to 'sizeof' in 'strncpy' call is the same expression as the
source; did you mean to use the size of the destination?"

by using strlcpy() and the size of the destination (device).

No functional change intended.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/901
2024-02-02 20:14:09 -07:00
Jessica Clarke 7414d14bd5 bsdinstall: Drop Error from title in netconfig no interfaces dialog
This isn't inherently an error. It is if you're attempting to download
dist tarballs or later install packages, but a FreeBSD system with no
NIC is a reasonable setup to have, especially in a throwaway VM setting,
so we shouldn't say it is one.

Leaving the exit code as 1 is still fine, since auto will ignore it, and
avoids breaking other uses.

MFC after:	1 week
2024-02-03 01:52:53 +00:00
Jessica Clarke b809c7d6a2 bsdinstall: Fix netconfig script when no interfaces are present
The script uses [ -z "$INTERFACES" ] to check if the list of interfaces
is empty and will exit early if so, but INTERFACES always contains at
least a space due to the way it appends the list of wireless devices.
Fix this by only adding the space when there are devices to append,
mirroring the behaviour for non-wireless devices above (both will result
in a redundant leading space when the list is non-empty, but that one is
harmless).

Fixes:		159ca5c844 ("Adapt to new wireless scheme where base wlan interfaces do not show up in ifconfig anymore.")
MFC after:	1 week
2024-02-03 01:52:37 +00:00
rilysh fb3dc55a5c lib/libfetch/common.c: remove an extra semicolon
Signed-off-by: rilysh <nightquick@proton.me>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/959
2024-02-02 18:35:02 -07:00
rilysh b139f2ee99 lib/libbe/be.c: remove an extra semicolon
Signed-off-by: rilysh <nightquick@proton.me>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/959
2024-02-02 18:35:02 -07:00
rilysh e9b261f297 lib/libvgl/main.c: remove an extra semicolon
Signed-off-by: rilysh <nightquick@proton.me>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/959
2024-02-02 18:35:01 -07:00
rilysh cba889e63c sys/arm64/rockchip/rk_gpio.c: remove an extra semicolon
Signed-off-by: rilysh <nightquick@proton.me>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/959
2024-02-02 18:35:01 -07:00
rilysh 2d146764cd sys/netlink/route/iface.c: remove an extra semicolon
Signed-off-by: rilysh <nightquick@proton.me>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/959
2024-02-02 18:35:01 -07:00
rilysh 552581e75d sys/fs/unionfs/union_vnops.c: remove an extra semicolon
Signed-off-by: rilysh <nightquick@proton.me>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/959
2024-02-02 18:35:01 -07:00
rilysh 3221c44d80 sys/compat/linux/linux_misc.c: remove an extra semicolon
Signed-off-by: rilysh <nightquick@proton.me>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/959
2024-02-02 18:35:01 -07:00
rilysh 11ff3552fd sys/netpfil/pf/pf.c: remove an extra semicolon
Signed-off-by: rilysh <nightquick@proton.me>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/959
2024-02-02 18:35:01 -07:00
rilysh c07087988b sys/netpfil/pf/pf.c: remove an extra semicolon
Signed-off-by: rilysh <nightquick@proton.me>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/959
2024-02-02 18:35:01 -07:00
rilysh f830db48c1 sys/dev/enic/if_enic.c: remove an extra semicolon
Signed-off-by: rilysh <nightquick@proton.me>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/959
2024-02-02 18:35:01 -07:00
rilysh abd9758fe2 sys/dev/mii/mcommphy.c: remove an extra semicolon
Signed-off-by: rilysh <nightquick@proton.me>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/959
2024-02-02 18:35:00 -07:00
rilysh f61554272c sys/dev/iicbus/pmic/rockchip/rk8xx.c: remove an extra semicolon
Signed-off-by: rilysh <nightquick@proton.me>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/959
2024-02-02 18:35:00 -07:00
Jose Luis Duran 44bb80b0ad qlnx: Fix typo (triple M)
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/963
2024-02-02 18:35:00 -07:00
Jose Luis Duran 328df6da9e ath: Fix typo (triple M)
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/963
2024-02-02 18:35:00 -07:00
Jose Luis Duran 05ad376bfc libc: Fix typo (triple M)
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/963
2024-02-02 18:35:00 -07:00
Mina Galić ce348fe5cf amd64 & i386: enable VIMAGE in MINIMAL
VNET(9) is very useful, and is not loadable.
Enable it in MINIMAL.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/962
2024-02-02 18:35:00 -07:00
Ricardo Branco 840a802750 umount: Add -d option to detach md devices
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/972
2024-02-02 18:35:00 -07:00
Lexi Winter 5590bacaaf sctp: update manpages
Add missing documentation for sctp_sendv(3) and sctp_recvv(3).

Add a note that sctp_send(3), sctp_sendx(3) and sctp_recvmsg(3) are
deprecated by RFC 6458.

Add a STANDARDS section to all functions specified in RFC 6458 to
indicate their standards conformance.

MFC after:	2 weeks
Reviewed by: imp, bcr, kp, tuexen
Pull Request: https://github.com/freebsd/freebsd-src/pull/965
2024-02-02 18:35:00 -07:00
Ricardo Branco b75fa3a2de procfs: Add self & exe symlinks like NetBSD does
NetBSD calls "curproc" "self" and "exe" "file" for proc. Reduce
gratuitous differnces by including them as well.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/976
2024-02-02 18:34:59 -07:00