Re: [PATCH V6 01/16] rv: Add Runtime Verification (RV) interface
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- Subject: Re: [PATCH V6 01/16] rv: Add Runtime Verification (RV) interface
- From: Steven Rostedt <rostedt@xxxxxxxxxxx>
- Date: Wed, 20 Jul 2022 11:21:02 -0400
- Cc: Wim Van Sebroeck <wim@xxxxxxxxxxxxxxxxxx>, Guenter Roeck <linux@xxxxxxxxxxxx>, Jonathan Corbet <corbet@xxxxxxx>, Ingo Molnar <mingo@xxxxxxxxxx>, Thomas Gleixner <tglx@xxxxxxxxxxxxx>, Peter Zijlstra <peterz@xxxxxxxxxxxxx>, Will Deacon <will@xxxxxxxxxx>, Catalin Marinas <catalin.marinas@xxxxxxx>, Marco Elver <elver@xxxxxxxxxx>, Dmitry Vyukov <dvyukov@xxxxxxxxxx>, "Paul E. McKenney" <paulmck@xxxxxxxxxx>, Shuah Khan <skhan@xxxxxxxxxxxxxxxxxxx>, Gabriele Paoloni <gpaoloni@xxxxxxxxxx>, Juri Lelli <juri.lelli@xxxxxxxxxx>, Clark Williams <williams@xxxxxxxxxx>, Tao Zhou <tao.zhou@xxxxxxxxx>, Randy Dunlap <rdunlap@xxxxxxxxxxxxx>, linux-doc@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, linux-trace-devel@xxxxxxxxxxxxxxx
- In-reply-to: <69bb4c369b4f6f12014eb9ca3c28b74e4378c007.1658244826.git.bristot@kernel.org>
- References: <cover.1658244826.git.bristot@kernel.org> <69bb4c369b4f6f12014eb9ca3c28b74e4378c007.1658244826.git.bristot@kernel.org>
On Tue, 19 Jul 2022 19:27:06 +0200
Daniel Bristot de Oliveira <bristot@xxxxxxxxxx> 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,
> +};
[Index of Archives]
[Linux USB Development]
[Linux USB Development]
[Linux Audio Users]
[Yosemite Hiking]
[Linux Kernel]
[Linux SCSI]