diff --git a/fs/file.c b/fs/file.c index 578864368f6dc3ad67c3f941c6d67c5cbaf74727..cdee1ff8cf42da21213d520ad2b61143189a6747 100644 --- a/fs/file.c +++ b/fs/file.c @@ -1208,6 +1208,7 @@ __releases(&files->file_lock) * tables and this condition does not arise without those. */ fdt = files_fdtable(files); + fd = array_index_nospec(fd, fdt->max_fds); tofree = fdt->fd[fd]; if (!tofree && fd_is_open(fd, fdt)) goto Ebusy;