History

Merge tag 'for-gkh' of git://git.kernel.org/pub/scm/linux/kernel/git/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

Greg Kroah-Hartman committed 8 years ago

Commit eb6d9382 parents fa520c4 a3671a42 files · +6 −0Browse files

Unified · Split

2 files
  1. drivers/infiniband/core/ucm.c +3 −0
  2. drivers/infiniband/core/ucma.c +3 −0
drivers/infiniband/core/ucm.c+3−0
@@ -46,6 +46,8 @@ · 45 unmodified lines
4646 #include <linux/mutex.h>
4747 #include <linux/slab.h>
4848
49+#include <linux/nospec.h>
50+
4951 #include <linux/uaccess.h>
5052
5153 #include <rdma/ib.h>
@@ -1120,6 +1122,7 @@ static ssize_t ib_ucm_write(struct file *filp, const char __user *buf, · 1068 unmodified lines
11201122
11211123 if (hdr.cmd >= ARRAY_SIZE(ucm_cmd_table))
11221124 return -EINVAL;
1125+ hdr.cmd = array_index_nospec(hdr.cmd, ARRAY_SIZE(ucm_cmd_table));
11231126
11241127 if (hdr.in + sizeof(hdr) > len)
11251128 return -EINVAL;
drivers/infiniband/core/ucma.c+3−0
@@ -44,6 +44,8 @@ · 43 unmodified lines
4444 #include <linux/module.h>
4545 #include <linux/nsproxy.h>
4646
47+#include <linux/nospec.h>
48+
4749 #include <rdma/rdma_user_cm.h>
4850 #include <rdma/ib_marshall.h>
4951 #include <rdma/rdma_cm.h>
@@ -1676,6 +1678,7 @@ static ssize_t ucma_write(struct file *filp, const char __user *buf, · 1626 unmodified lines
16761678
16771679 if (hdr.cmd >= ARRAY_SIZE(ucma_cmd_table))
16781680 return -EINVAL;
1681+ hdr.cmd = array_index_nospec(hdr.cmd, ARRAY_SIZE(ucma_cmd_table));
16791682
16801683 if (hdr.in + sizeof(hdr) > len)
16811684 return -EINVAL;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t