Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp5635931imw; Wed, 20 Jul 2022 09:22:44 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vf0ORpMvEbD5cIET3kTiKHjb/SM50/bqElpLRL/73Ly24rIKZi5b6iNmTVnh8Vs4FlSipp X-Received: by 2002:a05:6870:e74d:b0:10c:759f:a079 with SMTP id t13-20020a056870e74d00b0010c759fa079mr2969544oak.184.1658334164615; Wed, 20 Jul 2022 09:22:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658334164; cv=none; d=google.com; s=arc-20160816; b=dojekPmYhTRaYt/jpxqkbTa/N9mA9ftfO1JsnhkxkvEWJPPZS6Dp4Mmc+AOXaUpS8n uNf1PH5Re6FWTdZKloEWvB9Ri4rBOuCKyPRL1hS+qTSq/1rZrh6jKTbkYbPaOycsF16u KsNHLT2bLpnfyN//Q0ufAB1lWfaX7jhYFG0xdNKOr+Sbag60anzHIbLcbDXbWQgVdfpE rUu4ljcUoBAB03MjgdpXhwfF/daC0SFtc1GIZvKfxxY6JSNYM/OWwtuz006Gi4gZJ/8g Blx3NZQY5uv4tLRj3/eGi9RetHaL8OoFZWmXp0SyAWIy2Ct9WDNIdjS3nzf9LJ9eGwHb PKYg== 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=7JtGlsbX6VwGgoyhPJK8qX8d0LHavlSeTq3c1hwgwx0=; b=JQJBQyYhasWWN+c+HbkN0E77Zx29gFU/5umoq2jcr/UICW3FZMEP1PQthCsQCfxKwW MU/onp+OC+0z37NQJc5pywiLYGu5MBuizTBjjt9nF7Tf3jrQac4yLSJHs/ZqR+0hPUFe k+lLjRgoH/Jq/zvKfHOvHJ4jBqeD/YFMerYB7LJOwQbI1kEmVXolCcVdmtP+ctBgHwDV UuGWMlq+JSljJZ4v+WS7p0uSSIoFVfm43mt1Ls2yccnecLJTEIIkUrQVwGZazn/1jS5x Sm3m6/bQtR1jErjmCMzLTLfyNkFAWIOuCvypXiIZVxkMdhGUaC3oHfKM8GBI3tWzocGu U/pQ== 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 c6-20020a544e86000000b0033a64ed3d2csi11367035oiy.45.2022.07.20.09.22.29; Wed, 20 Jul 2022 09:22:44 -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 S231519AbiGTPVN (ORCPT + 99 others); Wed, 20 Jul 2022 11:21:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57036 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240966AbiGTPVK (ORCPT ); Wed, 20 Jul 2022 11:21:10 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C065A3B959; Wed, 20 Jul 2022 08:21:09 -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 sin.source.kernel.org (Postfix) with ESMTPS id 17FD6CE2189; Wed, 20 Jul 2022 15:21:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3D96EC3411E; Wed, 20 Jul 2022 15:21:04 +0000 (UTC) Date: Wed, 20 Jul 2022 11:21:02 -0400 From: Steven Rostedt To: Daniel Bristot de Oliveira Cc: Wim Van Sebroeck , Guenter Roeck , Jonathan Corbet , Ingo Molnar , Thomas Gleixner , Peter Zijlstra , Will Deacon , Catalin Marinas , Marco Elver , Dmitry Vyukov , "Paul E. McKenney" , Shuah Khan , Gabriele Paoloni , Juri Lelli , Clark Williams , Tao Zhou , Randy Dunlap , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-trace-devel@vger.kernel.org Subject: Re: [PATCH V6 01/16] rv: Add Runtime Verification (RV) interface Message-ID: <20220720112102.32415cc7@gandalf.local.home> In-Reply-To: <69bb4c369b4f6f12014eb9ca3c28b74e4378c007.1658244826.git.bristot@kernel.org> References: <69bb4c369b4f6f12014eb9ca3c28b74e4378c007.1658244826.git.bristot@kernel.org> 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 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 Tue, 19 Jul 2022 19:27:06 +0200 Daniel Bristot de Oliveira wrote: > +/* > + * enabled_monitors interface. > + */ Doesn't the rv_monitors_list need to be protected by the rv_interface_lock mutex? > +static void disable_all_monitors(void) > +{ > + struct rv_monitor_def *mdef; > + I think you need: mutex_lock(&rv_interface_lock); > + list_for_each_entry(mdef, &rv_monitors_list, list) > + disable_monitor(mdef); mutex_unlock(&rv_interface_lock); > +} > + > +static int enabled_monitors_open(struct inode *inode, struct file *file) > +{ As this gets called directly from the open system call. > + if ((file->f_mode & FMODE_WRITE) && (file->f_flags & O_TRUNC)) > + disable_all_monitors(); > + > + return seq_open(file, &enabled_monitors_seq_ops); > +}; > + [..] > + > +static const struct file_operations enabled_monitors_ops = { > + .open = enabled_monitors_open, Here. -- Steve > + .read = seq_read, > + .write = enabled_monitors_write, > + .llseek = seq_lseek, > + .release = seq_release, > +};