[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-4a31b424ac0656d1bb17520ee861144fe7a19664@git.kernel.org>
Date: Wed, 15 Nov 2017 00:51:53 -0800
From: tip-bot for Vasily Averin <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: acme@...nel.org, jolsa@...hat.com, peterz@...radead.org,
torvalds@...ux-foundation.org, namhyung@...nel.org,
linux-kernel@...r.kernel.org, mingo@...nel.org,
alexander.shishkin@...ux.intel.com, tglx@...utronix.de,
hbathini@...ux.vnet.ibm.com, vvs@...tuozzo.com, hpa@...or.com
Subject: [tip:perf/urgent] perf/core: Fix memory leak triggered by perf
--namespace
Commit-ID: 4a31b424ac0656d1bb17520ee861144fe7a19664
Gitweb: https://git.kernel.org/tip/4a31b424ac0656d1bb17520ee861144fe7a19664
Author: Vasily Averin <vvs@...tuozzo.com>
AuthorDate: Wed, 15 Nov 2017 08:47:02 +0300
Committer: Ingo Molnar <mingo@...nel.org>
CommitDate: Wed, 15 Nov 2017 09:48:10 +0100
perf/core: Fix memory leak triggered by perf --namespace
perf with --namespace key leaks various memory objects including namespaces
4.14.0+
pid_namespace 1 12 2568 12 8
user_namespace 1 39 824 39 8
net_namespace 1 5 6272 5 8
This happen because perf_fill_ns_link_info() struct patch ns_path:
during initialization ns_path incremented counters on related mnt and dentry,
but without lost path_put nobody decremented them back.
Leaked dentry is name of related namespace,
and its leak does not allow to free unused namespace.
Signed-off-by: Vasily Averin <vvs@...tuozzo.com>
Acked-by: Peter Zijlstra <peterz@...radead.org>
Cc: Alexander Shishkin <alexander.shishkin@...ux.intel.com>
Cc: Arnaldo Carvalho de Melo <acme@...nel.org>
Cc: Hari Bathini <hbathini@...ux.vnet.ibm.com>
Cc: Jiri Olsa <jolsa@...hat.com>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Namhyung Kim <namhyung@...nel.org>
Cc: Thomas Gleixner <tglx@...utronix.de>
Fixes: commit e422267322cd ("perf: Add PERF_RECORD_NAMESPACES to include namespaces related info")
Link: http://lkml.kernel.org/r/c510711b-3904-e5e1-d296-61273d21118d@virtuozzo.com
Signed-off-by: Ingo Molnar <mingo@...nel.org>
---
kernel/events/core.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/kernel/events/core.c b/kernel/events/core.c
index 10cdb9c..ab5ac84 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -6756,6 +6756,7 @@ static void perf_fill_ns_link_info(struct perf_ns_link_info *ns_link_info,
ns_inode = ns_path.dentry->d_inode;
ns_link_info->dev = new_encode_dev(ns_inode->i_sb->s_dev);
ns_link_info->ino = ns_inode->i_ino;
+ path_put(&ns_path);
}
}
Powered by blists - more mailing lists