Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752688AbaFFDq1 (ORCPT ); Thu, 5 Jun 2014 23:46:27 -0400 Received: from cdptpa-outbound-snat.email.rr.com ([107.14.166.230]:21423 "EHLO cdptpa-oedge-vip.email.rr.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752088AbaFFDqZ (ORCPT ); Thu, 5 Jun 2014 23:46:25 -0400 Date: Thu, 5 Jun 2014 23:46:23 -0400 From: Steven Rostedt To: Yoshihiro YUNOMAE Cc: Masami Hiramatsu , linux-kernel@vger.kernel.org, Hidehiro Kawai , Ingo Molnar , yrl.pp-manager.tt@hitachi.com Subject: Re: [PATCH ftrace/core 1/3] trace/event: Return error if ftrace_trace_arrays is empty list Message-ID: <20140605234623.484afaf8@gandalf.local.home> In-Reply-To: <20140605223517.32311.99233.stgit@yunodevel> References: <20140605223515.32311.71203.stgit@yunodevel> <20140605223517.32311.99233.stgit@yunodevel> X-Mailer: Claws Mail 3.9.3 (GTK+ 2.24.23; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-RR-Connecting-IP: 107.14.168.142:25 X-Cloudmark-Score: 0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 06 Jun 2014 07:35:17 +0900 Yoshihiro YUNOMAE wrote: > ftrace_trace_arrays links global_trace.list. However, global_trace is not added > to ftrace_trace_arrays if trace_alloc_buffers() failed. As the result, > ftrace_trace_arrays becomes empty list. If ftrace_trace_arrays is empty list, > current top_trace_array() returns invalid pointer. As the result, the kernel > can induce memory corruption or panic. > > Current implementation does not check whether ftrace_trace_arrays is empty > list or not. So, in this patch, if ftrace_trace_arrays is empty list, > top_trace_array() returns NULL. Moreover, this patch makes all functions calling > top_trace_array() handle it appropriately. As I'm still working on some more patches for 3.16, I can add this. It's not that critical, because if global_array fails to allocate on boot up, lots of other things may also break. -- Steve > > Signed-off-by: Yoshihiro YUNOMAE > Cc: Steven Rostedt > Cc: Ingo Molnar > Cc: linux-kernel@vger.kernel.org > --- -- 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/