linux-cifs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCHES] RCU pathwalk race fixes
@ 2024-02-04  2:14 Al Viro
  2024-02-04  2:17 ` [PATCH 01/13] fs/super.c: don't drop ->s_user_ns until we free struct super_block itself Al Viro
                   ` (2 more replies)
  0 siblings, 3 replies; 36+ messages in thread
From: Al Viro @ 2024-02-04  2:14 UTC (permalink / raw)
  To: linux-fsdevel
  Cc: Linus Torvalds, Christian Brauner, linux-ext4, linux-nfs,
	Miklos Szeredi, linux-cifs

	We still have some races in filesystem methods when exposed
to RCU pathwalk.  The series below is a result of code audit (the
second round of it) and it should deal with most of that stuff.
Exceptions: ntfs3 ->d_hash()/->d_compare() and ceph_d_revalidate().
Up to maintainers (a note for NTFS folks - when documentation says
that a method may not block, it *does* imply that blocking allocations
are to be avoided.  Really).

	Branch is 6.8-rc1-based; it lives in
git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs.git fixes.pathwalk-rcu

Individual patches are in followups; ditto for code audit notes.  Beginning
of the latter should probably be converted into docs; if anyone is willing
to help with such conversion, please say so - I'll be glad to answer any
questions, etc.

If somebody wants to grab bits and pieces of that series into individual
filesystem git trees, please say so.  Same for any problems spotted in
the patches, obviously.  If nothing shows up, that goes into #fixes and
into mainline.

Shortlog:
      fs/super.c: don't drop ->s_user_ns until we free struct super_block itself
      rcu pathwalk: prevent bogus hard errors from may_lookup()
      affs: free affs_sb_info with kfree_rcu()
      exfat: move freeing sbi, upcase table and dropping nls into rcu-delayed helper
      hfsplus: switch to rcu-delayed unloading of nls and freeing ->s_fs_info
      afs: fix __afs_break_callback() / afs_drop_open_mmap() race
      nfs: make nfs_set_verifier() safe for use in RCU pathwalk
      nfs: fix UAF on pathwalk running into umount
      procfs: move dropping pde and pid from ->evict_inode() to ->free_inode()
      procfs: make freeing proc_fs_info rcu-delayed
      fuse: fix UAF in rcu pathwalks
      cifs_get_link(): bail out in unsafe case
      ext4_get_link(): fix breakage in RCU mode

Diffstat:
 fs/affs/affs.h            |  1 +
 fs/affs/super.c           |  2 +-
 fs/afs/file.c             |  8 ++++++--
 fs/exfat/exfat_fs.h       |  1 +
 fs/exfat/nls.c            | 14 ++++----------
 fs/exfat/super.c          | 20 +++++++++++---------
 fs/ext4/symlink.c         |  8 +++++---
 fs/fuse/cuse.c            |  3 +--
 fs/fuse/fuse_i.h          |  1 +
 fs/fuse/inode.c           | 15 +++++++++++----
 fs/hfsplus/hfsplus_fs.h   |  1 +
 fs/hfsplus/super.c        | 12 +++++++++---
 fs/namei.c                |  6 +++++-
 fs/nfs/client.c           | 13 ++++++++++---
 fs/nfs/dir.c              |  4 ++--
 fs/proc/base.c            |  2 --
 fs/proc/inode.c           | 19 ++++++++-----------
 fs/proc/root.c            |  2 +-
 fs/smb/client/cifsfs.c    |  3 +++
 fs/super.c                | 13 ++++---------
 include/linux/nfs_fs_sb.h |  2 ++
 include/linux/proc_fs.h   |  1 +
 22 files changed, 88 insertions(+), 63 deletions(-)

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

end of thread, other threads:[~2024-03-06 10:21 UTC | newest]

Thread overview: 36+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-04  2:14 [PATCHES] RCU pathwalk race fixes Al Viro
2024-02-04  2:17 ` [PATCH 01/13] fs/super.c: don't drop ->s_user_ns until we free struct super_block itself Al Viro
2024-02-04  2:17   ` [PATCH 02/13] rcu pathwalk: prevent bogus hard errors from may_lookup() Al Viro
2024-02-05 12:26     ` Christian Brauner
2024-02-04  2:17   ` [PATCH 03/13] affs: free affs_sb_info with kfree_rcu() Al Viro
2024-02-05 12:26     ` Christian Brauner
2024-02-04  2:17   ` [PATCH 04/13] exfat: move freeing sbi, upcase table and dropping nls into rcu-delayed helper Al Viro
2024-02-05 12:27     ` Christian Brauner
2024-02-04  2:17   ` [PATCH 05/13] hfsplus: switch to rcu-delayed unloading of nls and freeing ->s_fs_info Al Viro
2024-02-05 12:27     ` Christian Brauner
2024-02-04  2:17   ` [PATCH 06/13] afs: fix __afs_break_callback() / afs_drop_open_mmap() race Al Viro
2024-02-05 12:28     ` Christian Brauner
2024-02-04  2:17   ` [PATCH 07/13] nfs: make nfs_set_verifier() safe for use in RCU pathwalk Al Viro
2024-02-05 12:29     ` Christian Brauner
2024-02-04  2:17   ` [PATCH 08/13] nfs: fix UAF on pathwalk running into umount Al Viro
2024-02-05 12:29     ` Christian Brauner
2024-02-04  2:17   ` [PATCH 09/13] procfs: move dropping pde and pid from ->evict_inode() to ->free_inode() Al Viro
2024-02-05 12:30     ` Christian Brauner
2024-02-04  2:17   ` [PATCH 10/13] procfs: make freeing proc_fs_info rcu-delayed Al Viro
2024-02-05 12:31     ` Christian Brauner
2024-02-04  2:17   ` [PATCH 11/13] fuse: fix UAF in rcu pathwalks Al Viro
2024-02-05 12:31     ` Christian Brauner
2024-02-05 13:51       ` Miklos Szeredi
2024-03-04 14:36         ` Amir Goldstein
2024-03-05 12:43           ` Miklos Szeredi
2024-03-06 10:18             ` Amir Goldstein
2024-03-06 10:21               ` Miklos Szeredi
2024-02-04  2:17   ` [PATCH 12/13] cifs_get_link(): bail out in unsafe case Al Viro
2024-02-04 15:45     ` Steve French
2024-02-04 16:25       ` Al Viro
2024-02-04 16:41         ` Al Viro
2024-02-04  2:17   ` [PATCH 13/13] ext4_get_link(): fix breakage in RCU mode Al Viro
2024-02-05 12:24   ` [PATCH 01/13] fs/super.c: don't drop ->s_user_ns until we free struct super_block itself Christian Brauner
2024-02-05 12:36   ` Jeff Layton
2024-02-04  2:27 ` RCU pathwalk audit notes Al Viro
2024-02-05 12:48 ` [PATCHES] RCU pathwalk race fixes Jeff Layton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).