]> git.baikalelectronics.ru Git - kernel.git/commit
packet: unconditionally free po->rollover
authorWillem de Bruijn <willemb@google.com>
Fri, 31 May 2019 16:37:23 +0000 (12:37 -0400)
committerDavid S. Miller <davem@davemloft.net>
Mon, 3 Jun 2019 01:10:14 +0000 (18:10 -0700)
commit08650c44833695e7975927d51789588604fab5dd
tree626dcaed42ebd07593d937544ee61346102ea05c
parent14c83c02797144923ec73a2315d628807e7a20c0
packet: unconditionally free po->rollover

Rollover used to use a complex RCU mechanism for assignment, which had
a race condition. The below patch fixed the bug and greatly simplified
the logic.

The feature depends on fanout, but the state is private to the socket.
Fanout_release returns f only when the last member leaves and the
fanout struct is to be freed.

Destroy rollover unconditionally, regardless of fanout state.

Fixes: 416f854465e13 ("packet: fix crash in fanout_demux_rollover()")
Reported-by: syzbot <syzkaller@googlegroups.com>
Diagnosed-by: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/packet/af_packet.c