]> git.proxmox.com Git - pve-kernel.git/blob - patches/kernel/0270-fs-prevent-speculative-execution.patch
bf8522541f48f68849e6792401b3420f5d8c3938
[pve-kernel.git] / patches / kernel / 0270-fs-prevent-speculative-execution.patch
1 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2 From: Elena Reshetova <elena.reshetova@intel.com>
3 Date: Mon, 4 Sep 2017 13:11:54 +0300
4 Subject: [PATCH] fs: prevent speculative execution
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 CVE-2017-5753
10 CVE-2017-5715
11
12 Real commit text tbd
13
14 Signed-off-by: Elena Reshetova <elena.reshetova@intel.com>
15 Signed-off-by: Tim Chen <tim.c.chen@linux.intel.com>
16 Signed-off-by: Andy Whitcroft <apw@canonical.com>
17 Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
18 (cherry picked from commit 1ca9e14b253a501f055c3ea29d992c028473676e)
19 Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
20 ---
21 include/linux/fdtable.h | 4 +++-
22 1 file changed, 3 insertions(+), 1 deletion(-)
23
24 diff --git a/include/linux/fdtable.h b/include/linux/fdtable.h
25 index 6e84b2cae6ad..09b124542bb8 100644
26 --- a/include/linux/fdtable.h
27 +++ b/include/linux/fdtable.h
28 @@ -81,8 +81,10 @@ static inline struct file *__fcheck_files(struct files_struct *files, unsigned i
29 {
30 struct fdtable *fdt = rcu_dereference_raw(files->fdt);
31
32 - if (fd < fdt->max_fds)
33 + if (fd < fdt->max_fds) {
34 + gmb();
35 return rcu_dereference_raw(fdt->fd[fd]);
36 + }
37 return NULL;
38 }
39
40 --
41 2.14.2
42