|
|
@@ -54,6 +54,7 @@
|
|
|
#include <linux/mm.h>
|
|
|
#include <linux/vmalloc.h>
|
|
|
#include <rdma/opa_addr.h>
|
|
|
+#include <linux/nospec.h>
|
|
|
|
|
|
#include "hfi.h"
|
|
|
#include "common.h"
|
|
|
@@ -1596,6 +1597,7 @@ static int hfi1_check_ah(struct ib_device *ibdev, struct rdma_ah_attr *ah_attr)
|
|
|
sl = rdma_ah_get_sl(ah_attr);
|
|
|
if (sl >= ARRAY_SIZE(ibp->sl_to_sc))
|
|
|
return -EINVAL;
|
|
|
+ sl = array_index_nospec(sl, ARRAY_SIZE(ibp->sl_to_sc));
|
|
|
|
|
|
sc5 = ibp->sl_to_sc[sl];
|
|
|
if (sc_to_vlt(dd, sc5) > num_vls && sc_to_vlt(dd, sc5) != 0xf)
|