mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-05 19:31:57 -04:00
UPSTREAM: fs: prevent out-of-bounds array speculation when closing a file descriptor
commit 609d54441493c99f21c1823dfd66fa7f4c512ff4 upstream. Google-Bug-Id: 114199369 Change-Id: I7bb99947dd7fa5620cee7402d8823320dc642490 Signed-off-by: Theodore Ts'o <tytso@mit.edu> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
df68cf2cb7
commit
5e262e0970
1 changed files with 1 additions and 0 deletions
|
|
@ -669,6 +669,7 @@ static struct file *pick_file(struct files_struct *files, unsigned fd)
|
|||
file = ERR_PTR(-EINVAL);
|
||||
goto out_unlock;
|
||||
}
|
||||
fd = array_index_nospec(fd, fdt->max_fds);
|
||||
file = fdt->fd[fd];
|
||||
if (!file) {
|
||||
file = ERR_PTR(-EBADF);
|
||||
|
|
|
|||
Loading…
Reference in a new issue