Skip to content

Commit

Permalink
Merge tag 'for-gkh' of git://git.kernel.org/pub/scm/linux/kernel/git/…
Browse files Browse the repository at this point in the history
…rdma/rdma

Doug writes:
  "Really final for-rc pull request for 4.19

   Ok, so last week I thought we had sent our final pull request for
   4.19.  Well, wouldn't ya know someone went and found a couple Spectre
   v1 fixes were needed :-/.  So, a couple *very* small specter patches
   for this (hopefully) final -rc week."

* tag 'for-gkh' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma:
  RDMA/ucma: Fix Spectre v1 vulnerability
  IB/ucm: Fix Spectre v1 vulnerability
  • Loading branch information
Greg Kroah-Hartman committed Oct 19, 2018
2 parents fa520c4 + a3671a4 commit eb6d938
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/infiniband/core/ucm.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@
#include <linux/mutex.h>
#include <linux/slab.h>

#include <linux/nospec.h>

#include <linux/uaccess.h>

#include <rdma/ib.h>
Expand Down Expand Up @@ -1120,6 +1122,7 @@ static ssize_t ib_ucm_write(struct file *filp, const char __user *buf,

if (hdr.cmd >= ARRAY_SIZE(ucm_cmd_table))
return -EINVAL;
hdr.cmd = array_index_nospec(hdr.cmd, ARRAY_SIZE(ucm_cmd_table));

if (hdr.in + sizeof(hdr) > len)
return -EINVAL;
Expand Down
3 changes: 3 additions & 0 deletions drivers/infiniband/core/ucma.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@
#include <linux/module.h>
#include <linux/nsproxy.h>

#include <linux/nospec.h>

#include <rdma/rdma_user_cm.h>
#include <rdma/ib_marshall.h>
#include <rdma/rdma_cm.h>
Expand Down Expand Up @@ -1676,6 +1678,7 @@ static ssize_t ucma_write(struct file *filp, const char __user *buf,

if (hdr.cmd >= ARRAY_SIZE(ucma_cmd_table))
return -EINVAL;
hdr.cmd = array_index_nospec(hdr.cmd, ARRAY_SIZE(ucma_cmd_table));

if (hdr.in + sizeof(hdr) > len)
return -EINVAL;
Expand Down

0 comments on commit eb6d938

Please sign in to comment.