gvisor/pkg/sentry/fs/ramfs
Michael Pratt 8a499ae65f Remove references to replaced child in Rename in ramfs/agentfs
In the case of a rename replacing an existing destination inode, ramfs
Rename failed to first remove the replaced inode. This caused:

1. A leak of a reference to the inode (making it live indefinitely).
2. For directories, a leak of the replaced directory's .. link to the
   parent. This would cause the parent's link count to incorrectly
   increase.

(2) is much simpler to test than (1), so that's what I've done.

agentfs has a similar bug with link count only, so the Dirent layer
informs the Inode if this is a replacing rename.

Fixes #133

PiperOrigin-RevId: 239105698
Change-Id: I4450af2462d8ae3339def812287213d2cbeebde0
2019-03-18 18:40:06 -07:00
..
BUILD Remove license comments 2019-01-31 11:12:53 -08:00
dir.go Remove references to replaced child in Rename in ramfs/agentfs 2019-03-18 18:40:06 -07:00
socket.go Remove fs.Handle, ramfs.Entry, and all the DeprecatedFileOperations. 2019-01-14 20:34:28 -08:00
symlink.go Remove fs.Handle, ramfs.Entry, and all the DeprecatedFileOperations. 2019-01-14 20:34:28 -08:00
tree.go Remove fs.Handle, ramfs.Entry, and all the DeprecatedFileOperations. 2019-01-14 20:34:28 -08:00
tree_test.go Remove fs.Handle, ramfs.Entry, and all the DeprecatedFileOperations. 2019-01-14 20:34:28 -08:00