Skip to content

Commit bbea34e

Browse files
committed
Merge tag 'pull-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull vfs fix from Al Viro: "do_dup2() out-of-bounds array speculation fix" * tag 'pull-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: protect the fetch of ->fd[fd] in do_dup2() from mispredictions
2 parents c0ecd63 + 8aa37bd commit bbea34e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

fs/file.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1248,6 +1248,7 @@ __releases(&files->file_lock)
12481248
* tables and this condition does not arise without those.
12491249
*/
12501250
fdt = files_fdtable(files);
1251+
fd = array_index_nospec(fd, fdt->max_fds);
12511252
tofree = fdt->fd[fd];
12521253
if (!tofree && fd_is_open(fd, fdt))
12531254
goto Ebusy;

0 commit comments

Comments
 (0)