Skip to contentSkip to conversation

cxgb4: avoid accessing registers when clearing filters

PATCH Applied Raju Rangoju 2 participants 2 messages May 19, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cxgb4: avoid accessing registers when clearing filters

Hardware register having the server TID base can contain invalid values when adapter is in bad state (for example, due to AER fatal error). Reading these invalid values in the register can lead to out-of-bound memory access. So, fix by using the saved server TID base when clearing filters.

Fixes b1a79360ee86 ("cxgb4: Delete all hash and TCAM filters before resource cleanup")
---
 drivers/net/ethernet/chelsio/cxgb4/cxgb4_filter.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/chelsio/cxgb4/cxgb4_filter.c +1 -1
index bc581b149b11..22c9ac922eba 100644
@@ -1042,7 +1042,7 @@ void clear_all_filters(struct adapter *adapter)
 				cxgb4_del_filter(dev, f->tid, &f->fs);
 		}
 
-		sb = t4_read_reg(adapter, LE_DB_SRVR_START_INDEX_A);
+		sb = adapter->tids.stid_base;
 		for (i = 0; i < sb; i++) {
 			f = (struct filter_entry *)adapter->tids.tid_tab[i];
 
Signature · 1 line
2.9.5
#1 lore raw
This patch was applied to netdev/net.git (refs/heads/master):

Hello:

This patch was applied to netdev/net.git (refs/heads/master):

Quoted 10 lines · On Wed, 19 May 2021 16:48:31 +0530 you wrote:

Hardware register having the server TID base can contain invalid values when adapter is in bad state (for example, due to AER fatal error). Reading these invalid values in the register can lead to out-of-bound memory access. So, fix by using the saved server TID base when clearing filters.

Fixes b1a79360ee86 ("cxgb4: Delete all hash and TCAM filters before resource cleanup")

[...]

Here is the summary with links:
- [net] cxgb4: avoid accessing registers when clearing filters

    https://git.kernel.org/netdev/net/c/88c380df84fb

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html