git: DragonFly_RELEASE_5_8 tmpfs - Fix races in tmpfs_nrename() and tmpfs_nrmdir()

Matthew Dillon dillon at crater.dragonflybsd.org
Sun Feb 23 12:10:02 PST 2020


commit b8ffa3ea9edf3812e2a09e9de8f8c9ba4bf9bab9
Author: Matthew Dillon <dillon at apollo.backplane.com>
Date:   Sat Feb 22 11:12:35 2020 -0800

    tmpfs - Fix races in tmpfs_nrename() and tmpfs_nrmdir()
    
    * Lock all nrename elements before checks.  This is particularly
      important when renaming over a file or empty directory, but other
      manipulations done by this code without locks could also cause
      races which result in corruption, particularly with the link count.
    
    * Lock all nrmdir elements before checks, for the same reason.

Summary of changes:
 sys/vfs/tmpfs/tmpfs.h       |  4 +++
 sys/vfs/tmpfs/tmpfs_subr.c  | 27 +++++++++++++++++++
 sys/vfs/tmpfs/tmpfs_vnops.c | 64 ++++++++++++++++++++-------------------------
 3 files changed, 59 insertions(+), 36 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/b8ffa3ea9edf3812e2a09e9de8f8c9ba4bf9bab9


-- 
DragonFly BSD source repository


More information about the Commits mailing list