mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
syscalls: Don't leak a file on the error path
Reported-by: syzbot+bb82fb556d5d0a43f632@syzkaller.appspotmail.com PiperOrigin-RevId: 336324720
This commit is contained in:
@@ -84,6 +84,7 @@ func fileOpOn(t *kernel.Task, dirFD int32, path string, resolve bool, fn func(ro
|
||||
}
|
||||
rel = f.Dirent
|
||||
if !fs.IsDir(rel.Inode.StableAttr) {
|
||||
f.DecRef(t)
|
||||
return syserror.ENOTDIR
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user