]> git.ipfire.org Git - thirdparty/kernel/stable.git/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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 May 2017 15:37:39 +0000 (08:37 -0700)
commit57a88382a9692c123e98be64c64535088c442c0e
tree0fdf959d4c3633dd031e4cc5db2753ef9273dc9f
parent5894337297adb61b8b90108a5be4cead6fe6a595
net/packet: fix overflow in check for tp_frame_nr

[ Upstream commit 8f8d28e4d6d815a391285e121c3a53a0b6cb9e7b ]

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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/packet/af_packet.c