tmpfs - Fix races in tmpfs_nrename() and tmpfs_nrmdir()
authorMatthew Dillon <dillon@apollo.backplane.com>
Sat, 22 Feb 2020 19:12:35 +0000 (11:12 -0800)
committerMatthew Dillon <dillon@apollo.backplane.com>
Sun, 23 Feb 2020 20:08:41 +0000 (12:08 -0800)
commit4c154053a6f1aef9ba3f6ae061fb783066b93700
tree264dcb4d946c1e58e642c712183585af8146d682
parenta44ecf5cff5e78c606454d7c0e55bbdaa0305bb3
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.
sys/vfs/tmpfs/tmpfs.h
sys/vfs/tmpfs/tmpfs_subr.c
sys/vfs/tmpfs/tmpfs_vnops.c