net/packet: fix overflow in check for tp_reserve
authorAndrey Konovalov <andreyknvl@google.com>
Wed, 29 Mar 2017 14:11:22 +0000 (16:11 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 20 Jun 2017 12:04:49 +0000 (14:04 +0200)
commita8069aeebf93c1f3a397364a44cddaa90ff472f3
tree98d5257806a067e98d55ae010abde220ebde8fdc
parent492980ca268c3a213a71f5c0aef116b58c665e16
net/packet: fix overflow in check for tp_reserve

commit bcc5364bdcfe131e6379363f089e7b4108d35b70 upstream.

When calculating po->tp_hdrlen + po->tp_reserve the result can overflow.

Fix by checking that tp_reserve <= INT_MAX on assign.

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: Willy Tarreau <w@1wt.eu>
net/packet/af_packet.c