[RFC,19/32] function_graph: Fix to check the return value of ftrace_pop_return_trace()
Message ID | 169920062203.482486.9590838723080321966.stgit@devnote2 |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:8f47:0:b0:403:3b70:6f57 with SMTP id j7csp2197630vqu; Sun, 5 Nov 2023 08:10:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IGxScUR2uw8a4nhV/bjrnRT8K1lAbFHhHAzo2cvWVM6V7q/fvGSifJZAcdqToBOTX+hUWz8 X-Received: by 2002:a17:903:32c3:b0:1cc:4828:9b07 with SMTP id i3-20020a17090332c300b001cc48289b07mr25268808plr.0.1699200646807; Sun, 05 Nov 2023 08:10:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699200646; cv=none; d=google.com; s=arc-20160816; b=x70PAZl8SEP7XPvMvTwwy+pcSfnwLD3p9/eYknOwLu2KVMIWYrmIExz1m5h1XQDBc+ xBv4HtLs8jS1bpACUP7Hrh2feiDGfl0TuKY9Tin/fa/EClPT5WsUSRfKfpZQiHjhOogQ o/O5tpKipnCklSgdlbSnSDos7H8+dZkvCKzSWICl4zRExfDV/24VX/QABdp8LsFaMByc miDtfIMpysO/PQCtOhFJj9hUiJWo4AGlWbgjN4oMMHHTQbcLBIAC4RlZblg6/OMLn3ex BvwwwXE2UBN8LfWTX2ubrtUlalhPQmzfOlYFDhkoabvqXYxR2aX9S4NKBELvscvlvBdj slTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=YoYXkSa3L9Pc8/kbYQ843hZhircS1ZTYGueEwE0A+uI=; fh=SIgps5XdV0XNwjZfT2uAI7g3mrspDldK9Qs8qQAfoa4=; b=JheLUhnsZ18uv0UK0x7Bam3kvaPk+HEeO4zxHKeIuR6KBCTpaBVIbnfjA/jyNhA3j2 cOG5S7OGs5ZrR+FSrMhw4QphPJToJckbQDHnOyD0uY6vCCAa/QDgz8GaHg/Qr3Hvo7tr EE1thPCHDY8QThkR9pfYhopymN4cxWxu+21LIiaZ6y8wYMHgtIRcCCRJCkZoK6lCuHk5 TDmcxWVWsTPQQc6fVunzUOrPQgsnzNjKMB+SkDLmNsmM477/jGAIu1dhMT7QRMI0Zwym Qt7MMVk2ykxazJPly41EqalVIbNuxGfrz17kxNw+ithQTpz5eye+9jnzQGvTekrF37Ay CK7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DChrFFMp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id i10-20020a170902eb4a00b001bbbbb61c71si6022733pli.399.2023.11.05.08.10.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Nov 2023 08:10:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DChrFFMp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 1448E804705A; Sun, 5 Nov 2023 08:10:46 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229814AbjKEQKg (ORCPT <rfc822;heyuhang3455@gmail.com> + 34 others); Sun, 5 Nov 2023 11:10:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35268 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229707AbjKEQKb (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sun, 5 Nov 2023 11:10:31 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 91DE1125 for <linux-kernel@vger.kernel.org>; Sun, 5 Nov 2023 08:10:28 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DF42EC433C8; Sun, 5 Nov 2023 16:10:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1699200628; bh=owfDd6JTzvCM2mjVDdOSlbEmkdB46BrUrZqzXjclNlU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DChrFFMpRcrcTwjoa7bf2Wg2cA2IsxnVTfMWzssOMgTHcLuK6LQFafhQxAF1oGC3x rtCQ5U8qMxod4wcKgG4k5iQH2S2Xr0dV98/0HARMoKy6nSJCIJr6joQUN9Rt6jNiZx /0IC6vqqt3CJITKu1ulmp1JhYorPV5a5sq3sotVxBBwUmq3gPmgoVh8pGzoW7mw0Ut HbVWGEvrQ5A1NZbxX50j37FmJ7VacfCPPLZupCoKnU+RLTIvXNbAJjNiMHQhrrxfbK 7gY7o7pa+rcUSP0XUiMWxCmwDEnozQ4Zz81wKkPig6V+V1OOY6PYbXANoq6reaS92a RTNrzqpAWJQaw== From: "Masami Hiramatsu (Google)" <mhiramat@kernel.org> To: Alexei Starovoitov <alexei.starovoitov@gmail.com>, Steven Rostedt <rostedt@goodmis.org>, Florent Revest <revest@chromium.org> Cc: linux-trace-kernel@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>, Martin KaFai Lau <martin.lau@linux.dev>, bpf <bpf@vger.kernel.org>, Sven Schnelle <svens@linux.ibm.com>, Alexei Starovoitov <ast@kernel.org>, Jiri Olsa <jolsa@kernel.org>, Arnaldo Carvalho de Melo <acme@kernel.org>, Daniel Borkmann <daniel@iogearbox.net>, Alan Maguire <alan.maguire@oracle.com>, Mark Rutland <mark.rutland@arm.com>, Peter Zijlstra <peterz@infradead.org>, Thomas Gleixner <tglx@linutronix.de>, Guo Ren <guoren@kernel.org> Subject: [RFC PATCH 19/32] function_graph: Fix to check the return value of ftrace_pop_return_trace() Date: Mon, 6 Nov 2023 01:10:22 +0900 Message-Id: <169920062203.482486.9590838723080321966.stgit@devnote2> X-Mailer: git-send-email 2.34.1 In-Reply-To: <169920038849.482486.15796387219966662967.stgit@devnote2> References: <169920038849.482486.15796387219966662967.stgit@devnote2> User-Agent: StGit/0.19 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Sun, 05 Nov 2023 08:10:46 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781741017490031375 X-GMAIL-MSGID: 1781741017490031375 |
Series |
tracing: fprobe: function_graph: Multi-function graph and fprobe on fgraph
|
|
Commit Message
Masami Hiramatsu (Google)
Nov. 5, 2023, 4:10 p.m. UTC
From: Masami Hiramatsu (Google) <mhiramat@kernel.org> Fix to check the return value ('ret_stack') of ftrace_pop_return_trace() instead of passed storage ('ret') because ret_stack becomes NULL in error case. Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org> --- kernel/trace/fgraph.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/trace/fgraph.c b/kernel/trace/fgraph.c index 858fb73440ec..e51695441476 100644 --- a/kernel/trace/fgraph.c +++ b/kernel/trace/fgraph.c @@ -714,7 +714,7 @@ static unsigned long __ftrace_return_to_handler(struct fgraph_ret_regs *ret_regs ret_stack = ftrace_pop_return_trace(&trace, &ret, frame_pointer); - if (unlikely(!ret)) { + if (unlikely(!ret_stack)) { ftrace_graph_stop(); WARN_ON(1); /* Might as well panic. What else to do? */