netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch iproute2] tc: m_action: check cookie hex string len
@ 2020-04-27  6:10 Jiri Pirko
  2020-04-28  1:14 ` Stephen Hemminger
  0 siblings, 1 reply; 2+ messages in thread
From: Jiri Pirko @ 2020-04-27  6:10 UTC (permalink / raw)
  To: netdev; +Cc: stephen, dsahern, alexanderk, mlxsw

From: Jiri Pirko <jiri@mellanox.com>

Check the cookie hex string len is dividable by 2 as the valid hex
string always should be.

Reported-by: Alex Kushnarov <alexanderk@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
---
 tc/m_action.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tc/m_action.c b/tc/m_action.c
index 108329db29d0..b41782de9a02 100644
--- a/tc/m_action.c
+++ b/tc/m_action.c
@@ -291,7 +291,8 @@ done0:
 					invarg(cookie_err_m, *argv);
 				}
 
-				if (hex2mem(*argv, act_ck, slen / 2) < 0)
+				if (slen % 2 ||
+				    hex2mem(*argv, act_ck, slen / 2) < 0)
 					invarg("cookie must be a hex string\n",
 					       *argv);
 
-- 
2.21.1


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

* Re: [patch iproute2] tc: m_action: check cookie hex string len
  2020-04-27  6:10 [patch iproute2] tc: m_action: check cookie hex string len Jiri Pirko
@ 2020-04-28  1:14 ` Stephen Hemminger
  0 siblings, 0 replies; 2+ messages in thread
From: Stephen Hemminger @ 2020-04-28  1:14 UTC (permalink / raw)
  To: Jiri Pirko; +Cc: netdev, dsahern, alexanderk, mlxsw

On Mon, 27 Apr 2020 08:10:55 +0200
Jiri Pirko <jiri@resnulli.us> wrote:

> From: Jiri Pirko <jiri@mellanox.com>
> 
> Check the cookie hex string len is dividable by 2 as the valid hex
> string always should be.
> 
> Reported-by: Alex Kushnarov <alexanderk@mellanox.com>
> Signed-off-by: Jiri Pirko <jiri@mellanox.com>
> ---

Applied

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

end of thread, other threads:[~2020-04-28  1:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-27  6:10 [patch iproute2] tc: m_action: check cookie hex string len Jiri Pirko
2020-04-28  1:14 ` 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).