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

Matthew Dillon dillon at crater.dragonflybsd.org
Sun Feb 23 12:08:47 PST 2020


commit 4c154053a6f1aef9ba3f6ae061fb783066b93700
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/4c154053a6f1aef9ba3f6ae061fb783066b93700


-- 
DragonFly BSD source repository


More information about the Commits mailing list