Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp1559809rdh; Mon, 25 Sep 2023 17:24:49 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHpdNCapHEVISRoiwRJm4bSw2+Err8WCU/xBrJbIaGB+RK0UW+PYycx0TFUHvjjfezxHdHS X-Received: by 2002:a17:902:8609:b0:1c3:eb43:65bf with SMTP id f9-20020a170902860900b001c3eb4365bfmr5476708plo.32.1695687889216; Mon, 25 Sep 2023 17:24:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695687889; cv=none; d=google.com; s=arc-20160816; b=q4QhfpD+yJABbhGjrQO/xL7DKTKhwUIzFFebzLcVpOzg8S9//MCgwUNenOzFR75r4U EAmc4pJJVkx7Pf0vPbhbS16AfVBgbDf8AAHOqKHZ7cdZXGh+I7/A93o0JMr0FsrBis/p 3q4L0fXCWs9Tws9VlqqWGwqDjCvBbL5SLj2RoRbiR7l957PWANHijY3ymK4x/sP+gZS8 q1bcQYzDaIKRqAxGQZB09TKwpJWBUQib0kw/p8sh8pyFmZNRHrXff03OQ4KxdS1ogpYr Vy0swF9aNJ7vw5a7jAXCvnWk977SiuuBy7T/YrtBSTtrWhmHvMyJdFS8WshunPzlJ8iW kqyQ== 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 :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=/glD4+bzVtScPrFoGoRabhwEcMS7CvvWfMDE4UURs7w=; fh=MHFbjiEyIRiJDyyjklkE8bixMO1uD9yEJOq7UyhE4VE=; b=LffpbT0fUdc3UM1kSbRIQVdO0Kuqiug5RKgkU58Cs+KGBDDjL2vbm+hKfO0bo9IPdW 8+S3LPX1h4G/t5zwMyYFbXmkPTZ5cPW+mTeIIJ/7+fSKbJnx0eLYgI8XEXuROmk4ryMw 5qtq7rl3Ib7HN+x5mFRJ9Uyn9LE4R2veNzHU/RV/uokTNPE6hosiCojeD9Do7+/bCR6I vvlpOMvz+sjy2u9oc1O7t+9HmUHOMWp38xtxMovqSnWp7Ti4qVUNaEaQJ83e9vy/XN30 bxRAy7RKjiBZASEk7ZpdgWBcc4FHZS24e9p+y0m03zmIc0ovZW85TBpXl4lLgcAn6mSv tgqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QPHBRHPu; 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 Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id s19-20020a170903201300b001c353153012si10680919pla.415.2023.09.25.17.24.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 17:24:49 -0700 (PDT) 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=QPHBRHPu; 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 F18C5804ACD8; Mon, 25 Sep 2023 17:20:59 -0700 (PDT) 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 S231324AbjIZAVD (ORCPT + 99 others); Mon, 25 Sep 2023 20:21:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37978 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229460AbjIZAVC (ORCPT ); Mon, 25 Sep 2023 20:21:02 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C0AF7120 for ; Mon, 25 Sep 2023 17:20:55 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8BCEBC433C8; Tue, 26 Sep 2023 00:20:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695687655; bh=8ZXFwCIg1oGcxQ32a/Xjtx4euP4ylyONmkXQpSM8V/c=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=QPHBRHPuzL3zDK7hSy7P5KSkTOWXqVMwUlon1sr2TNZDnwdsZxCBsBMaTX7IxVEkU RQNd7BpGdKiSCXhQyWW5dJzSmjHDiqpNC7qEoBG87sX8aTwsRgN5t56Un91Rp7JkJd F8RSpw+j5Wnkpy+oCu2+jn7B9lsqKAP7e++/al9fTtzVRfOzzj6LzT34ASAqaAFdQt q1pGB2jK52y+KPiNKeDGV5xdcfnnq2yYsDVZ/fwQjlyQ5sWriUh7/6D5+Eq9X/yqVu r5vyBq9w9+OZGFRtDep/lpX+xs1UZK6k0TIQJL4aTzSgIkhBtSAeNY+KAH7Cr7sNvk qgMzYOb0FURPQ== Date: Tue, 26 Sep 2023 09:20:48 +0900 From: Masami Hiramatsu (Google) To: Jiri Olsa Cc: Alexei Starovoitov , Steven Rostedt , Florent Revest , linux-trace-kernel@vger.kernel.org, LKML , Martin KaFai Lau , bpf , Sven Schnelle , Alexei Starovoitov , Arnaldo Carvalho de Melo , Daniel Borkmann , Alan Maguire , Mark Rutland , Peter Zijlstra , Thomas Gleixner , Guo Ren Subject: Re: [PATCH v5 04/12] fprobe: Use ftrace_regs in fprobe entry handler Message-Id: <20230926092048.5c08fb61cb99f77573f89d7b@kernel.org> In-Reply-To: References: <169556254640.146934.5654329452696494756.stgit@devnote2> <169556259571.146934.4558592076420704031.stgit@devnote2> <20230925211515.41d26a160c546c7bce08ac64@kernel.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS 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: 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]); Mon, 25 Sep 2023 17:21:00 -0700 (PDT) On Tue, 26 Sep 2023 00:14:33 +0200 Jiri Olsa wrote: > On Mon, Sep 25, 2023 at 09:15:15PM +0900, Masami Hiramatsu wrote: > > Hi Jiri, > > > > On Mon, 25 Sep 2023 12:41:59 +0200 > > Jiri Olsa wrote: > > > > > On Sun, Sep 24, 2023 at 10:36:36PM +0900, Masami Hiramatsu (Google) wrote: > > > > From: Masami Hiramatsu (Google) > > > > > > > > This allows fprobes to be available with CONFIG_DYNAMIC_FTRACE_WITH_ARGS > > > > instead of CONFIG_DYNAMIC_FTRACE_WITH_REGS, then we can enable fprobe > > > > on arm64. > > > > > > > > Signed-off-by: Masami Hiramatsu (Google) > > > > Acked-by: Florent Revest > > > > > > I was getting bpf selftests failures with this patchset and when > > > bisecting I'm getting crash when running on top of this change > > > > Thanks for bisecting! > > > > > > > > looks like it's missing some of the regs NULL checks added later? > > > > yeah, if the RIP (arch_rethook_prepare+0x0/0x30) is correct, > > > > void arch_rethook_prepare(struct rethook_node *rh, struct ftrace_regs *fregs, bool mcount) > > > > RSI (the 2nd argument) is NULL. This means fregs == NULL and caused the crash. > > I think ftrace_get_regs(fregs) for the entry handler may return NULL. > > > > Ah, > > > > @@ -182,7 +182,7 @@ static void fprobe_init(struct fprobe *fp) > > fp->ops.func = fprobe_kprobe_handler; > > else > > fp->ops.func = fprobe_handler; > > - fp->ops.flags |= FTRACE_OPS_FL_SAVE_REGS; > > + fp->ops.flags |= FTRACE_OPS_FL_SAVE_ARGS; > > } > > > > static int fprobe_init_rethook(struct fprobe *fp, int num) > > > > This may cause the issue, it should keep REGS at this point (this must be done in > > [9/12]). But after applying [9/12], it shouldn't be a problem... > > > > Let me check it again. > > that helped with the crash, I'll continue bisecting to find out > where it breaks the tests Can you share the configuration and the test? I would like to reproduce it because I couldn't make it reproduced. Thank you, -- Masami Hiramatsu (Google)