All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Fix mmap bugs with sysfs_remove_bin_file
@ 2010-09-20  7:55 Eric W. Biederman
  2010-09-20  7:56 ` [PATCH 1/2] sysfs: Fail bin file mmap if vma close is implemented Eric W. Biederman
  2010-09-20  7:57 ` [PATCH 2/2] sysfs: only access bin file vm_ops with the active lock Eric W. Biederman
  0 siblings, 2 replies; 7+ messages in thread
From: Eric W. Biederman @ 2010-09-20  7:55 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-kernel, Tejun Heo, Hugh Dickins


While reviewing the sysfs mmap code in fs/sysfs/bin.c I found two
rather nasty potential issues.

The first is if one of our wrapped mmap implementations implements
vma->close() we do not call it at sysfs_remove_bin_file time leading
to who knows what carnage.

The second is that we are potentially accessing the wrapped vm_ops
after sysfs_remove_bin_file has completed.   Which could be a problem
if it is a modular user.

I don't know of any real world instances of problems.  None of the
bin attribute mmaps functions that I know of today implement a close
method.  However it seems prudent to fix these now before we have
track down some mysterious weird failure with hotunplug.

Eric W. Biederman (2):
      sysfs: Fail bin file mmap if vma close is implemented.
      sysfs: only access bin file vm_ops with the active lock
---
 fs/sysfs/bin.c |   68 ++++++++++++++++++++++++++++----------------------------
 1 files changed, 34 insertions(+), 34 deletions(-)

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-09-22 21:59 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-20  7:55 [PATCH 0/2] Fix mmap bugs with sysfs_remove_bin_file Eric W. Biederman
2010-09-20  7:56 ` [PATCH 1/2] sysfs: Fail bin file mmap if vma close is implemented Eric W. Biederman
2010-09-22 19:31   ` Hugh Dickins
2010-09-22 21:01     ` Eric W. Biederman
2010-09-20  7:57 ` [PATCH 2/2] sysfs: only access bin file vm_ops with the active lock Eric W. Biederman
2010-09-22 19:49   ` Hugh Dickins
2010-09-22 21:59     ` Eric W. Biederman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.