lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20181018123550.20817-1-phil@nwl.cc>
Date:   Thu, 18 Oct 2018 14:35:50 +0200
From:   Phil Sutter <phil@....cc>
To:     Stephen Hemminger <stephen@...workplumber.org>
Cc:     netdev@...r.kernel.org
Subject: [iproute PATCH] rdma: Don't pass garbage to rd_check_is_filtered()

Variables 'src_port' and 'dst_port' are initialized only if attributes
RDMA_NLDEV_ATTR_RES_SRC_ADDR or RDMA_NLDEV_ATTR_RES_DST_ADDR are
present. Make sure to pass them over to rd_check_is_filtered() only if
that is the case.

Fixes: 9a362cc71a455 ("rdma: Add CM_ID resource tracking information")
Signed-off-by: Phil Sutter <phil@....cc>
---
 rdma/res.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/rdma/res.c b/rdma/res.c
index 074b9929a38b2..0d8c1c388c4ca 100644
--- a/rdma/res.c
+++ b/rdma/res.c
@@ -621,6 +621,8 @@ static int res_cm_id_parse_cb(const struct nlmsghdr *nlh, void *data)
 			if (rd_check_is_string_filtered(rd, "src-addr",
 							src_addr_str))
 				continue;
+			if (rd_check_is_filtered(rd, "src-port", src_port))
+				continue;
 		}
 
 		if (nla_line[RDMA_NLDEV_ATTR_RES_DST_ADDR]) {
@@ -630,14 +632,10 @@ static int res_cm_id_parse_cb(const struct nlmsghdr *nlh, void *data)
 			if (rd_check_is_string_filtered(rd, "dst-addr",
 							dst_addr_str))
 				continue;
+			if (rd_check_is_filtered(rd, "dst-port", dst_port))
+				continue;
 		}
 
-		if (rd_check_is_filtered(rd, "src-port", src_port))
-			continue;
-
-		if (rd_check_is_filtered(rd, "dst-port", dst_port))
-			continue;
-
 		if (nla_line[RDMA_NLDEV_ATTR_RES_PID]) {
 			pid = mnl_attr_get_u32(
 					nla_line[RDMA_NLDEV_ATTR_RES_PID]);
-- 
2.19.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ