Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp5121081rwb; Tue, 6 Sep 2022 19:32:50 -0700 (PDT) X-Google-Smtp-Source: AA6agR5k68qswYyZEvsME835fPvT6FkXR3JXZ5YrftVGIlmeYf3Gxw8D3PrPXNGf2hWoaiH/e5CU X-Received: by 2002:a17:902:da87:b0:174:d9bb:ed70 with SMTP id j7-20020a170902da8700b00174d9bbed70mr1678153plx.166.1662517970288; Tue, 06 Sep 2022 19:32:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662517970; cv=none; d=google.com; s=arc-20160816; b=bX3IWWMwfLIpvJosGqTJmCUJXNB3hYzIq5+nvU3kf9j9OJrMQ1Jeo6VT2OTG5oeAbZ gSYp1pXjxy5AvjMUI3qFmyA0jCjC52Cey6HCdPi+iM/KAk0xYMcXOFuz9EFIsptNU9Mc x8KzK0sfeVxp0ns3ovYNcEE4NxwzvjG1rdGQO2MkdwxObdOKjQ/o5WGuHQaACEMmzxE2 R1W4dRFJzVkZDwnD1T72fzNUJIC19Uw0G+VIrjCaakBpl98TmyFNaMA92Ee0197RlWNH NBHM8IMlGtr2aEX1UWbMLiM7a3oJTC3pw0CSRr/cn63rSAlAB5psgBww2v8x6JJkIPLy MvzA== 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; bh=dHIp2Gvkt3/MvtwScD06HQARzkkd+M5h+OyU1tvRwPY=; b=YO0WfPivZHSVvKSELSN34y77UM8D6P68UnLkAkVaww6pWR4l+6fKhTVRXWsORucQcn GVILrfcG2+UBlntOZxN90pu4aO0pEvs+Pjxu0c2o0MBJ3uqKWP614Uxi+oReV2Z+1Dgt rSLlGClFv7328veNYlJ++Iqf92hvqy7Soq1uqrr+3iQnAh0BPVEUMdiMkOUaklLfgqRr zMR1qQgXebq/34qDdQSop8/WVqm6wUUaHtBwBqux2aXL/uFCH/xh5FgwLkfUgE+w0OHn O6YiO/6syTwP/ikSRx7iA3XZV51WSNiDuY9VPw74G5LGJXaMucid+ASW11Vl8Pg+3oFE TxXw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j187-20020a638bc4000000b0041c080db81asi14309440pge.150.2022.09.06.19.32.37; Tue, 06 Sep 2022 19:32:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229552AbiIGCI3 (ORCPT + 99 others); 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 X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,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: 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