summaryrefslogtreecommitdiffstats
path: root/net/wireless
Commit message (Collapse)AuthorAgeFilesLines
* wifi: cfg80211: Fix validating BSS pointers in __cfg80211_connect_resultVeerendranath Jakkam2022-08-081-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | Driver's SME is allowed to fill either BSSID or BSS pointers in struct cfg80211_connect_resp_params when indicating connect response but a check in __cfg80211_connect_result() is giving unnecessary warning when driver's SME fills only BSSID pointer and not BSS pointer in struct cfg80211_connect_resp_params. In case of mac80211 with auth/assoc path, it is always expected to fill BSS pointers in struct cfg80211_connect_resp_params when calling __cfg80211_connect_result() since cfg80211 must have hold BSS pointers in cfg80211_mlme_assoc(). So, skip the check for the drivers which support cfg80211 connect callback, for example with brcmfmac is one such driver which had the warning: WARNING: CPU: 5 PID: 514 at net/wireless/sme.c:786 __cfg80211_connect_result+0x2fc/0x5c0 [cfg80211] Reported-by: Linus Torvalds <torvalds@linux-foundation.org> Fixes: efbabc116500 ("cfg80211: Indicate MLO connection info in connect and roam callbacks") Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com> [kvalo@kernel.org: add more info to the commit log] Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20220805135259.4126630-1-quic_vjakkam@quicinc.com
* wifi: nl80211: add MLO link ID to the NL80211_CMD_FRAME TX APIJohannes Berg2022-07-221-0/+12
| | | | | | | | | | Allow optionally specifying the link ID to transmit on, which can be done instead of the link frequency, on an MLD addressed frame. Both can also be omitted in which case the frame must be MLD addressed and link selection (and address translation) will be done on lower layers. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: cfg80211: report link ID in NL80211_CMD_FRAMEJohannes Berg2022-07-221-0/+2
| | | | | | | If given by the underlying driver, report the link ID for MLO in NL80211_CMD_FRAME. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: cfg80211: add hardware timestamps to frame RX infoAvraham Stern2022-07-221-1/+9
| | | | | | | | | Add hardware timestamps to management frame RX info. This shall be used by drivers that support hardware timestamping for Timing measurement and Fine timing measurement action frames RX. Signed-off-by: Avraham Stern <avraham.stern@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: cfg80211/nl80211: move rx management data into a structAvraham Stern2022-07-224-28/+25
| | | | | | | | | The functions for reporting rx management take many arguments. Collect all the arguments into a struct, which also make it easier to add more arguments if needed. Signed-off-by: Avraham Stern <avraham.stern@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: cfg80211: add a function for reporting TX status with hardware timestampsAvraham Stern2022-07-221-14/+28
| | | | | | | | | | Add a function for reporting TX status with hardware timestamps. This function shall be used for reporting the TX status of Timing measurement and Fine timing measurement action frames by devices that support reporting hardware timestamps. Signed-off-by: Avraham Stern <avraham.stern@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: nl80211: require MLD address on link STA add/modifyJohannes Berg2022-07-221-3/+2
| | | | | | | | We always need the MLD address and link ID to add or modify the link STA, so require it in the API. Fixes: 577e5b8c3924 ("wifi: cfg80211: add API to add/modify/remove a link station") Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: mac80211: remove stray printkJohannes Berg2022-07-151-1/+0
| | | | | | | | Unfortunately, a printk snuck into a previous patch, remove it. Fixes: 81151ce462e5 ("wifi: mac80211: support MLO authentication/association with one link") Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: mac80211: support MLO authentication/association with one linkJohannes Berg2022-07-151-0/+3
| | | | | | | | | | | | | | | | | | | | | | It might seem a bit pointless to do a multi-link operation connection with just a single link, but this is already a big change, so for now, limit MLO connections to a single link. Extending that to multiple links will require * work on parsing the multi-link element with STA profile properly, including element fragmentation; * checking the per-link status in the multi-link element * implementing logic to have active/inactive links to let drivers decide which links should be active; * implementing multicast RX deduplication; * and likely more. For now this is still useful since it lets us do multi-link connections for the purposes of testing APIs and the higher layers such as wpa_supplicant. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: cfg80211: add cfg80211_get_iftype_ext_capa()Johannes Berg2022-07-151-0/+14
| | | | | | | Add a helper function cfg80211_get_iftype_ext_capa() to look up interface type-specific (extended) capabilities. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: nl80211: fix some attribute policy entriesJohannes Berg2022-07-151-9/+9
| | | | | | | | The new NL80211_CMD_ADD_LINK_STA and NL80211_CMD_MODIFY_LINK_STA commands have strict policy validation, so fix the policy so it can be validated correctly. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: nl80211: reject fragmented and non-inheritance elementsJohannes Berg2022-07-151-0/+25
| | | | | | | | | | | | | | | | | The underlying mac80211 code cannot deal with fragmented elements for purposes of sorting the elements into the association frame, so reject those inside the link. We might want to reject them inside the assoc frame, but they're used today for FILS, so cannot do that. The non-inheritance element inside the links similarly cannot be handled by mac80211, and outside the links it makes no sense. Reject both since using them could lead to an incorrect implementation. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: nl80211: reject link specific elements on assoc linkJohannes Berg2022-07-151-0/+7
| | | | | | | | | | | When we associate, we'll include all the elements for the link we're sending the association request on in the frame and the specific ones for other links in the multi-link element container. Prohibit adding link-specific elements for the association link. Fixes: d648c23024bd ("wifi: nl80211: support MLO in auth/assoc") Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: cfg80211: set country_elem to NULLJohannes Berg2022-07-151-1/+1
| | | | | | | | | The link loop will always have a valid link so that it's always set, but static checkers don't always see that, so set it to NULL explicitly. Fixes: efbabc116500 ("cfg80211: Indicate MLO connection info in connect and roam callbacks") Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: nl80211: advertise MLO supportJohannes Berg2022-07-151-0/+3
| | | | | | | | | At least while we don't have any more specific interface combinations support, add a simple flag for MLO support, we can keep this later based on something other than the wiphy flag. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: nl80211: allow link ID in set_wiphy with frequencyIlan Peer2022-07-151-2/+5
| | | | | | | | This simplifies hostapd implementation, since it didn't switch to NL80211_CMD_SET_CHANNEL. Signed-off-by: Ilan Peer <ilan.peer@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: cfg80211/mac80211: Support control port TX from specific linkAndrei Otcheretianski2022-07-153-8/+15
| | | | | | | | In case of authentication with a legacy station, link addressed EAPOL frames should be sent. Support it. Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: nl80211: Support MLD parameters in nl80211_set_station()Andrei Otcheretianski2022-07-151-1/+22
| | | | | | | | Set the MLD parameters in NL80211_CMD_SET_STATION handling to be able to change an MLD station. Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: nl80211: check MLO support in authenticateJohannes Berg2022-07-151-0/+2
| | | | | | | | We should check that MLO connections are supported before attempting to authenticate with MLO parameters, check that. Fixes: d648c23024bd ("wifi: nl80211: support MLO in auth/assoc") Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: nl80211: set BSS to NULL if IS_ERR()Johannes Berg2022-07-151-0/+1
| | | | | | | | If the BSS lookup returned an error, set it to NULL so we don't try to free it. Fixes: d648c23024bd ("wifi: nl80211: support MLO in auth/assoc") Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: nl80211: add EML/MLD capabilities to per-iftype capabilitiesJohannes Berg2022-07-151-0/+9
| | | | | | | | We have the per-interface type capabilities, currently for extended capabilities, add the EML/MLD capabilities there to have this advertised by the driver. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: nl80211: better validate link ID for stationsJohannes Berg2022-07-151-9/+17
| | | | | | | | If we add a station on an MLD, we need a link ID to see where it lives (by default). Validate the link ID against the valid_links. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: cfg80211: clean up links appropriatelyJohannes Berg2022-07-154-10/+52
| | | | | | | | | | This was missing earlier, we need to remove links when interfaces are being destroyed, and we also need to stop (AP) operations when a link is being destroyed. Address these issues to remove many warnings that will otherwise appear in mac80211. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: cfg80211: extend cfg80211_rx_assoc_resp() for MLOJohannes Berg2022-07-152-30/+50
| | | | | | | | Extend the cfg80211_rx_assoc_resp() to cover multiple BSSes, the AP MLD address and local link addresses for MLO. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: cfg80211: put cfg80211_rx_assoc_resp() arguments into a structJohannes Berg2022-07-153-26/+22
| | | | | | | | For MLO we'll need a lot more arguments, including all the BSS pointers and link addresses, so move the data to a struct to be able to extend it more easily later. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: cfg80211: adjust assoc comeback for MLOJohannes Berg2022-07-152-8/+8
| | | | | | | | We only report the BSSID to userspace, so change the argument from BSS struct pointer to AP address, which we'll use to carry either the BSSID or AP MLD address. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: cfg80211: prepare association failure APIs for MLOJohannes Berg2022-07-152-20/+35
| | | | | | | | | | | | For MLO, we need the ability to report back multiple BSS structures to release, as well as the AP MLD address (if attempting to make an MLO connection). Unify cfg80211_assoc_timeout() and cfg80211_abandon_assoc() into a new cfg80211_assoc_failure() that gets a structure parameter with the necessary data. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: cfg80211: remove BSS pointer from cfg80211_disassoc_requestJohannes Berg2022-07-153-10/+5
| | | | | | | | | | The race described by the comment in mac80211 hasn't existed since the locking rework to use the same lock and for MLO we need to pass the AP MLD address, so just pass the BSSID or AP MLD address instead of the BSS struct pointer, and adjust all the code accordingly. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: nl80211: acquire wdev mutex for dump_surveyJohannes Berg2022-07-151-0/+2
| | | | | | | | At least the quantenna driver calls wdev_chandef() here which now requires the lock, so acquire it. Fixes: 7b0a0e3c3a88 ("wifi: cfg80211: do some rework towards MLO link APIs") Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: cfg80211: drop BSS elements from assoc trace for nowJohannes Berg2022-07-152-21/+3
| | | | | | | | | | | | For multi-link operation, this cannot work as the req->bss pointer will be NULL, and we'll need to do more work on this to really add tracing for the MLO case here. Drop the BSS elements for now as they're not the most useful thing, and it's hard to size things correctly for the MLO case (without adding a lot of code that's also executed when tracing isn't enabled.) Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: nl80211: enable setting the link address at new stationShaul Triebitz2022-07-151-1/+19
| | | | | | | | | | | Since for an MLD station the default link is added together with the add station command, allow also setting the link MAC address. Otherwise, it is needed to use the modify link API only for setting the link MAC address. Signed-off-by: Shaul Triebitz <shaul.triebitz@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: nl80211: hold wdev mutex for station APIsJohannes Berg2022-07-151-1/+10
| | | | | | | Since this will need to refer - at least in part - to the link stations of an MLD, hold the wdev mutex for driver convenience. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: nl80211: hold wdev mutex for channel switch APIsJohannes Berg2022-07-151-5/+16
| | | | | | | Since we deal with links in an MLD here, hold the wdev mutex now. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: nl80211: hold wdev mutex in add/mod/del link stationJohannes Berg2022-07-151-3/+13
| | | | | | | Since we deal with links, and that requires looking at wdev links, we should hold the wdev mutex for driver convenience. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: cfg80211/mac80211: separate link params from station paramsShaul Triebitz2022-07-152-56/+65
| | | | | | | | | | | Put the link_station_parameters structure in the station_parameters structure (and remove the station_parameters fields already existing in link_station_parameters). Now, for an MLD station, the default link is added together with the station. Signed-off-by: Shaul Triebitz <shaul.triebitz@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: cfg80211: add API to add/modify/remove a link stationShaul Triebitz2022-07-153-8/+305
| | | | | | | Add an API for adding/modifying/removing a link of a station. Signed-off-by: Shaul Triebitz <shaul.triebitz@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: cfg80211: Allow MLO TX with link source addressAndrei Otcheretianski2022-07-151-1/+13
| | | | | | | | Management frames are transmitted from link address and not device address. Allow that. Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wifi: cfg80211: use strscpy to replace strlcpyXueBing Chen2022-07-151-6/+6
| | | | | | | | | The strlcpy should not be used because it doesn't limit the source length. Preferred is strscpy. Signed-off-by: XueBing Chen <chenxuebing@jari.cn> Link: https://lore.kernel.org/r/2d2fcbf7.e33.181eda8e70e.Coremail.chenxuebing@jari.cn Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/netJakub Kicinski2022-07-141-1/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | include/net/sock.h 310731e2f161 ("net: Fix data-races around sysctl_mem.") e70f3c701276 ("Revert "net: set SK_MEM_QUANTUM to 4096"") https://lore.kernel.org/all/20220711120211.7c8b7cba@canb.auug.org.au/ net/ipv4/fib_semantics.c 747c14307214 ("ip: fix dflt addr selection for connected nexthop") d62607c3fe45 ("net: rename reference+tracking helpers") net/tls/tls.h include/net/tls.h 3d8c51b25a23 ("net/tls: Check for errors in tls_device_init") 587903142308 ("tls: create an internal header") Signed-off-by: Jakub Kicinski <kuba@kernel.org>
| * wifi: cfg80211: Allow P2P client interface to indicate port authorizationVinayak Yadawad2022-06-291-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | In case of 4way handshake offload, cfg80211_port_authorized enables driver to indicate successful 4way handshake to cfg80211 layer. Currently this path of port authorization is restricted to interface type NL80211_IFTYPE_STATION. This patch extends the use of port authorization API for P2P client as well. Signed-off-by: Vinayak Yadawad <vinayak.yadawad@broadcom.com> Link: https://lore.kernel.org/r/ef25cb49fcb921df2e5d99e574f65e8a009cc52c.1655905440.git.vinayak.yadawad@broadcom.com Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* | wifi: nl80211: fix sending link ID info of associated BSSVeerendranath Jakkam2022-07-111-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit dd374f84baec ("wifi: nl80211: expose link ID for associated BSSes") used a top-level attribute to send link ID of the associated BSS in the nested attribute NL80211_ATTR_BSS. But since NL80211_ATTR_BSS is a nested attribute of the attributes defined in enum nl80211_bss, define a new attribute in enum nl80211_bss and use it for sending the link ID of the BSS. Fixes: dd374f84baec ("wifi: nl80211: expose link ID for associated BSSes") Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com> Reviewed-by: Jeff Johnson <quic_jjohnson@quicinc.com> Link: https://lore.kernel.org/r/20220708122607.1836958-1-quic_vjakkam@quicinc.com Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* | wifi: cfg80211: fix a comment in cfg80211_mlme_mgmt_tx()Veerendranath Jakkam2022-07-111-1/+1
| | | | | | | | | | | | | | | | | | | | A comment in cfg80211_mlme_mgmt_tx() is describing this API used only for transmitting action frames. Fix the comment since cfg80211_mlme_mgmt_tx() can be used to transmit any management frame. Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com> Link: https://lore.kernel.org/r/20220708165545.2072999-1-quic_vjakkam@quicinc.com Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* | wifi: nl80211: Fix reading NL80211_ATTR_MLO_LINK_ID in nl80211_pre_doitVeerendranath Jakkam2022-07-111-1/+1
| | | | | | | | | | | | | | | | | | | | nl80211_pre_doit() using nla_get_u16() to read u8 attribute NL80211_ATTR_MLO_LINK_ID. Fix this by using nla_get_u8() to read NL80211_ATTR_MLO_LINK_ID attribute. Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com> Link: https://lore.kernel.org/r/1657517683-5724-1-git-send-email-quic_vjakkam@quicinc.com Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* | wifi: nl80211: retrieve EHT related elements in AP modeAloka Dixit2022-07-011-2/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support to retrieve EHT capabilities and EHT operation elements passed by the userspace in the beacon template and store the pointers in struct cfg80211_ap_settings to be used by the drivers. Co-developed-by: Vikram Kandukuri <quic_vikram@quicinc.com> Signed-off-by: Vikram Kandukuri <quic_vikram@quicinc.com> Co-developed-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com> Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com> Signed-off-by: Aloka Dixit <quic_alokad@quicinc.com> Link: https://lore.kernel.org/r/20220523064904.28523-1-quic_alokad@quicinc.com Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* | wifi: cfg80211: Increase akm_suites array size in cfg80211_crypto_settingsVeerendranath Jakkam2022-07-012-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Increase akm_suites array size in struct cfg80211_crypto_settings to 10 and advertise the capability to userspace. This allows userspace to send more than two AKMs to driver in netlink commands such as NL80211_CMD_CONNECT. This capability is needed for implementing WPA3-Personal transition mode correctly with any driver that handles roaming internally. Currently, the possible AKMs for multi-AKM connect can include PSK, PSK-SHA-256, SAE, FT-PSK and FT-SAE. Since the count is already 5, increasing the akm_suites array size to 10 should be reasonable for future usecases. Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com> Link: https://lore.kernel.org/r/1653312358-12321-1-git-send-email-quic_vjakkam@quicinc.com Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* | wifi: cfg80211: remove chandef check in cfg80211_cac_event()Johannes Berg2022-07-011-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The current check only worked for AP mode, but we can do radar detection in mesh as well (for example). We could try to check this using wdev_chandef(), but we also don't really care since the chandef is passed in and we have no need to use it anymore (since we added the argument in commit d2859df5e7f0 ("cfg80211/mac80211: DFS setup chandef for cac event")). Change-Id: I856e4344d5e64ff4d2eead0b4c53b11f264be9b8 Fixes: 7b0a0e3c3a88 ("wifi: cfg80211: do some rework towards MLO link APIs") Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* | wifi: nl80211: relax wdev mutex check in wdev_chandef()Johannes Berg2022-07-011-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | In many cases we might get here from driver code that's not really set up to care about the locking, and for the non-MLO cases we really don't care so much about it. So relax the checking here for now, perhaps we should even remove it completely since we might not really care if we point to an invalid link's chandef and can require the caller to check the link validity first. Fixes: 7b0a0e3c3a88 ("wifi: cfg80211: do some rework towards MLO link APIs") Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* | wifi: nl80211: acquire wdev mutex earlier in start_apJohannes Berg2022-07-011-12/+13
| | | | | | | | | | | | | | | | We need to hold the wdev mutex already in order to call nl80211_parse_tx_bitrate_mask(), so acquire it earlier. Fixes: 7b0a0e3c3a88 ("wifi: cfg80211: do some rework towards MLO link APIs") Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* | wifi: nl80211: hold wdev mutex for tid configJohannes Berg2022-07-011-0/+3
| | | | | | | | | | | | | | | | | | | | We need wdev_chandef() in this code, which now requires the wdev mutex due to the per-link nature. Hold it here to make sure we can access the link. Reported-by: syzbot+b4e9aa0f32ffd9902442@syzkaller.appspotmail.com Fixes: 7b0a0e3c3a88 ("wifi: cfg80211: do some rework towards MLO link APIs") Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* | wifi: cfg80211: handle IBSS in channel switchJohannes Berg2022-07-011-0/+3
| | | | | | | | | | | | | | | | | | | | | | Prior to commit 7b0a0e3c3a88 ("wifi: cfg80211: do some rework towards MLO link APIs") the interface type didn't really matter here, but now we need to handle all of the possible cases. Add IBSS ("ADHOC") and handle it. Fixes: 7b0a0e3c3a88 ("wifi: cfg80211: do some rework towards MLO link APIs") Reported-by: syzbot+90d912872157e63589e4@syzkaller.appspotmail.com Signed-off-by: Johannes Berg <johannes.berg@intel.com>