]> 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)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Thu, 11 Jan 2018 18:49:42 +0000 (19:49 +0100)
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>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
include/linux/fdtable.h

index 6e84b2cae6ad62b529298b662856dc857c3091b6..09b124542bb828b336baa6eea6e85903268edc81 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;
 }