Find a file
Bjoern A. Zeeb a7e1fc7f62 net80211: deal with lost state transitions
Since 5efea30f03 we can possibly lose a state transition which can
cause trouble further down the road.
The reproducer from 643d6dce6c can trigger these for example.
Drivers for firmware based wireless cards have worked around some of
this (and other) problems in the past.

Add an array of tasks rather than a single one as we would simply
get npending > 1 and lose order with other tasks.  Try to keep state
changes updated as queued in case we end up with more than one at a
time.  While this is not ideal either (call it a hack) it will sort
the problem for now.
We will queue in ieee80211_new_state_locked() and do checks there
and dequeue in ieee80211_newstate_cb().
If we still overrun the (currently) 8 slots we will drop the state
change rather than overwrite the last one.
When dequeing we will update iv_nstate and keep it around for historic
reasons for the moment.

The longer term we should make the callers of
ieee80211_new_state[_locked]() actually use the returned errors
and act appropriately but that will touch a lot more places and
drivers (possibly incl. changed behaviour for ioctls).

rtwn(4) and rum(4) should probably be revisted and net80211 internals
removed (for rum(4) at least the current logic still seems prone to
races).

PR:		271979, 271988, 275255, 263613, 274003
Sponsored by:	The FreeBSD Foundation (in 2023)
Reviewed by:	cc
Differential Revision: https://reviews.freebsd.org/D43389

(cherry picked from commit 713db49d06)

Given this changes the internal structure of 'struct ieee80211vap',
which gets allocated by the drivers, and we do not have enough
spares, all wireless drivers need to be recompiled.
Given we are forced to do the update, we leave fields in the middle
of the struct and add more spares at the same time.
__FreeBSD_version gets updated to 1303501 to be able to detect
this change.

(cherry picked from commit a890a3a5dd)
2024-02-19 08:02:01 +00:00
.cirrus-ci Cirrus-CI: add some timing info on pkg install failure 2022-02-09 12:39:50 -05:00
.github/workflows .github: Attempt to fix and increase robustness of macOS action 2023-02-22 12:47:12 -08:00
bin hostname(1): Add test cases 2024-02-08 14:03:49 +08:00
cddl zfsd: fault disks that generate too many I/O delay events 2024-01-19 13:16:48 -07:00
contrib wpa: ctrl_iface set sendbuf size 2024-02-19 08:01:59 +00:00
crypto heimdal: Fix man page and documentation typos 2024-01-15 02:02:29 -08:00
etc hostname(1): Add test cases 2024-02-08 14:03:49 +08:00
gnu Remove $FreeBSD$: one-line sh pattern 2023-08-23 11:43:30 -06:00
include Add kcmp(2) userspace bits 2024-02-11 03:40:29 +02:00
kerberos5 Remove $FreeBSD$: one-line sh pattern 2023-08-23 11:43:30 -06:00
lib libbe: Avoid double printing cloning errors. 2024-02-18 20:02:58 -07:00
libexec leapseconds: Update to the canonical place. 2024-02-07 22:15:47 -07:00
release arm64/RPI: enable powerd by default on arm64-aarch64-RPI images 2024-01-30 14:10:56 -06:00
rescue rescue: include ping iff at least one of INET & INET6 is enabled 2023-09-24 11:48:33 -04:00
sbin net80211: adjust more VHT structures/fields 2024-02-19 08:02:00 +00:00
secure caroot: routine update 2024-02-13 13:15:13 -06:00
share hidraw(4): Implement HIDRAW_GET_DEVICEINFO ioctl 2024-02-09 23:59:37 +03:00
stand loader: For EFI, if we don't have ConOut, try ConIn 2024-02-06 17:12:40 -07:00
sys net80211: deal with lost state transitions 2024-02-19 08:02:01 +00:00
targets Merge llvm-project main llvmorg-17-init-19304-gd0b54bb50e51 2024-01-08 00:04:38 +01:00
tests fusefs: fix invalid value for st_birthtime.tv_nsec 2024-02-12 11:02:50 -07:00
tools tools/net80211: add mlme_assoc 2024-02-19 08:01:59 +00:00
usr.bin Remove usr.bin/clang/llvm-ar/llvm-cxxfilt-driver.cpp file 2024-02-13 18:51:53 +01:00
usr.sbin efibootmgr: fix potential endless loop with -v 2024-02-17 21:22:08 +02:00
.arcconfig arcconfig: add callsign again 2020-11-23 04:39:29 +00:00
.arclint arc lint: ignore /tests/ in chmod 2017-12-19 03:38:06 +00:00
.cirrus.yml Remove $FreeBSD$: one-line sh pattern 2023-08-23 11:43:30 -06:00
.clang-format Remove $FreeBSD$: one-line sh pattern 2023-08-23 11:43:30 -06:00
.gitattributes Add a basic clang-format configuration file 2019-06-07 15:23:52 +00:00
.gitignore gitignore: whack dead architectures 2023-08-06 21:05:36 +02:00
COPYRIGHT copyrights: Happy New Year 2021 2020-12-31 10:29:44 -05:00
LOCKS Remove $FreeBSD$: one-line bare tag 2023-08-23 11:43:33 -06:00
MAINTAINERS Remove $FreeBSD$: one-line bare tag 2023-08-23 11:43:33 -06:00
Makefile Remove $FreeBSD$: one-line sh pattern 2023-08-23 11:43:30 -06:00
Makefile.inc1 Merge llvm-project main llvmorg-17-init-19304-gd0b54bb50e51 2024-01-08 00:04:38 +01:00
Makefile.libcompat Remove $FreeBSD$: one-line sh pattern 2023-08-23 11:43:30 -06:00
Makefile.sys.inc Remove $FreeBSD$: one-line sh pattern 2023-08-23 11:43:30 -06:00
ObsoleteFiles.inc caroot: routine update 2024-02-13 13:15:13 -06:00
README.md hier(7): remove text describing /usr/src layout 2022-12-05 12:37:07 -04:00
RELNOTES Remove $FreeBSD$: one-line bare tag 2023-08-23 11:43:33 -06:00
UPDATING net80211: deal with lost state transitions 2024-02-19 08:02:01 +00:00

FreeBSD Source:

This is the top level of the FreeBSD source directory.

FreeBSD is an operating system used to power modern servers, desktops, and embedded platforms. A large community has continually developed it for more than thirty years. Its advanced networking, security, and storage features have made FreeBSD the platform of choice for many of the busiest web sites and most pervasive embedded networking and storage devices.

For copyright information, please see the file COPYRIGHT in this directory. Additional copyright information also exists for some sources in this tree - please see the specific source directories for more information.

The Makefile in this directory supports a number of targets for building components (or all) of the FreeBSD source tree. See build(7), config(8), FreeBSD handbook on building userland, and Handbook for kernels for more information, including setting make(1) variables.

For information on the CPU architectures and platforms supported by FreeBSD, see the FreeBSD website's Platforms page.

Source Roadmap:

Directory Description
bin System/user commands.
cddl Various commands and libraries under the Common Development and Distribution License.
contrib Packages contributed by 3rd parties.
crypto Cryptography stuff (see crypto/README).
etc Template files for /etc.
gnu Commands and libraries under the GNU General Public License (GPL) or Lesser General Public License (LGPL). Please see gnu/COPYING* for more information.
include System include files.
kerberos5 Kerberos5 (Heimdal) package.
lib System libraries.
libexec System daemons.
release Release building Makefile & associated tools.
rescue Build system for statically linked /rescue utilities.
sbin System commands.
secure Cryptographic libraries and commands.
share Shared resources.
stand Boot loader sources.
sys Kernel sources (see sys/README.md).
targets Support for experimental DIRDEPS_BUILD
tests Regression tests which can be run by Kyua. See tests/README for additional information.
tools Utilities for regression testing and miscellaneous tasks.
usr.bin User commands.
usr.sbin System administration commands.

For information on synchronizing your source tree with one or more of the FreeBSD Project's development branches, please see FreeBSD Handbook.