mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Handle negative FDs in syscall points
Updates #4805 PiperOrigin-RevId: 450980807
This commit is contained in:
committed by
gVisor bot
parent
657b52920d
commit
d2743355ae
@@ -35,13 +35,16 @@ func newExitMaybe(info kernel.SyscallInfo) *pb.Exit {
|
||||
}
|
||||
|
||||
func getFilePath(t *kernel.Task, fd int32) string {
|
||||
if fd < 0 {
|
||||
return ""
|
||||
}
|
||||
fdt := t.FDTable()
|
||||
if fdt == nil {
|
||||
return "[err: no FD table]"
|
||||
}
|
||||
file, _ := fdt.GetVFS2(fd)
|
||||
if file == nil {
|
||||
return "[err: requires VFS2]"
|
||||
return "[err: FD not found]"
|
||||
}
|
||||
defer file.DecRef(t)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user