ATH11K Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Vasanthakumar Thiagarajan <vthiagar@codeaurora.org>
To: ath11k@lists.infradead.org
Subject: [PATCH] ath11k/dp: Fix possible invalid skb memory access
Date: Wed, 17 Jul 2019 09:43:26 +0530	[thread overview]
Message-ID: <1563336807-23646-1-git-send-email-vthiagar@codeaurora.org> (raw)

In ath11k_dp_rx_null_q_desc_sg_drop(), Use skb_queue_walk_safe()
instead of skb_queue_walk() while processing skb from the queue
since this involves removing skb from the list. Using just
skb_queue_walk() could result in using invalid (or already freed)
skb memory.

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@codeaurora.org>
---
 drivers/net/wireless/ath/ath11k/dp_rx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/ath11k/dp_rx.c b/drivers/net/wireless/ath/ath11k/dp_rx.c
index d074d90..fbe7f34 100644
--- a/drivers/net/wireless/ath/ath11k/dp_rx.c
+++ b/drivers/net/wireless/ath/ath11k/dp_rx.c
@@ -2907,14 +2907,14 @@ static void ath11k_dp_rx_null_q_desc_sg_drop(struct ath11k *ar,
 					     int msdu_len,
 					     struct sk_buff_head *msdu_list)
 {
-	struct sk_buff *skb;
+	struct sk_buff *skb, *tmp;
 	struct ath11k_skb_rxcb *rxcb;
 	int n_buffs;
 
 	n_buffs = DIV_ROUND_UP(msdu_len,
 			       (DP_RX_BUFFER_SIZE - HAL_RX_DESC_SIZE));
 
-	skb_queue_walk(msdu_list, skb) {
+	skb_queue_walk_safe(msdu_list, skb, tmp) {
 		rxcb = ATH11K_SKB_RXCB(skb);
 		if (rxcb->err_rel_src == HAL_WBM_REL_SRC_MODULE_REO &&
 		    rxcb->err_code == HAL_REO_DEST_RING_ERROR_CODE_DESC_ADDR_ZERO) {
-- 
1.9.1


_______________________________________________
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k

             reply	other threads:[~2019-07-17  4:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-17  4:13 Vasanthakumar Thiagarajan [this message]
2019-07-17  4:13 ` [PATCH] ath11k/dp: Remove unnecessary REO remap configuration Vasanthakumar Thiagarajan
2019-07-18 11:22   ` Kalle Valo
2019-07-18 11:21 ` [PATCH] ath11k/dp: Fix possible invalid skb memory access 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=1563336807-23646-1-git-send-email-vthiagar@codeaurora.org \
    --to=vthiagar@codeaurora.org \
    --cc=ath11k@lists.infradead.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