[Devel] [PATCH RHEL7 COMMIT] vzprivnet: Fix privnet object leak

Konstantin Khorenko khorenko at virtuozzo.com
Thu Mar 24 08:53:32 PDT 2016


The commit is pushed to "branch-rh7-3.10.0-327.10.1.vz7.12.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-327.10.1.vz7.12.3
------>
commit 99a977d8d458872fef06b31b13f7d116f070c02e
Author: Pavel Tikhomirov <ptikhomirov at virtuozzo.com>
Date:   Thu Mar 24 19:53:32 2016 +0400

    vzprivnet: Fix privnet object leak
    
    Port diff-vz-privnet-addnet-leak
      privnet: Fix privnet object leak
    
      In case of manipulating on the existing privnet the pn object is leaked
    
      Taken from 2.6.18-rh5
    
    Signed-off-by: Pavel Tikhomirov <ptikhomirov at virtuozzo.com>
---
 net/ipv4/netfilter/ip_vzprivnet.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/ipv4/netfilter/ip_vzprivnet.c b/net/ipv4/netfilter/ip_vzprivnet.c
index 01933ac..704c38d 100644
--- a/net/ipv4/netfilter/ip_vzprivnet.c
+++ b/net/ipv4/netfilter/ip_vzprivnet.c
@@ -540,6 +540,7 @@ static int sparse_add(unsigned int netid, u32 ip, u32 mask, int weak)
 	write_lock_bh(&vzprivlock);
 	list_for_each_entry(epns, &vzpriv_sparse, list)
 		if (epns->netid == netid) {
+			kfree(pns);
 			pns = epns;
 			goto found_net;
 		}


More information about the Devel mailing list