diff options
author | Fabricio Voznika <fvoznika@google.com> | 2018-09-05 18:05:59 -0700 |
---|---|---|
committer | Shentubot <shentubot@google.com> | 2018-09-05 18:07:11 -0700 |
commit | 41b56696c4923276c6269812bb3dfa7643dab65d (patch) | |
tree | 3aa1afbe82e66b74efe97d6685449a956dd906d9 /pkg/sentry/control | |
parent | 5685d6b5add2acce9618aa908b846f5ce3658346 (diff) |
Imported FD in exec was leaking
Imported file needs to be closed after it's
been imported.
PiperOrigin-RevId: 211732472
Change-Id: Ia9249210558b77be076bcce465b832a22eed301f
Diffstat (limited to 'pkg/sentry/control')
-rw-r--r-- | pkg/sentry/control/proc.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/pkg/sentry/control/proc.go b/pkg/sentry/control/proc.go index 2493c5175..4848a5d2b 100644 --- a/pkg/sentry/control/proc.go +++ b/pkg/sentry/control/proc.go @@ -119,6 +119,10 @@ func (proc *Proc) Exec(args *ExecArgs, waitStatus *uint32) error { return err } defer file.DecRef() + + // We're done with this file. + f.Close() + if err := fdm.NewFDAt(kdefs.FD(appFD), file, kernel.FDFlags{}, l); err != nil { return err } |