]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
fs: prevent speculative execution
authorElena Reshetova <elena.reshetova@intel.com>
Mon, 4 Sep 2017 10:11:54 +0000 (13:11 +0300)
committerMarcelo Henrique Cerri <marcelo.cerri@canonical.com>
Fri, 12 Jan 2018 16:46:07 +0000 (14:46 -0200)
CVE-2017-5753
CVE-2017-5715

Real commit text tbd

Signed-off-by: Elena Reshetova <elena.reshetova@intel.com>
Signed-off-by: Tim Chen <tim.c.chen@linux.intel.com>
Signed-off-by: Andy Whitcroft <apw@canonical.com>
(cherry picked from commit 8a0f2aeaa333f5c4e41b5d366745015fa855232f)
Signed-off-by: Andy Whitcroft <apw@canonical.com>
include/linux/fdtable.h

index 5295535b60c60768ccb91034b3ba290dc1a57f1a..4f2c526d568385a28e9276a175e2c037a72ecff8 100644 (file)
@@ -81,8 +81,10 @@ static inline struct file *__fcheck_files(struct files_struct *files, unsigned i
 {
        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 NULL;
 }