lkml.org 
[lkml]   [2010]   [Sep]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/2] sysfs: Fail bin file mmap if vma close is implemented.
On Mon, 20 Sep 2010, Eric W. Biederman wrote:
>
> It is not reasonably possible to wrap vma->close(). To correctly
> wrap close would imply calling close on any vmas that remain when
> sysfs_remove_bin_file is called. Finding the proper lists walking
> them getting the locking right etc, requires deep knowledge of the
> mm subsystem and as such would require assistence from the mm
> subsystem to implement. That assistence does not currently exist.

Isn't it fair to assume that the call to sysfs_remove_bin_file() would
come from the module (or whatever) that would be handling the ->mmap,
->open, ->close, ->fault etc. calls?

In which case, it has been kept up to date with the reference counting
so far: and if it judges that it's apppropriate now to remove bin file,
despite having received more mmaps and opens than closes, then I think
it should be allowed to make that decision (knowing that your sysfs end
will take care not to call it further), even though it wanted to support
close while the sysfs bin file was still there.

I think it would be nicer to leave the bin_vma_close() handling as you
had it before (but repositioning its sysfs_get_active more carefully,
as in your 2/2).

Hugh


\
 
 \ /
  Last update: 2010-09-22 21:33    [W:0.170 / U:0.812 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site