From: "Toke Høiland-Jørgensen" <toke@toke.dk>
To: Michail Andreas Michalopoulos <mike.michalo@gmail.com>
Cc: Jeff Johnson <jeff.johnson@oss.qualcomm.com>,
Pengpeng Hou <pengpeng@iscas.ac.cn>,
Mehmet Fide <mehmet.fide@gmail.com>,
linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org,
Michail Andreas Michalopoulos <mike.michalo@gmail.com>,
stable@vger.kernel.org
Subject: Re: [PATCH 2/2] wifi: ath9k: drop WMI command responses when no command is pending
Date: Fri, 23 Oct 2026 13:05:36 +0200 [thread overview]
Message-ID: <875wyssmm7.fsf@toke.dk> (raw)
In-Reply-To: <20261020152412.95560-3-mike.michalo@gmail.com>
Michail Andreas Michalopoulos <mike.michalo@gmail.com> writes:
> ath9k_wmi_ctrl_rx() accepts a command response whose sequence number
> matches wmi->last_seq_id and copies it to wmi->cmd_rsp_buf, which
> usually points into the stack frame of the ath9k_wmi_cmd() caller.
> Only the timeout path clears last_seq_id, since
> commit 8a2f35b98306 ("wifi: ath9k: Fix potential stack-out-of-bounds
> write in ath9k_wmi_rsp_callback()"). After a normal completion or a
> failed send the receive path stays armed, so a duplicate response from
> a buggy or malicious device is written into a stack frame that is gone,
> and its extra complete() makes the next command return before its own
> response arrives. Sequence number 0, which means "nothing pending", is
> also used for a command once tx_seq_id wraps.
>
> Keep the receive path armed only while a command is pending: disarm it
> once a response has been handled, on timeout and when sending fails,
> drop responses while nothing is pending, never use sequence number 0,
> and reinitialise the completion before each command is issued.
>
> Fixes: fb9987d0f748 ("ath9k_htc: Support for AR9271 chipset.")
> Cc: stable@vger.kernel.org
> Assisted-by: LLM
> Signed-off-by: Michail Andreas Michalopoulos <mike.michalo@gmail.com>
Acked-by: Toke Høiland-Jørgensen <toke@toke.dk>
next prev parent reply other threads:[~2026-10-23 11:05 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-20 15:24 [PATCH 0/2] wifi: ath9k: fix WMI command response handling Michail Andreas Michalopoulos
2026-10-20 15:24 ` [PATCH 1/2] wifi: ath9k: don't read past short WMI command responses Michail Andreas Michalopoulos
2026-10-23 11:05 ` Toke Høiland-Jørgensen
2026-10-20 15:24 ` [PATCH 2/2] wifi: ath9k: drop WMI command responses when no command is pending Michail Andreas Michalopoulos
2026-10-23 11:05 ` Toke Høiland-Jørgensen [this message]
2026-10-20 22:46 ` [PATCH 0/2] wifi: ath9k: fix WMI command response handling Mehmet Fide
2026-10-20 23:19 ` mixalhs
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=875wyssmm7.fsf@toke.dk \
--to=toke@toke.dk \
--cc=jeff.johnson@oss.qualcomm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=mehmet.fide@gmail.com \
--cc=mike.michalo@gmail.com \
--cc=pengpeng@iscas.ac.cn \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox