[lkml]   [2016]   [Feb]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Subject[PATCH v2 0/2] fix debugfs file removal races
Original v1 thread is here:

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

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


 \ /
  Last update: 2016-02-08 16:21    [W:0.354 / U:0.440 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site