From: Kalle Valo <kvalo@codeaurora.org>
To: Zekun Shen <bruceshenzk@gmail.com>
Cc: netdev@vger.kernel.org, linux-wireless@vger.kernel.org,
linux-kernel@vger.kernel.org, ath10k@lists.infradead.org,
Jakub Kicinski <kuba@kernel.org>,
"David S. Miller" <davem@davemloft.net>
Subject: Re: [PATCH] net: ath10k: santity check for ep connectivity
Date: Mon, 21 Dec 2020 20:15:22 +0200 [thread overview]
Message-ID: <87sg7znhz9.fsf@codeaurora.org> (raw)
In-Reply-To: <20200622022055.16028-1-bruceshenzk@gmail.com> (Zekun Shen's message of "Sun, 21 Jun 2020 22:20:54 -0400")
Zekun Shen <bruceshenzk@gmail.com> writes:
> Function ep_rx_complete is being called without NULL checking
> in ath10k_htc_rx_completion_handler. Without such check, mal-
> formed packet is able to cause jump to NULL.
>
> ep->service_id seems a good candidate for sanity check as it is
> used in usb.c.
>
> Signed-off-by: Zekun Shen <bruceshenzk@gmail.com>
> ---
> drivers/net/wireless/ath/ath10k/htc.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/drivers/net/wireless/ath/ath10k/htc.c b/drivers/net/wireless/ath/ath10k/htc.c
> index 31df6dd04..e00794d97 100644
> --- a/drivers/net/wireless/ath/ath10k/htc.c
> +++ b/drivers/net/wireless/ath/ath10k/htc.c
> @@ -450,6 +450,11 @@ void ath10k_htc_rx_completion_handler(struct ath10k *ar, struct sk_buff *skb)
>
> ep = &htc->endpoint[eid];
>
> + if (ep->service_id == 0) {
> + ath10k_warn(ar, "HTC Rx: ep %d is not connect\n", eid);
> + goto out;
> + }
I think using ATH10K_HTC_SVC_ID_UNUSED is more descriptive than zero, as
ath10k_htc_reset_endpoint_states() uses it. I fixed in the pending
branch.
I think also ath10k_htc_process_credit_report() might have a similar
problem, can you take a look?
--
https://patchwork.kernel.org/project/linux-wireless/list/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k
WARNING: multiple messages have this Message-ID (diff)
From: Kalle Valo <kvalo@codeaurora.org>
To: Zekun Shen <bruceshenzk@gmail.com>
Cc: netdev@vger.kernel.org, linux-wireless@vger.kernel.org,
linux-kernel@vger.kernel.org, ath10k@lists.infradead.org,
Jakub Kicinski <kuba@kernel.org>,
"David S. Miller" <davem@davemloft.net>
Subject: Re: [PATCH] net: ath10k: santity check for ep connectivity
Date: Mon, 21 Dec 2020 20:15:22 +0200 [thread overview]
Message-ID: <87sg7znhz9.fsf@codeaurora.org> (raw)
In-Reply-To: <20200622022055.16028-1-bruceshenzk@gmail.com> (Zekun Shen's message of "Sun, 21 Jun 2020 22:20:54 -0400")
Zekun Shen <bruceshenzk@gmail.com> writes:
> Function ep_rx_complete is being called without NULL checking
> in ath10k_htc_rx_completion_handler. Without such check, mal-
> formed packet is able to cause jump to NULL.
>
> ep->service_id seems a good candidate for sanity check as it is
> used in usb.c.
>
> Signed-off-by: Zekun Shen <bruceshenzk@gmail.com>
> ---
> drivers/net/wireless/ath/ath10k/htc.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/drivers/net/wireless/ath/ath10k/htc.c b/drivers/net/wireless/ath/ath10k/htc.c
> index 31df6dd04..e00794d97 100644
> --- a/drivers/net/wireless/ath/ath10k/htc.c
> +++ b/drivers/net/wireless/ath/ath10k/htc.c
> @@ -450,6 +450,11 @@ void ath10k_htc_rx_completion_handler(struct ath10k *ar, struct sk_buff *skb)
>
> ep = &htc->endpoint[eid];
>
> + if (ep->service_id == 0) {
> + ath10k_warn(ar, "HTC Rx: ep %d is not connect\n", eid);
> + goto out;
> + }
I think using ATH10K_HTC_SVC_ID_UNUSED is more descriptive than zero, as
ath10k_htc_reset_endpoint_states() uses it. I fixed in the pending
branch.
I think also ath10k_htc_process_credit_report() might have a similar
problem, can you take a look?
--
https://patchwork.kernel.org/project/linux-wireless/list/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
next prev parent reply other threads:[~2020-12-21 18:16 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-22 2:20 [PATCH] net: ath10k: santity check for ep connectivity Zekun Shen
2020-06-22 2:20 ` Zekun Shen
2020-12-21 18:15 ` Kalle Valo [this message]
2020-12-21 18:15 ` Kalle Valo
2021-01-18 16:12 ` Kalle Valo
2021-01-18 16:12 ` Kalle Valo
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=87sg7znhz9.fsf@codeaurora.org \
--to=kvalo@codeaurora.org \
--cc=ath10k@lists.infradead.org \
--cc=bruceshenzk@gmail.com \
--cc=davem@davemloft.net \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=netdev@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.