Repository navigation
cfg80211 cookie rework for Linux 7.3 - #37
Merged
Merged
Conversation
Linux 7.3 makes the cookie of mgmt_tx, remain_on_channel and probe_peer an input that nl80211 assigns before the driver runs, renames cfg80211_ops.probe_client to probe_peer, and adds link_id to cfg80211_probe_status. This driver minted its own cookies, so a signature-only fix would compile and then report values userspace never issued. Carries the assigned cookie in rwnx_sw_txhdr, rwnx_roc_elem and sta_probe.probe_id, and every sw_txhdr keeps the skb pointer as its default because rwnx_start_monitor_if_xmit also raises TXU_CNTRL_MGMT. Internal RoC and TDLS callers pass 0, which cfg80211_assign_cookie never hands out. The fdrv Makefile greps cfg80211.h for the four shapes, remain_on_channel's rx_addr included, since a backport that moves the cookie moves rx_addr with it.
Make matches parentheses to find the end of a $(shell ...) call and knows nothing about shell quoting, so the bracket in 'u64 cookie)' closed the call early. The command then ran with an unterminated quote and returned nothing, and the ifneq against 0 defined AIC_CFG80211_COOKIE_INPUT on every kernel, which broke 6.12, 6.18, 7.1 and Arch. Dropped the bracket. The 7.3 shape is already distinguished by u64 cookie against u64 *cookie, and the -A2 window has to stay as it is because cfg80211_probe_status carries the same u64 cookie text further down.
The remain_on_channel definition takes rx_addr when the Makefile detects it in cfg80211.h, but its caller in mgmt_tx still checked only the 7.2 version, so a kernel with rx_addr backported and the old cookie shape failed with too few arguments. The call now accepts AIC_CFG80211_ROC_RX_ADDR alongside the version.
Builds on Linux 7.3 with its cfg80211 cookie rework, and prints make.log when a dkms build fails.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Linux 7.3 reworked how cfg80211 hands out cookies. nl80211 now assigns the cookie before it calls the driver, so
mgmt_tx,remain_on_channelandprobe_peertake it as au64input instead of writing one back through a pointer. In the same seriescfg80211_ops.probe_clientwas renamed toprobe_peerandcfg80211_probe_statusgained alink_idparameter. The upstream commits are 996753804410, 914781c72813, 4ab9b637b94a and 010e955c203e.This driver minted its own cookies, the skb pointer for management frames and a counter for remain-on-channel, and reported those values back to cfg80211. Only changing the signatures would have compiled cleanly and then reported cookies userspace never asked about, so the assigned cookie is now stored in
rwnx_sw_txhdr,rwnx_roc_elemandsta_probe.probe_idand reported from there. Transmissions the driver starts on its own, the internal remain-on-channel insidemgmt_txand the TDLS discovery response, pass 0.cfg80211_assign_cookienever returns 0, andnl80211_frame_tx_statusdrops a zero-cookie status before it reaches userspace.Detection lives in the fdrv Makefile and greps
cfg80211.h, the same wayAIC_SET_MONITOR_CHANNEL_NETDEVis detected, because Debian trixie has already shipped a 6.12 carrying a backported cfg80211 signature thatLINUX_VERSION_CODElied about. Each guard accepts either the macro or the version check, so a stock kernel builds correctly even when the header cannot be found. The internal RoC call inmgmt_txuses the samerx_addrdetection as theremain_on_channeldefinition, so a kernel with onlyrx_addrbackported still builds.Checked against the v7.3-rc5
cfg80211.h,core.handnl80211.c, and against radxa-pkg'sfix-linux-7.3-build.patch, which makes the same change keyed on the kernel version alone. CI builds 6.12 LTS, 6.18, 7.1, current Arch and mainline -rc.