packet: fix races in fanout_add()
Multiple threads can call fanout_add() at the same time. We need to grab fanout_mutex earlier to avoid races that could lead to one thread freeing po->rollover that was set by another thread. Do the same in fanout_release(), for peace of mind, and to help us finding lockdep issues earlier. Change-Id: Ie773328bb8b39ad04d73e35b6f8ec10716a8d9a1 Fixes: dc99f600 ("packet: Add fanout support.") Fixes: 0648ab70afe6 ("packet: rollover prepare: per-socket state") Signed-off-by:Eric Dumazet <edumazet@google.com> Cc: Willem de Bruijn <willemb@google.com> Signed-off-by:
David S. Miller <davem@davemloft.net> Git-commit: d199fab63c11998a602205f7ee7ff7c05c97164b Git-repo: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git [tejaswit@codeaurora.org: rollover support not present in branch, these parts removed from patch. ] Signed-off-by:
Tejaswi Tanikella <tejaswit@codeaurora.org>
Loading
Please register or sign in to comment