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: <AANLkTi==t8MGGLDxMLZsHtRoLqwhgNskU83wBw7-+ZyJ@mail.gmail.com>
Date:	Sun, 8 Aug 2010 21:34:12 +0800
From:	Zhang JieJing <kzjeef@...il.com>
To:	netdev@...r.kernel.org
Cc:	Dan Carpenter <error27@...il.com>, Zhang Jiejing <kzjeef@...il.com>
Subject: [PATCH] xfrm: fix a possible leak of dev reference count.

call dev_put(dev) on error path.

Signed-off-by: JieJing.Zhang <kzjeef@...il.com>
---
 net/ipv4/xfrm4_policy.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/net/ipv4/xfrm4_policy.c b/net/ipv4/xfrm4_policy.c
index 1705476..d2a4873 100644
--- a/net/ipv4/xfrm4_policy.c
+++ b/net/ipv4/xfrm4_policy.c
@@ -81,8 +81,10 @@ static int xfrm4_fill_dst(struct xfrm_dst *xdst,
struct net_device *dev,
 	dev_hold(dev);

 	xdst->u.rt.idev = in_dev_get(dev);
-	if (!xdst->u.rt.idev)
+	if (!xdst->u.rt.idev) {
+		dev_put(dev);
 		return -ENODEV;
+	}

 	xdst->u.rt.peer = rt->peer;
 	if (rt->peer)
-- 
1.7.0.4
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists