1. 17 12月, 2009 2 次提交
  2. 05 10月, 2009 1 次提交
  3. 23 9月, 2009 1 次提交
    • D
      anonfd: split interface into file creation and install · 562787a5
      Davide Libenzi 提交于
      Split the anonfd interface into a bare file pointer creation one, and a
      file pointer creation plus install one.
      
      There are cases, like the usage of eventfds inside other kernel
      interfaces, where the file pointer created by anonfd needs to be used
      inside the initialization of other structures.
      
      As it is right now, as soon as anon_inode_getfd() returns, the kenrle can
      race with userspace closing the newly installed file descriptor.
      
      This patch, while keeping the old anon_inode_getfd(), introduces a new
      anon_inode_getfile() (whose services are reused in anon_inode_getfd())
      that allows to split the file creation phase and the fd install one.
      
      Once all the kernel structures are initialized, the code can call the
      proper fd_install().
      
      Gregory manifested the need for something like this inside KVM.
      Signed-off-by: NDavide Libenzi <davidel@xmailserver.org>
      Cc: Alexander Viro <viro@zeniv.linux.org.uk>
      Cc: James Morris <jmorris@namei.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Gregory Haskins <ghaskins@novell.com>
      Acked-by: NSerge Hallyn <serue@us.ibm.com>
      Acked-by: NRoland Dreier <rolandd@cisco.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      562787a5
  4. 18 6月, 2009 1 次提交
  5. 28 3月, 2009 1 次提交
  6. 31 12月, 2008 1 次提交
    • C
      anon_inodes: use fops->owner for module refcount · e3a2a0d4
      Christian Borntraeger 提交于
      There is an imbalance for anonymous inodes. If the fops->owner field is set,
      the module reference count of owner is decreases on release.
      ("filp_close" --> "__fput" ---> "fops_put")
      
      On the other hand, anon_inode_getfd does not increase the module reference
      count of owner. This causes two problems:
      
      - if owner is set, the module refcount goes negative
      - if owner is not set, the module can be unloaded while code is running
      
      This patch changes anon_inode_getfd to be symmetric regarding fops->owner
      handling.
      
      I have checked all existing users of anon_inode_getfd. Noone sets fops->owner,
      thats why nobody has seen the module refcount negative. The refcounting was
      tested with a patched and unpatched KVM module.(see patch 2/2) I also did an
      epoll_open/close test.
      Signed-off-by: NChristian Borntraeger <borntraeger@de.ibm.com>
      Reviewed-by: NDavide Libenzi <davidel@xmailserver.org>
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      e3a2a0d4
  7. 14 11月, 2008 1 次提交
  8. 25 7月, 2008 2 次提交
  9. 02 5月, 2008 1 次提交
    • A
      [PATCH] sanitize anon_inode_getfd() · 2030a42c
      Al Viro 提交于
      a) none of the callers even looks at inode or file returned by anon_inode_getfd()
      b) any caller that would try to look at those would be racy, since by the time
      it returns we might have raced with close() from another thread and that
      file would be pining for fjords.
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      2030a42c
  10. 19 3月, 2008 1 次提交
  11. 17 10月, 2007 1 次提交
  12. 17 7月, 2007 1 次提交
  13. 16 7月, 2007 1 次提交
  14. 11 5月, 2007 1 次提交