From: Solio Sarabia Date: Tue, 12 Dec 2017 22:25:22 +0000 (-0800) Subject: iplink: validate maximum gso_max_size X-Git-Tag: v4.16.0~107 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=051274b4db4e4992223d01b004b3d96f1f3f0ef5;p=thirdparty%2Fiproute2.git iplink: validate maximum gso_max_size Validate the upper limit for gso_max_size, valid range is [0-65,536] inclusive. Fix minor whitespace in iplink man page. Signed-off-by: Solio Sarabia --- diff --git a/ip/iplink.c b/ip/iplink.c index 6379b16a1..62bf713d4 100644 --- a/ip/iplink.c +++ b/ip/iplink.c @@ -853,7 +853,8 @@ int iplink_parse(int argc, char **argv, struct iplink_req *req, unsigned int max_size; NEXT_ARG(); - if (get_unsigned(&max_size, *argv, 0) || max_size > UINT16_MAX) + if (get_unsigned(&max_size, *argv, 0) || + max_size > UINT16_MAX + 1) invarg("Invalid \"gso_max_size\" value\n", *argv); addattr32(&req->n, sizeof(*req), IFLA_GSO_MAX_SIZE, max_size); diff --git a/man/man8/ip-link.8.in b/man/man8/ip-link.8.in index 0db2582e1..40f09b30e 100644 --- a/man/man8/ip-link.8.in +++ b/man/man8/ip-link.8.in @@ -36,7 +36,7 @@ ip-link \- network device configuration .RB "[ " numrxqueues .IR QUEUE_COUNT " ]" .br -.BR "[" gso_max_size +.BR "[ " gso_max_size .IR BYTES " ]" .RB "[ " gso_max_segs .IR SEGMENTS " ]"