提交 59f21118 编写于 作者: W Willem de Bruijn 提交者: David S. Miller

packet: free packet_rollover after synchronize_net

Destruction of the po->rollover must be delayed until there are no
more packets in flight that can access it. The field is destroyed in
packet_release, before synchronize_net. Delay using rcu.

Fixes: 0648ab70 ("packet: rollover prepare: per-socket state")
Suggested-by: NEric Dumazet <edumazet@google.com>
Signed-off-by: NWillem de Bruijn <willemb@google.com>
Acked-by: NEric Dumazet <edumazet@google.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 12011962
......@@ -1634,7 +1634,8 @@ static void fanout_release(struct sock *sk)
}
mutex_unlock(&fanout_mutex);
kfree(po->rollover);
if (po->rollover)
kfree_rcu(po->rollover, rcu);
}
static const struct proto_ops packet_ops;
......
......@@ -89,6 +89,7 @@ struct packet_fanout {
struct packet_rollover {
int sock;
struct rcu_head rcu;
atomic_long_t num;
atomic_long_t num_huge;
atomic_long_t num_failed;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册