* [PATCH net] : add a missing rcu synchronization
@ 2016-11-16 14:31 Eric Dumazet
2016-11-16 15:59 ` Michael Chan
2016-11-17 4:31 ` David Miller
0 siblings, 2 replies; 4+ messages in thread
From: Eric Dumazet @ 2016-11-16 14:31 UTC (permalink / raw)
To: David Miller; +Cc: netdev, Michael Chan
From: Eric Dumazet <edumazet@google.com>
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: c0c050c58d84 ("bnxt_en: New Broadcom ethernet driver.")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Michael Chan <michael.chan@broadcom.com>
---
drivers/net/ethernet/broadcom/bnxt/bnxt.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index c6909660e097..e18635b2a002 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -4934,6 +4934,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)
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH net] : add a missing rcu synchronization
2016-11-16 14:31 [PATCH net] : add a missing rcu synchronization Eric Dumazet
@ 2016-11-16 15:59 ` Michael Chan
2016-11-17 4:31 ` David Miller
1 sibling, 0 replies; 4+ messages in thread
From: Michael Chan @ 2016-11-16 15:59 UTC (permalink / raw)
To: Eric Dumazet; +Cc: David Miller, netdev
On Wed, Nov 16, 2016 at 6:31 AM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> From: Eric Dumazet <edumazet@google.com>
>
> 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: c0c050c58d84 ("bnxt_en: New Broadcom ethernet driver.")
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Cc: Michael Chan <michael.chan@broadcom.com>
Thanks. Subject line is missing the driver name. Other than that,
Acked-by: Michael Chan <michael.chan@broadcom.com>
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH net] : add a missing rcu synchronization
2016-11-16 14:31 [PATCH net] : add a missing rcu synchronization Eric Dumazet
2016-11-16 15:59 ` Michael Chan
@ 2016-11-17 4:31 ` David Miller
2016-11-17 4:59 ` Eric Dumazet
1 sibling, 1 reply; 4+ messages in thread
From: David Miller @ 2016-11-17 4:31 UTC (permalink / raw)
To: eric.dumazet; +Cc: netdev, michael.chan
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Wed, 16 Nov 2016 06:31:52 -0800
> From: Eric Dumazet <edumazet@google.com>
>
> 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: c0c050c58d84 ("bnxt_en: New Broadcom ethernet driver.")
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Cc: Michael Chan <michael.chan@broadcom.com>
Applied.
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH net] : add a missing rcu synchronization
2016-11-17 4:31 ` David Miller
@ 2016-11-17 4:59 ` Eric Dumazet
0 siblings, 0 replies; 4+ messages in thread
From: Eric Dumazet @ 2016-11-17 4:59 UTC (permalink / raw)
To: David Miller; +Cc: netdev, michael.chan
On Wed, 2016-11-16 at 23:31 -0500, David Miller wrote:
> From: Eric Dumazet <eric.dumazet@gmail.com>
> Date: Wed, 16 Nov 2016 06:31:52 -0800
>
> > From: Eric Dumazet <edumazet@google.com>
> >
> > 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: c0c050c58d84 ("bnxt_en: New Broadcom ethernet driver.")
> > Signed-off-by: Eric Dumazet <edumazet@google.com>
> > Cc: Michael Chan <michael.chan@broadcom.com>
>
> Applied.
Thanks David for the title fix ;)
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-11-17 4:59 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-16 14:31 [PATCH net] : add a missing rcu synchronization Eric Dumazet
2016-11-16 15:59 ` Michael Chan
2016-11-17 4:31 ` David Miller
2016-11-17 4:59 ` Eric Dumazet
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox