Commit 905b2bac authored by Elena Reshetova's avatar Elena Reshetova Committed by Marcelo Henrique Cerri

fs: prevent speculative execution

CVE-2017-5753
CVE-2017-5715

Real commit text tbd
Signed-off-by: default avatarElena Reshetova <elena.reshetova@intel.com>
Signed-off-by: default avatarTim Chen <tim.c.chen@linux.intel.com>
Signed-off-by: default avatarAndy Whitcroft <apw@canonical.com>
(cherry picked from commit 8a0f2aeaa333f5c4e41b5d366745015fa855232f)
Signed-off-by: default avatarAndy Whitcroft <apw@canonical.com>
parent 904c6712
...@@ -81,8 +81,10 @@ static inline struct file *__fcheck_files(struct files_struct *files, unsigned i ...@@ -81,8 +81,10 @@ static inline struct file *__fcheck_files(struct files_struct *files, unsigned i
{ {
struct fdtable *fdt = rcu_dereference_raw(files->fdt); struct fdtable *fdt = rcu_dereference_raw(files->fdt);
if (fd < fdt->max_fds) if (fd < fdt->max_fds) {
gmb();
return rcu_dereference_raw(fdt->fd[fd]); return rcu_dereference_raw(fdt->fd[fd]);
}
return NULL; return NULL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment