netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [iproute PATCH] tc: don't accept qdisc 'handle' greater than ffff
@ 2016-09-16  8:30 Davide Caratti
  2016-09-18 19:47 ` Phil Sutter
  2016-09-20 16:46 ` Stephen Hemminger
  0 siblings, 2 replies; 3+ messages in thread
From: Davide Caratti @ 2016-09-16  8:30 UTC (permalink / raw)
  To: netdev; +Cc: Stephen Hemminger, Phil Sutter, Hangbin Liu

since get_qdisc_handle() truncates the input value to 16 bit, return an
error and prompt "invalid qdisc ID" in case input 'handle' parameter needs
more than 16 bit to be stored.

Signed-off-by: Davide Caratti <dcaratti@redhat.com>
---
 tc/tc_util.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tc/tc_util.c b/tc/tc_util.c
index 15e49b7..24ca1f1 100644
--- a/tc/tc_util.c
+++ b/tc/tc_util.c
@@ -82,7 +82,7 @@ int get_qdisc_handle(__u32 *h, const char *str)
 	if (strcmp(str, "none") == 0)
 		goto ok;
 	maj = strtoul(str, &p, 16);
-	if (p == str)
+	if (p == str || maj >= (1 << 16))
 		return -1;
 	maj <<= 16;
 	if (*p != ':' && *p != 0)
-- 
2.5.5

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

* Re: [iproute PATCH] tc: don't accept qdisc 'handle' greater than ffff
  2016-09-16  8:30 [iproute PATCH] tc: don't accept qdisc 'handle' greater than ffff Davide Caratti
@ 2016-09-18 19:47 ` Phil Sutter
  2016-09-20 16:46 ` Stephen Hemminger
  1 sibling, 0 replies; 3+ messages in thread
From: Phil Sutter @ 2016-09-18 19:47 UTC (permalink / raw)
  To: Davide Caratti; +Cc: netdev, Stephen Hemminger, Hangbin Liu

On Fri, Sep 16, 2016 at 10:30:00AM +0200, Davide Caratti wrote:
> since get_qdisc_handle() truncates the input value to 16 bit, return an
> error and prompt "invalid qdisc ID" in case input 'handle' parameter needs
> more than 16 bit to be stored.
> 
> Signed-off-by: Davide Caratti <dcaratti@redhat.com>

Acked-by: Phil Sutter <phil@nwl.cc>

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

* Re: [iproute PATCH] tc: don't accept qdisc 'handle' greater than ffff
  2016-09-16  8:30 [iproute PATCH] tc: don't accept qdisc 'handle' greater than ffff Davide Caratti
  2016-09-18 19:47 ` Phil Sutter
@ 2016-09-20 16:46 ` Stephen Hemminger
  1 sibling, 0 replies; 3+ messages in thread
From: Stephen Hemminger @ 2016-09-20 16:46 UTC (permalink / raw)
  To: Davide Caratti; +Cc: netdev, Phil Sutter, Hangbin Liu

On Fri, 16 Sep 2016 10:30:00 +0200
Davide Caratti <dcaratti@redhat.com> wrote:

> since get_qdisc_handle() truncates the input value to 16 bit, return an
> error and prompt "invalid qdisc ID" in case input 'handle' parameter needs
> more than 16 bit to be stored.
> 
> Signed-off-by: Davide Caratti <dcaratti@redhat.com>

Applied

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

end of thread, other threads:[~2016-09-20 16:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-16  8:30 [iproute PATCH] tc: don't accept qdisc 'handle' greater than ffff Davide Caratti
2016-09-18 19:47 ` Phil Sutter
2016-09-20 16:46 ` 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).