FROMLIST: net/packet: fix overflow in check for tp_frame_nr

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>

(am from https://patchwork.ozlabs.org/patch/744813/)

BUG=b:36725429
TEST=kernel compiles

Change-Id: Ibbd6c5ae89957d11a52a673e56ad6f09025de708
Reviewed-on: https://chromium-review.googlesource.com/462400
Reviewed-by: Guenter Roeck <groeck@chromium.org>
Commit-Queue: Andrey Ulanov <andreyu@google.com>
Tested-by: Andrey Ulanov <andreyu@google.com>
1 file changed