]> git.itanic.dy.fi Git - linux-stable/commit
net/packet: fix overflow in check for tp_frame_nr
authorAndrey Konovalov <andreyknvl@google.com>
Wed, 29 Mar 2017 14:11:21 +0000 (16:11 +0200)
committerJiri Slaby <jslaby@suse.cz>
Tue, 9 May 2017 06:19:42 +0000 (08:19 +0200)
commit1bfb6e1bc972137a4aa7df3397d5e0fe90e13025
tree67a22e881a71a6da0e97154fb125f6d162f47d7f
parent10e710684943bfd0653d7f0bcf430cdaf25a0d2f
net/packet: fix overflow in check for tp_frame_nr

commit 8f8d28e4d6d815a391285e121c3a53a0b6cb9e7b upstream.

When calculating rb->frames_per_block * req->tp_block_nr the result
can overflow.

Add a check that tp_block_size * tp_block_nr <= UINT_MAX.

Since frames_per_block <= tp_block_size, the expression would
never overflow.

Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
net/packet/af_packet.c