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

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>

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

BUG=b:36725429
TEST=kernel compiles

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