All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ath11k/dp: Fix possible invalid skb memory access
@ 2019-07-17  4:13 Vasanthakumar Thiagarajan
  2019-07-17  4:13 ` [PATCH] ath11k/dp: Remove unnecessary REO remap configuration Vasanthakumar Thiagarajan
  2019-07-18 11:21 ` [PATCH] ath11k/dp: Fix possible invalid skb memory access Kalle Valo
  0 siblings, 2 replies; 4+ messages in thread
From: Vasanthakumar Thiagarajan @ 2019-07-17  4:13 UTC (permalink / raw)
  To: ath11k

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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH] ath11k/dp: Remove unnecessary REO remap configuration
  2019-07-17  4:13 [PATCH] ath11k/dp: Fix possible invalid skb memory access Vasanthakumar Thiagarajan
@ 2019-07-17  4:13 ` 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
  1 sibling, 1 reply; 4+ messages in thread
From: Vasanthakumar Thiagarajan @ 2019-07-17  4:13 UTC (permalink / raw)
  To: ath11k

REO remap configuration only required when using all REO rings
for Rx with hashing. Since hashing based REO routing is currently
disabled with the driver design, remove unsed register configurations
with REO remap which are used for hash based REO routing.

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@codeaurora.org>
---
 drivers/net/wireless/ath/ath11k/dp.c     | 18 +-----------------
 drivers/net/wireless/ath/ath11k/hal.h    | 16 +---------------
 drivers/net/wireless/ath/ath11k/hal_rx.c | 10 +---------
 3 files changed, 3 insertions(+), 41 deletions(-)

diff --git a/drivers/net/wireless/ath/ath11k/dp.c b/drivers/net/wireless/ath/ath11k/dp.c
index 3f5174a..ad572e7 100644
--- a/drivers/net/wireless/ath/ath11k/dp.c
+++ b/drivers/net/wireless/ath/ath11k/dp.c
@@ -198,7 +198,6 @@ static int ath11k_dp_srng_common_setup(struct ath11k_base *ab)
 	struct ath11k_dp *dp = &ab->dp;
 	struct hal_srng *srng;
 	int i, ret;
-	struct hal_reo_params reo_params = {0};
 
 	ret = ath11k_dp_srng_setup(ab, &dp->wbm_desc_rel_ring,
 				   HAL_SW2WBM_RELEASE, 0, 0,
@@ -286,22 +285,7 @@ static int ath11k_dp_srng_common_setup(struct ath11k_base *ab)
 		goto err;
 	}
 
-	/* When hash based routing of rx packet is enabled, 16 entries to map
-	 * the hash values to the ring will be configured. Each hash entry uses
-	 * three bits to map to a particular ring. The ring mapping will be
-	 * 0:TCL, 1:SW1, 2:SW2, 3:SW3, 4:SW4, 5:Release, 6:FW and 7:Not used.
-	 */
-	reo_params.ring_hash_map0_7 = HAL_HASH_ROUTING_RING_SW1 << 0 |
-				      HAL_HASH_ROUTING_RING_SW2 << 3 |
-				      HAL_HASH_ROUTING_RING_SW3 << 6 |
-				      HAL_HASH_ROUTING_RING_SW4 << 9 |
-				      HAL_HASH_ROUTING_RING_SW1 << 12 |
-				      HAL_HASH_ROUTING_RING_SW2 << 15 |
-				      HAL_HASH_ROUTING_RING_SW3 << 18 |
-				      HAL_HASH_ROUTING_RING_SW4 << 21;
-	reo_params.ring_hash_map8_15 = reo_params.ring_hash_map0_7;
-
-	ath11k_hal_reo_hw_setup(ab, &reo_params);
+	ath11k_hal_reo_hw_setup(ab);
 
 	return 0;
 
diff --git a/drivers/net/wireless/ath/ath11k/hal.h b/drivers/net/wireless/ath/ath11k/hal.h
index a1e917e..76ab802 100644
--- a/drivers/net/wireless/ath/ath11k/hal.h
+++ b/drivers/net/wireless/ath/ath11k/hal.h
@@ -717,19 +717,6 @@ enum hal_ce_desc {
 	HAL_CE_DESC_DST_STATUS,
 };
 
-#define HAL_HASH_ROUTING_RING_TCL 0
-#define HAL_HASH_ROUTING_RING_SW1 1
-#define HAL_HASH_ROUTING_RING_SW2 2
-#define HAL_HASH_ROUTING_RING_SW3 3
-#define HAL_HASH_ROUTING_RING_SW4 4
-#define HAL_HASH_ROUTING_RING_REL 5
-#define HAL_HASH_ROUTING_RING_FW  6
-
-struct hal_reo_params {
-	u32 ring_hash_map0_7;
-	u32 ring_hash_map8_15;
-};
-
 struct hal_reo_status_header {
 	u16 cmd_num;
 	enum hal_reo_cmd_status cmd_status;
@@ -863,8 +850,7 @@ void ath11k_hal_reo_qdesc_setup(void *vaddr, int tid, u32 ba_window_size,
 				u32 start_seqtype);
 void ath11k_hal_reo_init_cmd_ring(struct ath11k_base *ab,
 				  struct hal_srng *srng);
-void ath11k_hal_reo_hw_setup(struct ath11k_base *ab,
-			     struct hal_reo_params *params);
+void ath11k_hal_reo_hw_setup(struct ath11k_base *ab);
 void ath11k_hal_setup_link_idle_list(struct ath11k_base *ab,
 				     struct hal_wbm_idle_scatter_list *sbuf,
 				     u32 nsbufs, u32 tot_link_desc,
diff --git a/drivers/net/wireless/ath/ath11k/hal_rx.c b/drivers/net/wireless/ath/ath11k/hal_rx.c
index 1dcc0fc..f8abbb7 100644
--- a/drivers/net/wireless/ath/ath11k/hal_rx.c
+++ b/drivers/net/wireless/ath/ath11k/hal_rx.c
@@ -828,8 +828,7 @@ void ath11k_hal_reo_init_cmd_ring(struct ath11k_base *ab,
 	}
 }
 
-void ath11k_hal_reo_hw_setup(struct ath11k_base *ab,
-			     struct hal_reo_params *params)
+void ath11k_hal_reo_hw_setup(struct ath11k_base *ab)
 {
 	u32 reo_base = HAL_SEQ_WCSS_UMAC_REO_REG;
 	u32 val;
@@ -851,13 +850,6 @@ void ath11k_hal_reo_hw_setup(struct ath11k_base *ab,
 			   HAL_DEFAULT_REO_TIMEOUT_USEC);
 	ath11k_ahb_write32(ab, reo_base + HAL_REO1_AGING_THRESH_IX_3,
 			   HAL_DEFAULT_REO_TIMEOUT_USEC);
-
-	ath11k_ahb_write32(ab, reo_base + HAL_REO1_DEST_RING_CTRL_IX_2,
-			   FIELD_PREP(HAL_REO_DEST_RING_CTRL_HASH_RING_MAP,
-				      params->ring_hash_map0_7));
-	ath11k_ahb_write32(ab, reo_base + HAL_REO1_DEST_RING_CTRL_IX_3,
-			   FIELD_PREP(HAL_REO_DEST_RING_CTRL_HASH_RING_MAP,
-				      params->ring_hash_map8_15));
 }
 
 static enum hal_rx_mon_status
-- 
1.9.1


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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] ath11k/dp: Fix possible invalid skb memory access
  2019-07-17  4:13 [PATCH] ath11k/dp: Fix possible invalid skb memory access Vasanthakumar Thiagarajan
  2019-07-17  4:13 ` [PATCH] ath11k/dp: Remove unnecessary REO remap configuration Vasanthakumar Thiagarajan
@ 2019-07-18 11:21 ` Kalle Valo
  1 sibling, 0 replies; 4+ messages in thread
From: Kalle Valo @ 2019-07-18 11:21 UTC (permalink / raw)
  To: Vasanthakumar Thiagarajan; +Cc: ath11k

Vasanthakumar Thiagarajan <vthiagar@codeaurora.org> wrote:

> 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>
> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>

Patch applied to ath11k-bringup branch of ath.git, thanks.

de542ad2ea10 ath11k/dp: Fix possible invalid skb memory access

-- 
https://patchwork.kernel.org/patch/11047147/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ath11k/dp: Remove unnecessary REO remap configuration
  2019-07-17  4:13 ` [PATCH] ath11k/dp: Remove unnecessary REO remap configuration Vasanthakumar Thiagarajan
@ 2019-07-18 11:22   ` Kalle Valo
  0 siblings, 0 replies; 4+ messages in thread
From: Kalle Valo @ 2019-07-18 11:22 UTC (permalink / raw)
  To: Vasanthakumar Thiagarajan; +Cc: ath11k

Vasanthakumar Thiagarajan <vthiagar@codeaurora.org> wrote:

> REO remap configuration only required when using all REO rings
> for Rx with hashing. Since hashing based REO routing is currently
> disabled with the driver design, remove unsed register configurations
> with REO remap which are used for hash based REO routing.
> 
> Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@codeaurora.org>
> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>

Patch applied to ath11k-bringup branch of ath.git, thanks.

edcb51532171 ath11k/dp: Remove unnecessary REO remap configuration

-- 
https://patchwork.kernel.org/patch/11047149/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-07-18 11:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-17  4:13 [PATCH] ath11k/dp: Fix possible invalid skb memory access Vasanthakumar Thiagarajan
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

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.