Commit ff3b6715 authored by Eric Dumazet's avatar Eric Dumazet Committed by Kleber Sacilotto de Souza

bnxt: add a missing rcu synchronization

BugLink: https://bugs.launchpad.net/bugs/1878232

commit e5f6f564 upstream.

Add a missing synchronize_net() call to avoid potential use after free,
since we explicitly call napi_hash_del() to factorize the RCU grace
period.

Fixes: c0c050c5 ("bnxt_en: New Broadcom ethernet driver.")
Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Cc: Michael Chan <michael.chan@broadcom.com>
Acked-by: default avatarMichael Chan <michael.chan@broadcom.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarIan May <ian.may@canonical.com>
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
parent 65b9ba39
......@@ -4250,6 +4250,10 @@ static void bnxt_del_napi(struct bnxt *bp)
napi_hash_del(&bnapi->napi);
netif_napi_del(&bnapi->napi);
}
/* We called napi_hash_del() before netif_napi_del(), we need
* to respect an RCU grace period before freeing napi structures.
*/
synchronize_net();
}
static void bnxt_init_napi(struct bnxt *bp)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment