mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Baochen Qiang <baochen.qiang@oss.qualcomm.com>
To: Jeff Johnson <jeff.johnson@oss.qualcomm.com>,
	linux-wireless@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH ath-current v2] wifi: ath6kl: avoid buffer overreads in WMI event handlers
Date: Mon, 13 Jul 2026 10:06:30 +0800	[thread overview]
Message-ID: <44c01b93-5538-4a81-ab5e-b25d0d56980d@oss.qualcomm.com> (raw)
In-Reply-To: <20260711-ath6kl_wmi_scan_complete_rx-v2-1-22dc0f7f45e7@oss.qualcomm.com>



On 7/12/2026 2:04 AM, Jeff Johnson wrote:
> The following WMI event handlers currently read from the event buffer
> without first verifying that the message was large enough to hold the
> expected event:
> ath6kl_wmi_scan_complete_rx()
> ath6kl_wmi_addba_req_event_rx()
> ath6kl_wmi_delba_req_event_rx()
> 
> Add length checks to prevent overread.
> 
> Fixes: bdcd81707973 ("Add ath6kl cleaned up driver")
> Assisted-by: Claude:claude-sonnet-4-6
> Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
> ---
> Changes in v2:
> - Added fixes for two more functions: ath6kl_wmi_addba_req_event_rx and ath6kl_wmi_delba_req_event_rx
> - v1 subject: [PATCH ath-current] wifi: ath6kl: avoid buffer overread in ath6kl_wmi_scan_complete_rx()
> - Link to v1: https://patch.msgid.link/20260711-ath6kl_wmi_scan_complete_rx-v1-1-7b11e5f8b96c@oss.qualcomm.com
> ---
>  drivers/net/wireless/ath/ath6kl/wmi.c | 17 +++++++++++++++--
>  1 file changed, 15 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/wireless/ath/ath6kl/wmi.c b/drivers/net/wireless/ath/ath6kl/wmi.c
> index 72611a2ceb9d..08030d88c7d3 100644
> --- a/drivers/net/wireless/ath/ath6kl/wmi.c
> +++ b/drivers/net/wireless/ath/ath6kl/wmi.c
> @@ -1276,6 +1276,9 @@ static int ath6kl_wmi_scan_complete_rx(struct wmi *wmi, u8 *datap, int len,
>  {
>  	struct wmi_scan_complete_event *ev;
>  
> +	if (len < sizeof(*ev))
> +		return -EINVAL;
> +
>  	ev = (struct wmi_scan_complete_event *) datap;
>  
>  	ath6kl_scan_complete_evt(vif, a_sle32_to_cpu(ev->status));
> @@ -3352,7 +3355,12 @@ static int ath6kl_wmi_get_pmkid_list_event_rx(struct wmi *wmi, u8 *datap,
>  static int ath6kl_wmi_addba_req_event_rx(struct wmi *wmi, u8 *datap, int len,
>  					 struct ath6kl_vif *vif)
>  {
> -	struct wmi_addba_req_event *cmd = (struct wmi_addba_req_event *) datap;
> +	struct wmi_addba_req_event *cmd;
> +
> +	if (len < sizeof(*cmd))
> +		return -EINVAL;
> +
> +	cmd = (struct wmi_addba_req_event *) datap;

Nit: No space is necessary after a cast. This is a preexisting issue, since you are
touching, better to fix it together.

>  
>  	aggr_recv_addba_req_evt(vif, cmd->tid,
>  				le16_to_cpu(cmd->st_seq_no), cmd->win_sz);
> @@ -3363,7 +3371,12 @@ static int ath6kl_wmi_addba_req_event_rx(struct wmi *wmi, u8 *datap, int len,
>  static int ath6kl_wmi_delba_req_event_rx(struct wmi *wmi, u8 *datap, int len,
>  					 struct ath6kl_vif *vif)
>  {
> -	struct wmi_delba_event *cmd = (struct wmi_delba_event *) datap;
> +	struct wmi_delba_event *cmd;
> +
> +	if (len < sizeof(*cmd))
> +		return -EINVAL;
> +
> +	cmd = (struct wmi_delba_event *) datap;

same here

>  
>  	aggr_recv_delba_req_evt(vif, cmd->tid);
>  
> 
> ---
> base-commit: fa1b1469f1c5f0f54ed9dab80106a117e7736bfd
> change-id: 20260711-ath6kl_wmi_scan_complete_rx-a97c9cb39da7

Reviewed-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com>


  reply	other threads:[~2026-07-13  2:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-11 18:04 Jeff Johnson
2026-07-13  2:06 ` Baochen Qiang [this message]
2026-07-13 23:39   ` Jeff Johnson
2026-07-14 18:08 ` Jeff Johnson

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=44c01b93-5538-4a81-ab5e-b25d0d56980d@oss.qualcomm.com \
    --to=baochen.qiang@oss.qualcomm.com \
    --cc=jeff.johnson@oss.qualcomm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@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