mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-07 12:25:00 -04:00
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: 57f015f5ec ("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>
This commit is contained in:
parent
8c26859819
commit
afa0925c6f
1 changed files with 1 additions and 1 deletions
|
|
@ -3014,8 +3014,8 @@ static int packet_release(struct socket *sock)
|
|||
|
||||
synchronize_net();
|
||||
|
||||
kfree(po->rollover);
|
||||
if (f) {
|
||||
kfree(po->rollover);
|
||||
fanout_release_data(f);
|
||||
kfree(f);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue