[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220720112102.32415cc7@gandalf.local.home>
Date: Wed, 20 Jul 2022 11:21:02 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: Daniel Bristot de Oliveira <bristot@...nel.org>
Cc: Wim Van Sebroeck <wim@...ux-watchdog.org>,
Guenter Roeck <linux@...ck-us.net>,
Jonathan Corbet <corbet@....net>,
Ingo Molnar <mingo@...hat.com>,
Thomas Gleixner <tglx@...utronix.de>,
Peter Zijlstra <peterz@...radead.org>,
Will Deacon <will@...nel.org>,
Catalin Marinas <catalin.marinas@....com>,
Marco Elver <elver@...gle.com>,
Dmitry Vyukov <dvyukov@...gle.com>,
"Paul E. McKenney" <paulmck@...nel.org>,
Shuah Khan <skhan@...uxfoundation.org>,
Gabriele Paoloni <gpaoloni@...hat.com>,
Juri Lelli <juri.lelli@...hat.com>,
Clark Williams <williams@...hat.com>,
Tao Zhou <tao.zhou@...ux.dev>,
Randy Dunlap <rdunlap@...radead.org>,
linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-trace-devel@...r.kernel.org
Subject: Re: [PATCH V6 01/16] rv: Add Runtime Verification (RV) interface
On Tue, 19 Jul 2022 19:27:06 +0200
Daniel Bristot de Oliveira <bristot@...nel.org> 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,
> +};
Powered by blists - more mailing lists