From nobody Mon Apr 13 13:15:57 2026 Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 638BA26B764 for ; Sat, 7 Mar 2026 15:33:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=216.40.44.15 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772897585; cv=none; b=qWSMCaLDyeXxNvY43+/dHMhh7jTFGwoOepVwow0h/UVsmKD/T3ACyZnncF9KOt7PSrJvO7letaZX4+1gYmhe8IB+RJjn+mMgpkWDwJoRZSRpZ3Ex0ErYy5vtDPh2bFPxRfE0SNxe9r+r49eC7FCTeaV3U2fTc2vk4Vh0pnb+fbc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772897585; c=relaxed/simple; bh=G3XaLqchcdY7Y8mV2REUjVe33AZI20F/koN6ckpnVSU=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type; b=rdJNsfQQJzl5s2eMkuHeiNEYcTA+NKI59c+/eYBgckFV61psSKAplvOAV2bvdZSmi5DAGRU44TM26AqYOeu4iU0SYDgO/j1OPDtDbT3okITpAu9d38evgz6YPccq3LC9rn39iS7sD599gwcVQhYBCKrx0omz8qUDCTgkwizSam0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=goodmis.org; spf=pass smtp.mailfrom=goodmis.org; arc=none smtp.client-ip=216.40.44.15 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=goodmis.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=goodmis.org Received: from omf11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id E001914086E; Sat, 7 Mar 2026 15:33:01 +0000 (UTC) Received: from [HIDDEN] (Authenticated sender: rostedt@goodmis.org) by omf11.hostedemail.com (Postfix) with ESMTPA id 1327E20029; Sat, 7 Mar 2026 15:32:59 +0000 (UTC) Date: Sat, 7 Mar 2026 10:32:58 -0500 From: Steven Rostedt To: Linus Torvalds Cc: LKML , Masami Hiramatsu , Mathieu Desnoyers , Andrei-Alexandru Tachici , Calvin Owens , Guenter Roeck Subject: [GIT PULL] tracing: More fixes for 7.0 Message-ID: <20260307103258.193810af@robin> X-Mailer: Claws Mail 4.3.1 (GTK 3.24.51; x86_64-redhat-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Rspamd-Server: rspamout05 X-Rspamd-Queue-Id: 1327E20029 X-Stat-Signature: z9iyt17ufa9a9qeqh8zdztet7tnpqhx6 X-Session-Marker: 726F737465647440676F6F646D69732E6F7267 X-Session-ID: U2FsdGVkX18nmF0KcRnMJ8LbdAK+1sJZNPDyhr+jnDk= X-HE-Tag: 1772897579-416450 X-HE-Meta: U2FsdGVkX18xvpSXX009LpcNDcc8W5ilJ7zl+mCyuJzw01PvxVEwmUwsUda1dLuin+mqbc9Ig6/s9/s6eVo+fL7QzND5VbqUae5GC7bgxynY5mGfhrTUAcMAuO/k1idYhpYx3tCFXAftQDPiBU4SxKjuip1XDTiUyH6s+lwvIT+s4Xh45uqlERoc+KhOMf5aEf61XSJ8FIE1pKxs+CF2sfuYdhAsSBLy37N39rIFBPvH4V/zkdAWESX7R7NUT76TyDT+uiayJZC5h5/jQegnijExTCA2+SUHxAFlsmBpvhgQ7RFsgotsh/WI63tPpJJX1CyYSRpzObh2AdTyV69If2uQ46cKwnj3 Content-Type: text/plain; charset="utf-8" Linus, tracing fixes for 7.0: - Fix possible NULL pointer dereference in trace_data_alloc() On the error path in trace_data_alloc(), it can call trigger_data_free() with a NULL pointer. This use to be a kfree() but was changed to trigger_data_free() to clean up any partial initialization. The issue is that trigger_data_free() does not expect a NULL pointer. Have trigger_data_free() return safely on NULL pointer. - Fix multiple events on the command line and bootconfig If multiple events are enabled on the command line separately and not grouped, only the last event gets enabled. That is: trace_event=3Dsched_switch trace_event=3Dsched_waking Will only enable sched_waking where as: trace_event=3Dsched_switch,sched_waking Will enable both. The bootconfig makes it even worse as the second way is the more common method. The issue is that a temporary buffer is used to store the events to enable later in boot. Each time the cmdline callback is called, it overwrites what was previously there. Have the callback append the next value (delimited by a comma) if the temporary buffer already has content. - Fix command line trace_buffer_size if >=3D 2G The logic to allocate the trace buffer uses "int" for the size parameter in the command line code causing overflow issues if more that 2G is specified. Please pull the latest trace-v7.0-rc2-2 tree, which can be found at: git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git trace-v7.0-rc2-2 Tag SHA1: e56759cc1100b321b4e8cea18a397f755b960e2f Head SHA1: d008ba8be8984760e36d7dcd4adbd5a41a645708 Andrei-Alexandru Tachici (1): tracing: Fix enabling multiple events on the kernel command line and = bootconfig Calvin Owens (1): tracing: Fix trace_buf_size=3D cmdline parameter with sizes >=3D 2G Guenter Roeck (1): tracing: Add NULL pointer check to trigger_data_free() ---- kernel/trace/trace.c | 6 +++--- kernel/trace/trace_events.c | 6 +++++- kernel/trace/trace_events_trigger.c | 3 +++ 3 files changed, 11 insertions(+), 4 deletions(-) --------------------------- diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 1e7c032a72d2..ebd996f8710e 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -9350,7 +9350,7 @@ static void setup_trace_scratch(struct trace_array *t= r, } =20 static int -allocate_trace_buffer(struct trace_array *tr, struct array_buffer *buf, in= t size) +allocate_trace_buffer(struct trace_array *tr, struct array_buffer *buf, un= signed long size) { enum ring_buffer_flags rb_flags; struct trace_scratch *tscratch; @@ -9405,7 +9405,7 @@ static void free_trace_buffer(struct array_buffer *bu= f) } } =20 -static int allocate_trace_buffers(struct trace_array *tr, int size) +static int allocate_trace_buffers(struct trace_array *tr, unsigned long si= ze) { int ret; =20 @@ -10769,7 +10769,7 @@ __init static void enable_instances(void) =20 __init static int tracer_alloc_buffers(void) { - int ring_buf_size; + unsigned long ring_buf_size; int ret =3D -ENOMEM; =20 =20 diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c index b7343fdfd7b0..249d1cba72c0 100644 --- a/kernel/trace/trace_events.c +++ b/kernel/trace/trace_events.c @@ -4493,7 +4493,11 @@ static char bootup_event_buf[COMMAND_LINE_SIZE] __in= itdata; =20 static __init int setup_trace_event(char *str) { - strscpy(bootup_event_buf, str, COMMAND_LINE_SIZE); + if (bootup_event_buf[0] !=3D '\0') + strlcat(bootup_event_buf, ",", COMMAND_LINE_SIZE); + + strlcat(bootup_event_buf, str, COMMAND_LINE_SIZE); + trace_set_ring_buffer_expanded(NULL); disable_tracing_selftest("running event tracing"); =20 diff --git a/kernel/trace/trace_events_trigger.c b/kernel/trace/trace_event= s_trigger.c index fecbd679d432..d5230b759a2d 100644 --- a/kernel/trace/trace_events_trigger.c +++ b/kernel/trace/trace_events_trigger.c @@ -50,6 +50,9 @@ static int trigger_kthread_fn(void *ignore) =20 void trigger_data_free(struct event_trigger_data *data) { + if (!data) + return; + if (data->cmd_ops->set_filter) data->cmd_ops->set_filter(NULL, data, NULL);