mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
fdtable: don't try to zap fdtable entry if close is called for non-existing fd
FDTable.setAll is used to zap entries, but it grows the table up to a specified fd. Reported-by: syzbot+9e281b0750d2d4caa190@syzkaller.appspotmail.com PiperOrigin-RevId: 301280000
This commit is contained in:
@@ -536,7 +536,9 @@ func (f *FDTable) Remove(fd int32) (*fs.File, *vfs.FileDescription) {
|
||||
case orig2 != nil:
|
||||
orig2.IncRef()
|
||||
}
|
||||
f.setAll(fd, nil, nil, FDFlags{}) // Zap entry.
|
||||
if orig != nil || orig2 != nil {
|
||||
f.setAll(fd, nil, nil, FDFlags{}) // Zap entry.
|
||||
}
|
||||
return orig, orig2
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user