From: Jiri Pirko <jiri@resnulli.us>
To: netdev@vger.kernel.org
Cc: stephen@networkplumber.org, dsahern@gmail.com,
alexanderk@mellanox.com, mlxsw@mellanox.com
Subject: [patch iproute2] tc: m_action: check cookie hex string len
Date: Mon, 27 Apr 2020 08:10:55 +0200 [thread overview]
Message-ID: <20200427061055.4058-1-jiri@resnulli.us> (raw)
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
next reply other threads:[~2020-04-27 6:11 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-27 6:10 Jiri Pirko [this message]
2020-04-28 1:14 ` [patch iproute2] tc: m_action: check cookie hex string len Stephen Hemminger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200427061055.4058-1-jiri@resnulli.us \
--to=jiri@resnulli.us \
--cc=alexanderk@mellanox.com \
--cc=dsahern@gmail.com \
--cc=mlxsw@mellanox.com \
--cc=netdev@vger.kernel.org \
--cc=stephen@networkplumber.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).