From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796090984; b=DPuj3jXgi90tAqNTRYzFWf8q1Ml3o1OhBYKU1njfOxtili/sRY7MJUeIt4Ds4XwgwkRW FNmEl6buPnGPhlJWMNKT9P08vY5BNlbBklAkLwYvboYS5MpGRneOvMBN7fHM8Kt/oO3eJ t++bNO/CEN/u1V4SEzKd8+QcXfrlelbsCfCErS40Nzufl3AQtJ3DJ5HPY93yN19tenK3t pBo44RvPMay+Q0aDteXEVWhjwktiva4XyM6i8vExxxfsQ+6kNlrVz7lTTI9wD9ZrklFcv Nxdrf0+jEFJ5AFXj8yfwUJsoH7REVEJIGhulYMhC0jopIf0FRP8xd/LQxOoL8NUF9jw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796090984; h=Received:DKIM-Signature:Date:From:To:cc:Subject:In-Reply-To: Message-ID:References:MIME-Version:Content-Type; bh=JNc6/por5iStkS7lVGKZz+AOioDpJjsoDmecuPlWW4E=; b=iemotucVQ6YsMenTxG+ZfCh2KFi/pM1YybfJUfPBcFW22Df+8oydNiyZSk63xH9PuAgF +K4kuBCh3dJw/GLglQTcPHyyJpI1+ASN2pA7UhS5EWHTnngnJLN41IGbOdfv/ImghSu82 3IsL9cf0lZSxtNe8b/4tz2Fhn9k7qjAn0Mxl18MjUEETG42cAcJvsMwgBuhc6iuqYud36 fpfYFAy303CInxIOYoNWXszzbl4/6RZ5mYDqnvVfBFnZMEJHRhjTuhal1ekGrh7K6tv5G QfyFJYCkWjWj1GpfiU02QgCqmG9DZvD6F+1vrOipp42aDTX4jvZ5zXeIrHhRewpBqog== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=OqilsC2C; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C9A4E606A31A for ; Tue, 1 Dec 2026 02:09:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=OqilsC2C Received: by smtp.kernel.org (Postfix) with ESMTPSA id AC1F31F000C1; Tue, 1 Dec 2026 02:09:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796090984; bh=JNc6/por5iStkS7lVGKZz+AOioDpJjsoDmecuPlWW4E=; h=Date:From:To:cc:Subject:In-Reply-To:References; b=OqilsC2CnmlZr72oygDysdy1Ex2DaUCGp92m0oTnzAthhWnViI586poidcwiPH2XB ThLwSZAJBrzF+uxDIxxe7qbLGX/Caupf59VcbL+IJvg3fybyEwGayqzy1EIlcyiOzN Wm4PqO9oxRVG2kvsqU5QbXHKfcgYQmunhCx3j5BpuLwhUcChbgvt+JWUc8yv4lSrZd g+3m0fbMKuC10WVX+zdYFeHl8Jed9cHbakac9nRotjq66gbBcR7D9iYs7DOIru2PdF mwvEtFVKYI/w9oC2MqDXKwqHWWkekB0C9R0rI0pFPijfRHZ750Zaj22bT0G5jJAyrj n5YM0pcY1svQQ== Date: Mon, 30 Nov 2026 19:09:42 -0700 (MST) From: Paul Walmsley To: zhang.anmeng@zte.com.cn cc: pjw@kernel.org, palmer@dabbelt.com, aou@eecs.berkeley.edu, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, alex@ghiti.fr, qirui.001@bytedance.com, hu.shengming@zte.com.cn, gao.rui@zte.com.cn, luo.haiyang@zte.com.cn, zhang.run@zte.com.cn, zhangchunyan@iscas.ac.cn Subject: Re: [PATCH] riscv: stacktrace: Fix NULL task pointer in^J ftrace_graph_ret_addr() In-Reply-To: <20260708095046716mVQlEvhyoXko9eueCxict@zte.com.cn> Message-ID: <796fec4e-c5d1-7d96-5166-eb6477e4daf7@kernel.org> References: <20260708095046716mVQlEvhyoXko9eueCxict@zte.com.cn> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII On Wed, 8 Jul 2026, zhang.anmeng@zte.com.cn wrote: > When dump_backtrace() is called with a NULL task argument, and the > call stack contains functions that are being traced, > walk_stackframe() eventually calls ftrace_graph_ret_addr() with the > NULL task pointer, which results in a NULL pointer dereference when > accessing task->curr_ret_stack. > > Fix this by assigning the task pointer to the current task in > walk_stackframe() when it is NULL, keeping the behavior consistent > with other architectures. > > Fixes: ecbf894165a2 ("riscv: Fix ftrace_graph_ret_addr() to use the correct task pointer") > Reviewed-by: Shengming Hu > Reviewed-by: Rui Gao > Reviewed-by: Luo Haiyang > Reviewed-by: Run Zhang > Signed-off-by: Anmeng Zhang Thanks, queued for v7.4-rc with a cc to stable. - Paul