public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] fix debugfs file removal races
@ 2016-02-08 15:00 Nicolai Stange
  2016-02-08 15:02 ` [PATCH v2 1/2] debugfs: prevent access to possibly dead file_operations at file open Nicolai Stange
  2016-02-08 15:03 ` [PATCH v2 2/2] debugfs: prevent access to removed files' private data Nicolai Stange
  0 siblings, 2 replies; 10+ messages in thread
From: Nicolai Stange @ 2016-02-08 15:00 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Alexander Viro, Nicolai Stange, Jonathan Corbet, Jan Kara,
	Paul E. McKenney, Andrew Morton, linux-kernel

Original v1 thread is here:

  http://lkml.kernel.org/r/8737vnvzt0.fsf@gmail.com

Paul E. McKenney has judged on v1's SRCU usage already and I did
not change anything in the related logic.

Regarding Greg K-H's comment to v1 about moving as much stuff as
possible from debugfs.h into a separate internal.h: in my opinion, new
users of debugfs should really use DEBUGFS_DEFINE_ATTRIBUTE() or
manage lifetime from their custom readers and writers via
debugfs_file_use_data_*() from now on and thus, I kept the declaration
of these within the public debugfs.h. The rest has been moved either into
internal.h or in the case of definitions, into file.c though.

Changes v1 -> v2:
  [1/2] ("debugfs: prevent access to possibly dead file_operations at file open")
   - Resolve trivial diff conflict in debugfs_remove_recursive():
     in the meanwhile, an unrelated 'mutex_unlock(...)' had been rewritten to
     'inode_unlock(...)' which broke the diff's context.
   - Introduce the fs/debugfs/internal.h header and move the declarations of
     debugfs_noop_file_operations, debugfs_proxy_file_operations and
     debugfs_rcu from include/linux/debugfs.h thereinto. Include this header
     from file.c and inode.c.
   - Add a word about the new internal header to the commit message.
   - Move the inclusion of linux/srcu.h from include/linux/debugfs.h
     into file.c and inode.c respectively.

  [2/2] ("debugfs: prevent access to removed files' private data")
   - Move the definitions of debugfs_file_use_data_start() and
     debugfs_file_use_data_finish() from include/linux/debugfs.h to
     file.c. Export them and keep their declarations in debugfs.h,
   - In order to be able to attach proper __acquires() and __releases() tags
     to the decalarations of debugfs_file_use_data_*() in debugfs.h,
     move the debugfs_srcu declaration from internal.h into debugfs.h.
   - Since the definitions as well as the docstrings of
     debugfs_file_use_data_*() have been moved into file.c,
     there is no need to run DocBook on debugfs.h: do not modify
     Documentation/DocBook/filesystems.tmpl anymore.
   - In the commit message, encourage new users of debugfs to prefer
     DEFINE_DEBUGFS_ATTRIBUTE() and friends over DEFINE_SIMPLE_ATTRIBUTE().
     
Nicolai Stange (2):
  debugfs: prevent access to possibly dead file_operations at file open
  debugfs: prevent access to removed files' private data

 fs/debugfs/file.c       | 252 +++++++++++++++++++++++++++++++++++++++---------
 fs/debugfs/inode.c      |  18 +++-
 fs/debugfs/internal.h   |  23 +++++
 include/linux/debugfs.h |  29 +++++-
 lib/Kconfig.debug       |   1 +
 5 files changed, 273 insertions(+), 50 deletions(-)
 create mode 100644 fs/debugfs/internal.h

-- 
2.7.0

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

end of thread, other threads:[~2016-02-09 22:24 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-08 15:00 [PATCH v2 0/2] fix debugfs file removal races Nicolai Stange
2016-02-08 15:02 ` [PATCH v2 1/2] debugfs: prevent access to possibly dead file_operations at file open Nicolai Stange
2016-02-08 15:03 ` [PATCH v2 2/2] debugfs: prevent access to removed files' private data Nicolai Stange
2016-02-08 16:17   ` Greg Kroah-Hartman
2016-02-08 17:14     ` Nicolai Stange
2016-02-08 19:16       ` Greg Kroah-Hartman
2016-02-08 20:00         ` Nicolai Stange
2016-02-08 20:08           ` Greg Kroah-Hartman
2016-02-09 22:03             ` Nicolai Stange
2016-02-09 22:24               ` Greg Kroah-Hartman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox