Patch "net: rtm_to_ifaddr: free ifa if ifa_cacheinfo processing fails" has been added to the 3.10-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    net: rtm_to_ifaddr: free ifa if ifa_cacheinfo processing fails

to the 3.10-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     net-rtm_to_ifaddr-free-ifa-if-ifa_cacheinfo-processing-fails.patch
and it can be found in the queue-3.10 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.


>From cbb94deff5aca631a841fc87fb09d1b2263ecc99 Mon Sep 17 00:00:00 2001
From: Daniel Borkmann <dborkman@xxxxxxxxxx>
Date: Fri, 2 Aug 2013 11:32:43 +0200
Subject: net: rtm_to_ifaddr: free ifa if ifa_cacheinfo processing fails

From: Daniel Borkmann <dborkman@xxxxxxxxxx>

[ Upstream commit 446266b0c742a2c9ee8f0dce759a0117bce58a86 ]

Commit 5c766d642 ("ipv4: introduce address lifetime") leaves the ifa
resource that was allocated via inet_alloc_ifa() unfreed when returning
the function with -EINVAL. Thus, free it first via inet_free_ifa().

Signed-off-by: Daniel Borkmann <dborkman@xxxxxxxxxx>
Reviewed-by: Jiri Pirko <jiri@xxxxxxxxxxx>
Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 net/ipv4/devinet.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
@@ -771,7 +771,7 @@ static struct in_ifaddr *rtm_to_ifaddr(s
 		ci = nla_data(tb[IFA_CACHEINFO]);
 		if (!ci->ifa_valid || ci->ifa_prefered > ci->ifa_valid) {
 			err = -EINVAL;
-			goto errout;
+			goto errout_free;
 		}
 		*pvalid_lft = ci->ifa_valid;
 		*pprefered_lft = ci->ifa_prefered;
@@ -779,6 +779,8 @@ static struct in_ifaddr *rtm_to_ifaddr(s
 
 	return ifa;
 
+errout_free:
+	inet_free_ifa(ifa);
 errout:
 	return ERR_PTR(err);
 }


Patches currently in stable-queue which might be from dborkman@xxxxxxxxxx are

queue-3.10/packet-restore-packet-statistics-tp_packets-to-include-drops.patch
queue-3.10/net-bridge-convert-mldv2-query-mrc-into-msecs_to_jiffies-for-max_delay.patch
queue-3.10/net-ipv6-tcp-fix-potential-use-after-free-in-tcp_v6_do_rcv.patch
queue-3.10/net-rtm_to_ifaddr-free-ifa-if-ifa_cacheinfo-processing-fails.patch
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]