summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--pkg/sentry/fs/dirent_state.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/pkg/sentry/fs/dirent_state.go b/pkg/sentry/fs/dirent_state.go
index fb81e7d54..58dd01202 100644
--- a/pkg/sentry/fs/dirent_state.go
+++ b/pkg/sentry/fs/dirent_state.go
@@ -45,7 +45,13 @@ func (d *Dirent) saveChildren() map[string]*Dirent {
if rc := w.Get(); rc != nil {
// Drop the reference count obtain in w.Get()
rc.DecRef()
- c[name] = rc.(*Dirent)
+
+ cd := rc.(*Dirent)
+ if cd.IsNegative() {
+ // Don't bother saving negative Dirents.
+ continue
+ }
+ c[name] = cd
}
}
return c