From nobody Sun Dec 14 19:28:16 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 B65C4224894 for ; Fri, 18 Apr 2025 18:33:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745001226; cv=none; b=PKyoLHK1sAg8I9xB545s9TsD854ENaSvlaC+X8bJI2yZmF/ox9iq4kMqkpsGIYq6oi5P5MR9zrE+geB4yoDkYrfWjdwSTla3uFO4Q4pKVaDFtiUVyOu8hKb62tlC54hN9KzI6BId3SmFBhet1QpdSvmVARr4cavIqNc6FOtvz0I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745001226; c=relaxed/simple; bh=S6+Kixs9MzJQRJqyOL1vA5/PhSdO6rHl/th6ek9UFsE=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=TmbBi8SQJj6o3FFk9GkJg/UH0+Il+TJ22eDM+yazKp235vPxDS6b4DWWR3L+Ns2ebPzUUmUDRq15ZfIcIO3Lana1/p1SB09l77+MYVF4t694B3z2ApwtQkXG3uG8EzmifN82MxFLZkpaPW9RH2x5iTLj3spmfFfE81JEXJRwWuM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4707DC4CEEA; Fri, 18 Apr 2025 18:33:46 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.98) (envelope-from ) id 1u5qYi-0000000Db7E-1AHc; Fri, 18 Apr 2025 14:35:28 -0400 Message-ID: <20250418183528.128091434@goodmis.org> User-Agent: quilt/0.68 Date: Fri, 18 Apr 2025 14:34:47 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Andrew Morton , Venkat Rao Bagalkote Subject: [for-linus][PATCH 1/7] ftrace: Initialize variables for ftrace_startup/shutdown_subops() References: <20250418183446.383784216@goodmis.org> 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 Content-Type: text/plain; charset="utf-8" From: Steven Rostedt The reworking to fix and simplify the ftrace_startup_subops() and the ftrace_shutdown_subops() made it possible for the filter_hash and notrace_hash variables to be used uninitialized in a way that the compiler did not catch it. Initialize both filter_hash and notrace_hash to the EMPTY_HASH as that is what they should be if they never are used. Cc: Masami Hiramatsu Cc: Mark Rutland Cc: Mathieu Desnoyers Link: https://lore.kernel.org/20250417104017.3aea66c2@gandalf.local.home Reported-by: Venkat Rao Bagalkote Tested-by: Venkat Rao Bagalkote Fixes: 0ae6b8ce200d ("ftrace: Fix accounting of subop hashes") Closes: https://lore.kernel.org/all/1db64a42-626d-4b3a-be08-c65e47333ce2@li= nux.ibm.com/ Signed-off-by: Steven Rostedt (Google) --- kernel/trace/ftrace.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index a8a02868b435..43394445390c 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c @@ -3490,8 +3490,8 @@ static int add_next_hash(struct ftrace_hash **filter_= hash, struct ftrace_hash ** */ int ftrace_startup_subops(struct ftrace_ops *ops, struct ftrace_ops *subop= s, int command) { - struct ftrace_hash *filter_hash; - struct ftrace_hash *notrace_hash; + struct ftrace_hash *filter_hash =3D EMPTY_HASH; + struct ftrace_hash *notrace_hash =3D EMPTY_HASH; struct ftrace_hash *save_filter_hash; struct ftrace_hash *save_notrace_hash; int ret; @@ -3625,8 +3625,8 @@ static int rebuild_hashes(struct ftrace_hash **filter= _hash, struct ftrace_hash * */ int ftrace_shutdown_subops(struct ftrace_ops *ops, struct ftrace_ops *subo= ps, int command) { - struct ftrace_hash *filter_hash; - struct ftrace_hash *notrace_hash; + struct ftrace_hash *filter_hash =3D EMPTY_HASH; + struct ftrace_hash *notrace_hash =3D EMPTY_HASH; int ret; =20 if (unlikely(ftrace_disabled)) --=20 2.47.2