| 123456789101112131415161718192021222324252627282930313233343536373839404142 |
- From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
- From: Elena Reshetova <[email protected]>
- Date: Mon, 4 Sep 2017 13:11:54 +0300
- Subject: [PATCH] fs: prevent speculative execution
- MIME-Version: 1.0
- Content-Type: text/plain; charset=UTF-8
- Content-Transfer-Encoding: 8bit
- CVE-2017-5753
- CVE-2017-5715
- Real commit text tbd
- Signed-off-by: Elena Reshetova <[email protected]>
- Signed-off-by: Tim Chen <[email protected]>
- Signed-off-by: Andy Whitcroft <[email protected]>
- Signed-off-by: Kleber Sacilotto de Souza <[email protected]>
- (cherry picked from commit 1ca9e14b253a501f055c3ea29d992c028473676e)
- Signed-off-by: Fabian Grünbichler <[email protected]>
- ---
- include/linux/fdtable.h | 4 +++-
- 1 file changed, 3 insertions(+), 1 deletion(-)
- diff --git a/include/linux/fdtable.h b/include/linux/fdtable.h
- index 6e84b2cae6ad..09b124542bb8 100644
- --- a/include/linux/fdtable.h
- +++ b/include/linux/fdtable.h
- @@ -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;
- }
-
- --
- 2.14.2
|