Skip to content

Commit ded8b9c

Browse files
ecree-solarflaredavem330
authored andcommitted
sfc: Use filter index rather than ID for rps_flow_id table
efx->type->filter_insert() returns an ID rather than the index that efx->type->filter_async_insert() used to, which causes it to exceed efx->type->max_rx_ip_filters on some EF10 configurations, leading to out- of-bounds array writes. So, in efx_filter_rfs_work(), convert this back into an index (which is what the remove call in the expiry path expects, anyway). Fixes: 3af0f34 ("sfc: replace asynchronous filter operations") Signed-off-by: Edward Cree <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 988bf72 commit ded8b9c

File tree

1 file changed

+2
-0
lines changed
  • drivers/net/ethernet/sfc

1 file changed

+2
-0
lines changed

drivers/net/ethernet/sfc/rx.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -839,6 +839,8 @@ static void efx_filter_rfs_work(struct work_struct *data)
839839
int rc;
840840

841841
rc = efx->type->filter_insert(efx, &req->spec, true);
842+
if (rc >= 0)
843+
rc %= efx->type->max_rx_ip_filters;
842844
if (efx->rps_hash_table) {
843845
spin_lock_bh(&efx->rps_hash_lock);
844846
rule = efx_rps_hash_find(efx, &req->spec);

0 commit comments

Comments
 (0)