Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759924AbZDLKHj (ORCPT ); Sun, 12 Apr 2009 06:07:39 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755620AbZDLKHa (ORCPT ); Sun, 12 Apr 2009 06:07:30 -0400 Received: from hera.kernel.org ([140.211.167.34]:53499 "EHLO hera.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754339AbZDLKH3 (ORCPT ); Sun, 12 Apr 2009 06:07:29 -0400 Date: Sun, 12 Apr 2009 10:06:47 GMT From: Li Zefan To: linux-tip-commits@vger.kernel.org Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@redhat.com, tzanussi@gmail.com, lizf@cn.fujitsu.com, fweisbec@gmail.com, rostedt@goodmis.org, tglx@linutronix.de, mingo@elte.hu Reply-To: mingo@redhat.com, hpa@zytor.com, linux-kernel@vger.kernel.org, fweisbec@gmail.com, tzanussi@gmail.com, rostedt@goodmis.org, lizf@cn.fujitsu.com, tglx@linutronix.de, mingo@elte.hu In-Reply-To: <49E04C43.1050504@cn.fujitsu.com> References: <49E04C43.1050504@cn.fujitsu.com> Subject: [tip:tracing/urgent] tracing/filters: fix NULL pointer dereference Message-ID: Git-Commit-ID: bcabd91c271e50eebc0cb9220ac92700332b452e X-Mailer: tip-git-log-daemon MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.0 (hera.kernel.org [127.0.0.1]); Sun, 12 Apr 2009 10:06:49 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1606 Lines: 48 Commit-ID: bcabd91c271e50eebc0cb9220ac92700332b452e Gitweb: http://git.kernel.org/tip/bcabd91c271e50eebc0cb9220ac92700332b452e Author: Li Zefan AuthorDate: Sat, 11 Apr 2009 15:52:35 +0800 Committer: Ingo Molnar CommitDate: Sun, 12 Apr 2009 11:59:28 +0200 tracing/filters: fix NULL pointer dereference Try this, and you'll see NULL pointer dereference bug: # echo -n 'parent_comm ==' > sched/sched_process_fork/filter Because we passed NULL ptr to simple_strtoull(). Signed-off-by: Li Zefan Acked-by: Tom Zanussi Acked-by: Frederic Weisbecker Cc: Steven Rostedt LKML-Reference: <49E04C43.1050504@cn.fujitsu.com> Signed-off-by: Ingo Molnar --- kernel/trace/trace_events_filter.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/kernel/trace/trace_events_filter.c b/kernel/trace/trace_events_filter.c index 026be41..9d2162f 100644 --- a/kernel/trace/trace_events_filter.c +++ b/kernel/trace/trace_events_filter.c @@ -410,6 +410,11 @@ int filter_parse(char **pbuf, struct filter_pred *pred) } } + if (!val_str) { + pred->field_name = NULL; + return -EINVAL; + } + pred->field_name = kstrdup(pred->field_name, GFP_KERNEL); if (!pred->field_name) return -ENOMEM; -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/