diff options
| author | Willem de Bruijn <willemb@google.com> | 2015-06-17 15:59:34 -0400 |
|---|---|---|
| committer | Moyster <oysterized@gmail.com> | 2016-08-26 19:17:20 +0200 |
| commit | 4af88096d06090244ca0274de574722fae9fa73e (patch) | |
| tree | 8012b2ce8e593637300e3b99aeeb1f9b6f7b8047 /scripts | |
| parent | b5b05833b4a431b5a82bec380296e8d684b3c461 (diff) | |
packet: avoid out of bounds read in round robin fanout
[ Upstream commit 468479e6043c84f5a65299cc07cb08a22a28c2b1 ]
PACKET_FANOUT_LB computes f->rr_cur such that it is modulo
f->num_members. It returns the old value unconditionally, but
f->num_members may have changed since the last store. Ensure
that the return value is always < num.
When modifying the logic, simplify it further by replacing the loop
with an unconditional atomic increment.
Fixes: dc99f600698d ("packet: Add fanout support.")
Suggested-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Willem de Bruijn <willemb@google.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Stefan Guendhoer <stefan@guendhoer.com>
Diffstat (limited to 'scripts')
0 files changed, 0 insertions, 0 deletions
