diff --git a/fs/file.c b/fs/file.c index fc892423bbe1..d816f2d8fb93 100644 --- a/fs/file.c +++ b/fs/file.c @@ -1252,6 +1252,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;