[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180115141800.42cc412a@xeon-e3>
Date: Mon, 15 Jan 2018 14:18:00 -0800
From: Stephen Hemminger <stephen@...workplumber.org>
To: Alexey Dobriyan <adobriyan@...il.com>
Cc: davem@...emloft.net, netdev@...r.kernel.org
Subject: Re: [PATCH v2] net: delete /proc THIS_MODULE references
On Tue, 16 Jan 2018 00:42:40 +0300
Alexey Dobriyan <adobriyan@...il.com> wrote:
> /proc has been ignoring struct file_operations::owner field for 10 years.
> Specifically, it started with commit 786d7e1612f0b0adb6046f19b906609e4fe8b1ba
> ("Fix rmmod/read/write races in /proc entries"). Notice the chunk where
> inode->i_fop is initialized with proxy struct file_operations for
> regular files:
>
> - if (de->proc_fops)
> - inode->i_fop = de->proc_fops;
> + if (de->proc_fops) {
> + if (S_ISREG(inode->i_mode))
> + inode->i_fop = &proc_reg_file_ops;
> + else
> + inode->i_fop = de->proc_fops;
> + }
>
> VFS stopped pinning module at this point.
>
> Signed-off-by: Alexey Dobriyan <adobriyan@...il.com>
What happens if /proc file for the module is open and the module is unloaded?
Just because it is old doesn't mean that it wasn't a bug.
Powered by blists - more mailing lists