From: Leon Romanovsky <leon@kernel.org>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: Leon Romanovsky <leonro@mellanox.com>,
David Ahern <dsahern@gmail.com>, netdev <netdev@vger.kernel.org>,
RDMA mailing list <linux-rdma@vger.kernel.org>
Subject: [PATCH iproute2-rc] rdma: Fix incorrectly handled NLA validation
Date: Sun, 30 Dec 2018 15:34:09 +0200 [thread overview]
Message-ID: <20181230133409.20446-1-leon@kernel.org> (raw)
From: Leon Romanovsky <leonro@mellanox.com>
mnl_attr_type_valid() receives maximum attribute type, which means that
we were supposed to supply the latest valid netlink attribute and not
the number of attributes. Such coding mistake caused to failures while
NLA attributes were extended.
Fixes: 74bd75c2b68d ("rdma: Add basic infrastructure for RDMA tool")
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
---
rdma/utils.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/rdma/utils.c b/rdma/utils.c
index 61f4aeb1..069d44fe 100644
--- a/rdma/utils.c
+++ b/rdma/utils.c
@@ -425,8 +425,8 @@ int rd_attr_cb(const struct nlattr *attr, void *data)
const struct nlattr **tb = data;
int type;
- if (mnl_attr_type_valid(attr, RDMA_NLDEV_ATTR_MAX) < 0)
- /* We received uknown attribute */
+ if (mnl_attr_type_valid(attr, RDMA_NLDEV_ATTR_MAX - 1) < 0)
+ /* We received unknown attribute */
return MNL_CB_OK;
type = mnl_attr_get_type(attr);
reply other threads:[~2018-12-30 13:34 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20181230133409.20446-1-leon@kernel.org \
--to=leon@kernel.org \
--cc=dsahern@gmail.com \
--cc=leonro@mellanox.com \
--cc=linux-rdma@vger.kernel.org \
--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).