wifi: ath9k: fix WMI command response handling
Status from this message: Applied, thanks!
Get series with b4
b4 am [email protected]Versions newest first
Patches in v1 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | wifi: ath9k: don't read past short WMI command responsesdrivers/ | +12 | 1 reply | |
| 2/2 | wifi: ath9k: drop WMI command responses when no command is pendingdrivers/ | +28 | 1 reply |
Reviews trailers per patch
All 2 patches have a Reviewed-by or Acked-by.
| Patch | Mehmet Fide | Toke Høiland-Jørgensen |
|---|---|---|
| Series | T-b | |
| 1/2 | A-b | |
| 2/2 | A-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH 0/2] wifi: ath9k: fix WMI command response handling
Both patches fix the ath9k_htc WMI command response path.
Patch 1 stops ath9k_wmi_rsp_callback() from copying bytes the device did not send. It replaces the -EMSGSIZE approach that was reverted in commit 90201351a862: short and empty responses still complete, and the rest of the caller's buffer is zeroed.
Patch 2 stops responses from being accepted while no command is pending (after completion, after a failed send, or with sequence number 0), which could make a duplicate response write into the stack frame of a caller that has already returned.
Testing: temporary KUnit tests (not included) drive the real ath9k_wmi_ctrl_rx() and ath9k_wmi_cmd() against a fake HTC device in x86_64 QEMU under KASAN, KMSAN, UBSAN and lockdep: short and empty responses for all payload/buffer length combinations, duplicate and late responses, failed sends, sequence number wrap, and a concurrent stress test. Without the patches stale bytes reach the caller and KASAN reports slab-use-after-free writes in ath9k_wmi_ctrl_rx(); with them the tests pass with no reports. Builds cleanly with W=1 (GCC and Clang) and sparse.
I don't have access to an ath9k_htc device, so this was not tested on hardware. Mehmet, if you could give it a try on your AR9271 that would be much appreciated.
The series applies on top of v7.3, which contains the revert; ath.git does not have the revert yet.
Michail Andreas Michalopoulos (2):
wifi: ath9k: don't read past short WMI command responses
wifi: ath9k: drop WMI command responses when no command is pending
drivers/net/wireless/ath/ath9k/wmi.c | 47 +++++++++++++++++++++++----- 1 file changed, 40 insertions(+), 7 deletions(-)
Signature · 1 line
2.43.0