|
@@ -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>
|
|
@@ -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;
|