gvisor/pkg/sentry
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
..
arch Change /proc/PID/cmdline to read environment vector. 2019-02-05 10:02:06 -08:00
context Decouple filemem from platform and move it to pgalloc.MemoryFile. 2019-03-14 08:12:48 -07:00
control Add profiling commands to runsc 2019-03-11 11:47:30 -07:00
device Remove license comments 2019-01-31 11:12:53 -08:00
fs Remove references to replaced child in Rename in ramfs/agentfs 2019-03-18 18:40:06 -07:00
hostcpu Remove license comments 2019-01-31 11:12:53 -08:00
inet Remove license comments 2019-01-31 11:12:53 -08:00
kernel Remove racy access to shm fields. 2019-03-18 10:49:03 -07:00
limits Remove license comments 2019-01-31 11:12:53 -08:00
loader Decouple filemem from platform and move it to pgalloc.MemoryFile. 2019-03-14 08:12:48 -07:00
memmap Clarify the platform.File interface. 2019-03-12 10:29:16 -07:00
memutil Decouple filemem from platform and move it to pgalloc.MemoryFile. 2019-03-14 08:12:48 -07:00
mm Decouple filemem from platform and move it to pgalloc.MemoryFile. 2019-03-14 08:12:48 -07:00
pgalloc Decouple filemem from platform and move it to pgalloc.MemoryFile. 2019-03-14 08:12:48 -07:00
platform Decouple filemem from platform and move it to pgalloc.MemoryFile. 2019-03-14 08:12:48 -07:00
safemem Priority-inheritance futex implementation 2019-03-05 23:40:18 -08:00
sighandling Remove license comments 2019-01-31 11:12:53 -08:00
socket Fix getsockopt(IP_MULTICAST_IF). 2019-03-09 11:40:51 -08:00
state Decouple filemem from platform and move it to pgalloc.MemoryFile. 2019-03-14 08:12:48 -07:00
strace Format capget/capset arguments 2019-03-01 10:46:36 -08:00
syscalls Decouple filemem from platform and move it to pgalloc.MemoryFile. 2019-03-14 08:12:48 -07:00
time Move package sync to third_party 2019-01-31 17:49:14 -08:00
unimpl Remove license comments 2019-01-31 11:12:53 -08:00
uniqueid Remove license comments 2019-01-31 11:12:53 -08:00
usage Decouple filemem from platform and move it to pgalloc.MemoryFile. 2019-03-14 08:12:48 -07:00
usermem Priority-inheritance futex implementation 2019-03-05 23:40:18 -08:00
watchdog Remove license comments 2019-01-31 11:12:53 -08:00
BUILD Remove license comments 2019-01-31 11:12:53 -08:00