Received: by 2002:ab2:6f44:0:b0:1fd:c486:4f03 with SMTP id l4csp801lqq; Wed, 12 Jun 2024 14:18:27 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVdtodf8oH2PmCet8tms0rihDE5SkGBaNJwuGEro+8UGjw/idzbs16TeT9srUigcNpZ3+4YYxsnAQzwzOQi262j+hEE2BUhlg4MUHWvvA== X-Google-Smtp-Source: AGHT+IHk1a6r+3t813nPVQHK53h+N9YGWUGDB/YeLB5lJAx/jJ3GBtUFZCMrnFOeFKMDFT1ZEqG4 X-Received: by 2002:a05:6512:1112:b0:52c:8449:8f01 with SMTP id 2adb3069b0e04-52c9a3bfb8fmr3001139e87.12.1718227106956; Wed, 12 Jun 2024 14:18:26 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718227106; cv=pass; d=google.com; s=arc-20160816; b=EUFoxtT3IvEVO5GdabsDWXwv3rexdpIbonSO8/FK9y/2CKzu4sGS21YZwaAIvdNTWD UDukgj5+fo8aNqpD/vgS7q7OtGmZMTCrB+FsCBcMIuvJliVuKMnbnD4MEtOWRDT0xN4g 14r2dhxBDABB85dDjTREvohyE5eB2pg9PuCrMKQ3Xwb+k80nfgFqCnz70VoLAJW0h0YE QQFSTBp8rGzrG78x54A+IeFn92pSMG2k2qV4WxSnw4m5P2T4lJnAKyhl+GALx5fW/lu1 KjTOI6UKTWcO33vLX7kmNuNdTGS1PIMjMN5SXR/u8ek014E1waWj/smNRPRVJMruVj9o 9DSQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date; bh=4HljVToxCRHQk3RUwKhojlBSjI2QJCTdD9PzOqSSGrY=; fh=+n9OsoH8J/DUrDcBifB9EAFqjx9pnkyLLGRU9c7h8BM=; b=FER5NjS+JVXLUK0vjYhP3LH4HhG+VVnlbRarC+Lk3IE4OAvhUoHFroABOhHj6vpXMh 0G4oaisUE0568EJdbbChJNSNICpEM3ervmRAl1Qf0buhTZ36uhMpwCvlAz7qhsbfWnKp xuXavE6vrsQFhnHMHtmEGUIKbQEJFmQXelzZBFSgTq1i+3OjGxj9ar4ONIdCL4JO1rtb odNd81ENIozWffODa9NMKwM5DAmViLKvJR9tfdz6YqNssn3e98Um/dz88yticYTUVP59 NGotU1r72Yah2u8vJw2XTzV6GJiXSHq57+e+NLSUxkjvyQo+kQ0PKEGHcEykHE+5q0/6 OF4A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-212269-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-212269-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a6e4419bc53si579604866b.312.2024.06.12.14.18.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jun 2024 14:18:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-212269-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-212269-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-212269-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 4D9861F224A3 for ; Wed, 12 Jun 2024 21:17:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5DEF58529C; Wed, 12 Jun 2024 21:17:52 +0000 (UTC) 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 D8DF0210FF; Wed, 12 Jun 2024 21:17:51 +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=1718227071; cv=none; b=gDH9i/Hcn1rXYJ+elW71V0U7VY/wo1e6uYF9cPvp8G3vj0VvGruzuydZNfGWCFE30HvkXV0DGxp8Cf1kWcnMUN9XglMk78GsdQ34WJtQUE6wyclg1X5P8nWUK+3dOMAOF697VgXUOwM9s4k4MOw9KFg08SUt0nfS8pObK/GnKtE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718227071; c=relaxed/simple; bh=vEtzTEM2k7xLovHgE/1wAEzwHMADwkncLdx8SgC6E34=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=f/P9cNbJmmWcMzvwcBpd4KbXixQlqP7Q2ED311qnCCsUWQYubrXFFP9tRMNy+72YErGve73HLIa14MbaSNnhsW7Xx1f+R+KszXSkeX1XH3owjiGX0A2lAFBs4Qsv8Huacs6bniSh/rH5PTF6PnAKAZplGeljPqViTi+Bu+lFBhs= 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 6ABFBC116B1; Wed, 12 Jun 2024 21:17:50 +0000 (UTC) Date: Wed, 12 Jun 2024 17:17:48 -0400 From: Steven Rostedt To: Naresh Kamboju Cc: open list , lkft-triage@lists.linaro.org, Linux Regressions , Dan Carpenter , Arnd Bergmann , Masami Hiramatsu , Mark Rutland Subject: Re: LTP tracing crashed on arm64 rk3399-rock-pi-4 - pc : ftrace_ops_test Message-ID: <20240612171748.0bc6d9cb@rorschach.local.home> In-Reply-To: <20240612125130.2c1d6d2d@rorschach.local.home> References: <20240612125130.2c1d6d2d@rorschach.local.home> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Wed, 12 Jun 2024 12:51:30 -0400 Steven Rostedt wrote: > > [ 100.600222] Hardware name: Radxa ROCK Pi 4B (DT) > > [ 100.600229] pstate: 800003c5 (Nzcv DAIF -PAN -UAO -TCO -DIT -SSBS BTYPE=--) > > [ 100.600239] pc : ftrace_ops_test+0x34/0x138 > > Hmm, could you show the exact line of the above code? Specifically we have: > > rcu_assign_pointer(hash.filter_hash, ops->func_hash->filter_hash); > rcu_assign_pointer(hash.notrace_hash, ops->func_hash->notrace_hash); > > Hmm, it's a NULL pointer dereference at 0x8, so ops is likely not NULL, > as func_hash is much farther down. But if func_hash is NULL, > filter_hash is at the 0x8 offset. > > So now the question is, how did func_hash become NULL. It should always > be pointing at something. May have to do with the subops. Will investigate. > > > > > [ 100.600258] lr : function_graph_enter+0x144/0x208 I wonder if we need the following patch: diff --git a/kernel/trace/fgraph.c b/kernel/trace/fgraph.c index 8317d1a7f43a..fc205ad167a9 100644 --- a/kernel/trace/fgraph.c +++ b/kernel/trace/fgraph.c @@ -641,7 +641,7 @@ int function_graph_enter(unsigned long ret, unsigned long func, { for_each_set_bit(i, &fgraph_array_bitmask, sizeof(fgraph_array_bitmask) * BITS_PER_BYTE) { - struct fgraph_ops *gops = fgraph_array[i]; + struct fgraph_ops *gops = READ_ONCE(fgraph_array[i]); int save_curr_ret_stack; if (gops == &fgraph_stub) Because if the compiler decides to re-read gops from fgraph_array[i] after the above check for the following line that does: save_curr_ret_stack = current->curr_ret_stack; if (ftrace_ops_test(&gops->ops, func, NULL) && gops->entryfunc(&trace, gops)) bitmap |= BIT(i); and gops now points to fgraph_stub, it will trigger this bug. Can you apply the above change and see if the bug goes away? Thanks, -- Steve