Re: [PATCH net v2 2/3] net/packet: fix overflow in check for tp_frame_nr

2017-03-29 Thread Eric Dumazet
On Wed, 2017-03-29 at 16:11 +0200, Andrey Konovalov wrote: > 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. > > S

[PATCH net v2 2/3] net/packet: fix overflow in check for tp_frame_nr

2017-03-29 Thread Andrey Konovalov
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 --- net/packet/af_packet.c | 2 ++ 1 file ch