Skip to contentSkip to conversation

: Fix inet6_dev reference leak in ndisc_dst_alloc error path

PATCH Applied Patrick McHardy 2 participants 2 messages Oct 19, 2004 – Oct 21, 2004

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 : Fix inet6_dev reference leak in ndisc_dst_alloc error path

ndisc_dst_alloc leaks a inet6_dev reference when ip6_dst_alloc returns NULL. The bug was introduced somewhere between 2.6.8 and 2.6.9.

Regards
Patrick

# This is a BitKeeper generated diff -Nru style patch. #
# ChangeSet
# 2004/10/19 23:13:24+02:00 [email protected]
# [IPV6]: Fix inet6_dev reference leak in ndisc_dst_alloc error path
#
# Signed-off-by: Patrick McHardy <[email protected]>
#

# net/ipv6/route.c
#   2004/10/19 23:12:48+02:00 [email protected] +3 -1
#   [IPV6]: Fix inet6_dev reference leak in ndisc_dst_alloc error path
#   
#   Signed-off-by: Patrick McHardy <[email protected]>
# 
diff -Nru a/net/ipv6/route.c b/net/ipv6/route.c
--- a/net/ipv6/route.c	2004-10-19 23:51:11 +02:00
+++ b/net/ipv6/route.c	2004-10-19 23:51:11 +02:00
@@ -647,8 +647,10 @@
 		return NULL;

rt = ip6_dst_alloc();
- if (unlikely(rt == NULL))
+ if (unlikely(rt == NULL)) {
+ in6_dev_put(idev);
goto out;
+ }

dev_hold(dev);
if (neigh)

maintainer Applied
#1 lore raw
Quoted 3 lines · On Wed, 20 Oct 2004 00:02:31 +0200 Patrick McHardy <[email protected]> wrote:

ndisc_dst_alloc leaks a inet6_dev reference when ip6_dst_alloc returns NULL. The bug was introduced somewhere between 2.6.8 and 2.6.9.

Applied, thanks Patrick.