diff options
author | David S. Miller <davem@davemloft.net> | 2018-04-28 03:21:08 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-04-28 03:21:08 +0300 |
commit | 1d39fd1bedbde2adfb57ef443c7688e85d547d6a (patch) | |
tree | 96c03383038a6f2fdddd3cd1864e389232fb004b | |
parent | 988bf7243e03ef69238381594e0334a79cef74a6 (diff) | |
parent | 987c658a61f432804c4662b736dbd5fc5939af1f (diff) | |
download | linux-1d39fd1bedbde2adfb57ef443c7688e85d547d6a.tar.xz |
Merge branch 'sfc-more-ARFS-fixes'
Edward Cree says:
====================
sfc: more ARFS fixes
A couple more bits of breakage in my recent ARFS and async filters work.
Patch #1 in particular fixes a bug that leads to memory trampling and
consequent crashes.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/sfc/ef10.c | 5 | ||||
-rw-r--r-- | drivers/net/ethernet/sfc/rx.c | 2 |
2 files changed, 5 insertions, 2 deletions
diff --git a/drivers/net/ethernet/sfc/ef10.c b/drivers/net/ethernet/sfc/ef10.c index 63036d9bf3e6..d90a7b1f4088 100644 --- a/drivers/net/ethernet/sfc/ef10.c +++ b/drivers/net/ethernet/sfc/ef10.c @@ -4784,8 +4784,9 @@ expire: * will set rule->filter_id to EFX_ARFS_FILTER_ID_PENDING, meaning that * the rule is not removed by efx_rps_hash_del() below. */ - ret = efx_ef10_filter_remove_internal(efx, 1U << spec->priority, - filter_idx, true) == 0; + if (ret) + ret = efx_ef10_filter_remove_internal(efx, 1U << spec->priority, + filter_idx, true) == 0; /* While we can't safely dereference rule (we dropped the lock), we can * still test it for NULL. */ diff --git a/drivers/net/ethernet/sfc/rx.c b/drivers/net/ethernet/sfc/rx.c index 64a94f242027..d2e254f2f72b 100644 --- a/drivers/net/ethernet/sfc/rx.c +++ b/drivers/net/ethernet/sfc/rx.c @@ -839,6 +839,8 @@ static void efx_filter_rfs_work(struct work_struct *data) int rc; rc = efx->type->filter_insert(efx, &req->spec, true); + if (rc >= 0) + rc %= efx->type->max_rx_ip_filters; if (efx->rps_hash_table) { spin_lock_bh(&efx->rps_hash_lock); rule = efx_rps_hash_find(efx, &req->spec); |