From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 97EF6ECAAA1 for ; Wed, 7 Sep 2022 02:08:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229564AbiIGCI3 (ORCPT ); Tue, 6 Sep 2022 22:08:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45634 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229477AbiIGCI2 (ORCPT ); Tue, 6 Sep 2022 22:08:28 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 97F92857E5 for ; Tue, 6 Sep 2022 19:08:27 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 2F8E061700 for ; Wed, 7 Sep 2022 02:08:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E601EC433D6; Wed, 7 Sep 2022 02:08:25 +0000 (UTC) Date: Tue, 6 Sep 2022 22:09:04 -0400 From: Steven Rostedt To: "Masami Hiramatsu (Google)" Cc: Tom Zanussi , Ingo Molnar , linux-kernel@vger.kernel.org Subject: Re: [PATCH v5 2/6] tracing: Fix to check event_mutex is held while accessing trigger list Message-ID: <20220906220904.1abd4610@gandalf.local.home> In-Reply-To: <166226474977.223837.1992182913048377113.stgit@devnote2> References: <166226473132.223837.9011128463174539022.stgit@devnote2> <166226474977.223837.1992182913048377113.stgit@devnote2> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 4 Sep 2022 13:12:29 +0900 "Masami Hiramatsu (Google)" wrote: > From: Masami Hiramatsu (Google) > > Since the check_user_trigger() is called outside of RCU > read lock, this list_for_each_entry_rcu() caused a suspicious > RCU usage warning. > > # echo hist:keys=pid > events/sched/sched_stat_runtime/trigger > # cat events/sched/sched_stat_runtime/trigger > [ 43.167032] > [ 43.167418] ============================= > [ 43.167992] WARNING: suspicious RCU usage > [ 43.168567] 5.19.0-rc5-00029-g19ebe4651abf #59 Not tainted > [ 43.169283] ----------------------------- > [ 43.169863] kernel/trace/trace_events_trigger.c:145 RCU-list traversed in non-reader section!! > ... > > However, this file->triggers list is safe when it is accessed > under event_mutex is held. > To fix this warning, adds a lockdep_is_held check to the > list_for_each_entry_rcu(). > > Fixes: 7491e2c44278 ("tracing: Add a probe that attaches to trace events") > Signed-off-by: Masami Hiramatsu (Google) > --- I'm going to pull this patch out of these series, mark it for stable, and add it to my queue that is going to Linus. -- Steve