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]
Date:   Tue, 20 Feb 2018 14:47:18 +0200
From:   Leon Romanovsky <leon@...nel.org>
To:     Stephen Hemminger <stephen@...workplumber.org>
Cc:     Leon Romanovsky <leonro@...lanox.com>,
        David Ahern <dsahern@...il.com>,
        netdev <netdev@...r.kernel.org>
Subject: [PATCH iproute2] rdma: Avoid memory leak for skipper resource

From: Leon Romanovsky <leonro@...lanox.com>

The call to get_task_name() allocates memory which is not freed
in case of skipping the object.

Fixes: 8ecac46a60ff ("rdma: Add QP resource tracking information")
Signed-off-by: Leon Romanovsky <leonro@...lanox.com>
---
 rdma/res.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/rdma/res.c b/rdma/res.c
index 2a63e712..62f5c544 100644
--- a/rdma/res.c
+++ b/rdma/res.c
@@ -395,8 +395,10 @@ static int res_qp_parse_cb(const struct nlmsghdr *nlh, void *data)
 			comm = get_task_name(pid);
 		}

-		if (rd_check_is_filtered(rd, "pid", pid))
+		if (rd_check_is_filtered(rd, "pid", pid)) {
+			free(comm);
 			continue;
+		}

 		if (nla_line[RDMA_NLDEV_ATTR_RES_KERN_NAME])
 			/* discard const from mnl_attr_get_str */
--
2.16.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ