netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH iproute2] iplink: validate maximum gso_max_size
@ 2017-12-12 22:25 Solio Sarabia
  2017-12-15  2:24 ` Stephen Hemminger
  0 siblings, 1 reply; 2+ messages in thread
From: Solio Sarabia @ 2017-12-12 22:25 UTC (permalink / raw)
  To: stephen; +Cc: netdev, solio.sarabia

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 <solio.sarabia@intel.com>
---
 ip/iplink.c           | 3 ++-
 man/man8/ip-link.8.in | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/ip/iplink.c b/ip/iplink.c
index 6379b16..62bf713 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 0db2582..40f09b3 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 " ]"
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH iproute2] iplink: validate maximum gso_max_size
  2017-12-12 22:25 [PATCH iproute2] iplink: validate maximum gso_max_size Solio Sarabia
@ 2017-12-15  2:24 ` Stephen Hemminger
  0 siblings, 0 replies; 2+ messages in thread
From: Stephen Hemminger @ 2017-12-15  2:24 UTC (permalink / raw)
  To: Solio Sarabia; +Cc: netdev

On Tue, 12 Dec 2017 14:25:22 -0800
Solio Sarabia <solio.sarabia@intel.com> wrote:

> 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 <solio.sarabia@intel.com>
> ---

Applied to net-next

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-12-15  2:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-12 22:25 [PATCH iproute2] iplink: validate maximum gso_max_size Solio Sarabia
2017-12-15  2:24 ` Stephen Hemminger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).