linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] kernel: auditfilter: looping issue, memory leak if has 2 or more AUDIT_FILTERKEYs
@ 2013-04-10  9:52 Chen Gang
  2013-04-10 10:18 ` Chen Gang
  2013-04-10 20:08 ` [PATCH] kernel: auditfilter: looping issue, memory leak if has 2 or more AUDIT_FILTERKEYs Eric Paris
  0 siblings, 2 replies; 22+ messages in thread
From: Chen Gang @ 2013-04-10  9:52 UTC (permalink / raw)
  To: Al Viro, eparis; +Cc: linux-kernel


  in the 'fcount' looping,
    if 'new->fields[*].type" has 2 or more AUDIT_FILTERKEYs
    need judge new->filterkey whether has value, or memory leak.

Signed-off-by: Chen Gang <gang.chen@asianux.com>
---
 kernel/auditfilter.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/kernel/auditfilter.c b/kernel/auditfilter.c
index f9fc54b..936ac79 100644
--- a/kernel/auditfilter.c
+++ b/kernel/auditfilter.c
@@ -859,6 +859,8 @@ struct audit_entry *audit_dupe_rule(struct audit_krule *old)
 						       &old->fields[i]);
 			break;
 		case AUDIT_FILTERKEY:
+			if (new->filterkey)
+				break;
 			fk = kstrdup(old->filterkey, GFP_KERNEL);
 			if (unlikely(!fk))
 				err = -ENOMEM;
-- 
1.7.7.6

^ permalink raw reply related	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2013-04-17  4:24 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-10  9:52 [PATCH] kernel: auditfilter: looping issue, memory leak if has 2 or more AUDIT_FILTERKEYs Chen Gang
2013-04-10 10:18 ` Chen Gang
2013-04-10 10:28   ` Chen Gang
2013-04-10 10:36     ` Chen Gang
2013-04-10 21:38       ` Eric Paris
2013-04-11  1:12         ` Chen Gang
2013-04-10 21:32     ` Eric Paris
2013-04-11  3:43       ` Chen Gang
2013-04-10 20:29   ` Eric Paris
2013-04-11  3:55     ` Chen Gang
2013-04-10 21:19   ` Eric Paris
2013-04-11  4:10     ` Chen Gang
2013-04-11 13:40       ` Eric Paris
2013-04-11 14:34         ` Chen Gang
2013-04-11 14:52           ` Chen Gang
2013-04-12  9:42       ` Chen Gang
2013-04-16 10:25         ` Chen Gang
2013-04-16 10:38           ` Chen Gang
2013-04-17  2:41             ` Chen Gang
2013-04-17  4:23               ` [PATCH v2] kernel: auditfilter: resource management, tree and watch will memory leak when failure occurs Chen Gang
2013-04-10 20:08 ` [PATCH] kernel: auditfilter: looping issue, memory leak if has 2 or more AUDIT_FILTERKEYs Eric Paris
2013-04-11  3:56   ` Chen Gang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).