All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] cxgb4: avoid accessing registers when clearing filters
@ 2021-05-19 11:18 Raju Rangoju
  2021-05-19 20:10 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Raju Rangoju @ 2021-05-19 11:18 UTC (permalink / raw)
  To: netdev; +Cc: davem, kuba, rajur

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")
Signed-off-by: Raju Rangoju <rajur@chelsio.com>
---
 drivers/net/ethernet/chelsio/cxgb4/cxgb4_filter.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_filter.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_filter.c
index bc581b149b11..22c9ac922eba 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_filter.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_filter.c
@@ -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];
 
-- 
2.9.5


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

* Re: [PATCH net] cxgb4: avoid accessing registers when clearing filters
  2021-05-19 11:18 [PATCH net] cxgb4: avoid accessing registers when clearing filters Raju Rangoju
@ 2021-05-19 20:10 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-05-19 20:10 UTC (permalink / raw)
  To: Raju Rangoju; +Cc: netdev, davem, kuba

Hello:

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

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")
> Signed-off-by: Raju Rangoju <rajur@chelsio.com>
> 
> [...]

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



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

end of thread, other threads:[~2021-05-19 20:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-19 11:18 [PATCH net] cxgb4: avoid accessing registers when clearing filters Raju Rangoju
2021-05-19 20:10 ` patchwork-bot+netdevbpf

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.