net/packet: fix 4gb buffer limit due to overflow check
authorKal Conley <kal.conley@dectris.com>
Sun, 10 Feb 2019 08:57:11 +0000 (09:57 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 27 Feb 2019 09:08:58 +0000 (10:08 +0100)
commitc2ee2c708aaea514f6efeb9ecdfc491a4da30b3f
treec9995861cba229a9ebc4e48e9f69f8537442d41b
parentf3ec82db191b74fc9c9f45ddd76870e10bb3d405
net/packet: fix 4gb buffer limit due to overflow check

[ Upstream commit fc62814d690cf62189854464f4bd07457d5e9e50 ]

When calculating rb->frames_per_block * req->tp_block_nr the result
can overflow. Check it for overflow without limiting the total buffer
size to UINT_MAX.

This change fixes support for packet ring buffers >= UINT_MAX.

Fixes: 8f8d28e4d6d8 ("net/packet: fix overflow in check for tp_frame_nr")
Signed-off-by: Kal Conley <kal.conley@dectris.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/packet/af_packet.c