[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <51653645.90401@asianux.com>
Date: Wed, 10 Apr 2013 17:52:05 +0800
From: Chen Gang <gang.chen@...anux.com>
To: Al Viro <viro@...iv.linux.org.uk>, eparis@...hat.com
CC: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: [PATCH] kernel: auditfilter: looping issue, memory leak if has 2
or more AUDIT_FILTERKEYs
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@...anux.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists