diff --git a/fs/file.c b/fs/file.c index af3968e29ecfe1a49b2d3c36397ac19e4d9a6d53..8d5052d5e7e6562d3f2476c537b3581d5439a0d9 100644 --- a/fs/file.c +++ b/fs/file.c @@ -1143,6 +1143,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)) { err = -EBUSY;