Re: [RFC] revoke(2) and generic handling of things like remove_proc_entry()

2013-04-11 Thread Al Viro
On Thu, Apr 11, 2013 at 01:48:26PM -0700, Eric W. Biederman wrote: > Last time I was looking at this I was noticing that there is a lock > (mmap_sem?) that is held over every ->vm_op->foo() call. If that is > true today it should be possible to just grab that lock and change > vm_ops. That

Re: [RFC] revoke(2) and generic handling of things like remove_proc_entry()

2013-04-11 Thread Eric W. Biederman
Al Viro writes: > On Fri, Apr 05, 2013 at 05:29:32AM +0100, Al Viro wrote: >> 4) nasty semantics issue - mmap() vs. revoke (of any sort, including >> remove_proc_entry(), etc.). Suppose a revokable file had been mmapped; >> now it's going away. What should we do to its VMAs? Right now sysfs

Re: [RFC] revoke(2) and generic handling of things like remove_proc_entry()

2013-04-11 Thread Eric W. Biederman
Al Viro v...@zeniv.linux.org.uk writes: On Fri, Apr 05, 2013 at 05:29:32AM +0100, Al Viro wrote: 4) nasty semantics issue - mmap() vs. revoke (of any sort, including remove_proc_entry(), etc.). Suppose a revokable file had been mmapped; now it's going away. What should we do to its VMAs?

Re: [RFC] revoke(2) and generic handling of things like remove_proc_entry()

2013-04-11 Thread Al Viro
On Thu, Apr 11, 2013 at 01:48:26PM -0700, Eric W. Biederman wrote: Last time I was looking at this I was noticing that there is a lock (mmap_sem?) that is held over every -vm_op-foo() call. If that is true today it should be possible to just grab that lock and change vm_ops. That makes for

Re: [alsa-devel] [RFC] revoke(2) and generic handling of things like remove_proc_entry()

2013-04-08 Thread Clemens Ladisch
Al Viro wrote: > BTW, snd_card_disconnect() doesn't do anything to existing mappings; smells > like a bug, and there we do have ones with non-trivial ->mmap(). Could > ALSA folks comment? I don't know of any hotplug sound driver that maps memory from a device. All hotplug buses (PCIe, USB,

Re: [alsa-devel] [RFC] revoke(2) and generic handling of things like remove_proc_entry()

2013-04-08 Thread Clemens Ladisch
Al Viro wrote: BTW, snd_card_disconnect() doesn't do anything to existing mappings; smells like a bug, and there we do have ones with non-trivial -mmap(). Could ALSA folks comment? I don't know of any hotplug sound driver that maps memory from a device. All hotplug buses (PCIe, USB, FireWire)

Re: [RFC] revoke(2) and generic handling of things like remove_proc_entry()

2013-04-05 Thread Al Viro
On Fri, Apr 05, 2013 at 05:29:32AM +0100, Al Viro wrote: > 4) nasty semantics issue - mmap() vs. revoke (of any sort, including > remove_proc_entry(), etc.). Suppose a revokable file had been mmapped; > now it's going away. What should we do to its VMAs? Right now sysfs > and procfs get away

Re: [RFC] revoke(2) and generic handling of things like remove_proc_entry()

2013-04-05 Thread Hannes Frederic Sowa
On Fri, Apr 05, 2013 at 05:29:32AM +0100, Al Viro wrote: > 4) nasty semantics issue - mmap() vs. revoke (of any sort, including > remove_proc_entry(), etc.). Suppose a revokable file had been mmapped; > now it's going away. What should we do to its VMAs? Right now sysfs > and procfs get away

Re: [RFC] revoke(2) and generic handling of things like remove_proc_entry()

2013-04-05 Thread Greg Kroah-Hartman
On Fri, Apr 05, 2013 at 09:51:37PM +0100, Al Viro wrote: > On Fri, Apr 05, 2013 at 12:56:09PM -0700, Greg Kroah-Hartman wrote: > > > 4) nasty semantics issue - mmap() vs. revoke (of any sort, including > > > remove_proc_entry(), etc.). Suppose a revokable file had been mmapped; > > > now it's

Re: [RFC] revoke(2) and generic handling of things like remove_proc_entry()

2013-04-05 Thread Al Viro
On Fri, Apr 05, 2013 at 12:56:09PM -0700, Greg Kroah-Hartman wrote: > Which methods do you mean here? file->f_op->some_method() > The vfs core would call start_using(), or would filesystems / drivers > need to do this? The former; we have relatively few places that call file_operations members

Re: [RFC] revoke(2) and generic handling of things like remove_proc_entry()

2013-04-05 Thread Greg Kroah-Hartman
On Fri, Apr 05, 2013 at 05:29:32AM +0100, Al Viro wrote: > After some digging in procfs logics for revoking further file IO after > remove_proc_entry() (and figuring out what to do for debugfs - it also > needs something similar), I think I've got something that has potential > to become a working

Re: [RFC] revoke(2) and generic handling of things like remove_proc_entry()

2013-04-05 Thread Greg Kroah-Hartman
On Fri, Apr 05, 2013 at 05:29:32AM +0100, Al Viro wrote: After some digging in procfs logics for revoking further file IO after remove_proc_entry() (and figuring out what to do for debugfs - it also needs something similar), I think I've got something that has potential to become a working

Re: [RFC] revoke(2) and generic handling of things like remove_proc_entry()

2013-04-05 Thread Al Viro
On Fri, Apr 05, 2013 at 12:56:09PM -0700, Greg Kroah-Hartman wrote: Which methods do you mean here? file-f_op-some_method() The vfs core would call start_using(), or would filesystems / drivers need to do this? The former; we have relatively few places that call file_operations members

Re: [RFC] revoke(2) and generic handling of things like remove_proc_entry()

2013-04-05 Thread Greg Kroah-Hartman
On Fri, Apr 05, 2013 at 09:51:37PM +0100, Al Viro wrote: On Fri, Apr 05, 2013 at 12:56:09PM -0700, Greg Kroah-Hartman wrote: 4) nasty semantics issue - mmap() vs. revoke (of any sort, including remove_proc_entry(), etc.). Suppose a revokable file had been mmapped; now it's going away.

Re: [RFC] revoke(2) and generic handling of things like remove_proc_entry()

2013-04-05 Thread Hannes Frederic Sowa
On Fri, Apr 05, 2013 at 05:29:32AM +0100, Al Viro wrote: 4) nasty semantics issue - mmap() vs. revoke (of any sort, including remove_proc_entry(), etc.). Suppose a revokable file had been mmapped; now it's going away. What should we do to its VMAs? Right now sysfs and procfs get away with

Re: [RFC] revoke(2) and generic handling of things like remove_proc_entry()

2013-04-05 Thread Al Viro
On Fri, Apr 05, 2013 at 05:29:32AM +0100, Al Viro wrote: 4) nasty semantics issue - mmap() vs. revoke (of any sort, including remove_proc_entry(), etc.). Suppose a revokable file had been mmapped; now it's going away. What should we do to its VMAs? Right now sysfs and procfs get away with

[RFC] revoke(2) and generic handling of things like remove_proc_entry()

2013-04-04 Thread Al Viro
After some digging in procfs logics for revoking further file IO after remove_proc_entry() (and figuring out what to do for debugfs - it also needs something similar), I think I've got something that has potential to become a working revoke(2) with very low overhead. It will require some

[RFC] revoke(2) and generic handling of things like remove_proc_entry()

2013-04-04 Thread Al Viro
After some digging in procfs logics for revoking further file IO after remove_proc_entry() (and figuring out what to do for debugfs - it also needs something similar), I think I've got something that has potential to become a working revoke(2) with very low overhead. It will require some