[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1333940074-19052-8-git-send-email-namhyung.kim@lge.com>
Date: Mon, 9 Apr 2012 11:54:34 +0900
From: Namhyung Kim <namhyung.kim@....com>
To: Steven Rostedt <rostedt@...dmis.org>,
Frederic Weisbecker <fweisbec@...il.com>,
Ingo Molnar <mingo@...nel.org>
Cc: Arnaldo Carvalho de Melo <acme@...radead.org>,
Borislav Petkov <bp@...en8.de>,
David Ahern <dsahern@...il.com>,
LKML <linux-kernel@...r.kernel.org>
Subject: [PATCH 7/7] parse-events: Fix a possibly wrong memory dereference
If set_op_prio() failed, the token will be freed at out_free,
then arg->op.op would turn out to be a dangle pointer. After
returning EVENT_ERROR from process_op(), free_arg() will be
called and then it will finally see the dangling pointer.
Signed-off-by: Namhyung Kim <namhyung.kim@....com>
---
parse-events.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/parse-events.c b/parse-events.c
index e789275..bd078ba 100644
--- a/parse-events.c
+++ b/parse-events.c
@@ -1741,6 +1741,8 @@ process_op(struct event_format *event, struct print_arg *arg, char **tok)
if (set_op_prio(arg) == -1) {
event->flags |= EVENT_FL_FAILED;
+ /* arg->op.op (= token) will be freed at out_free */
+ arg->op.op = NULL;
goto out_free;
}
--
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