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 <>
Acked-by: Eric Dumazet <>

(am from

TEST=kernel compiles

Change-Id: Ibbd6c5ae89957d11a52a673e56ad6f09025de708
Reviewed-by: Guenter Roeck <>
Commit-Queue: Andrey Ulanov <>
Tested-by: Andrey Ulanov <>
1 file changed