IB/hfi1: Fix SL array bounds check
authorIra Weiny <ira.weiny@intel.com>
Thu, 20 Sep 2018 19:58:46 +0000 (12:58 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 4 Oct 2018 00:01:51 +0000 (17:01 -0700)
commit7eb3b86dc7f0183f1d7c880f6921d1f36e1eabe8
tree58c2aa78a98b32e01d6eaa42f02e0d62fcf1b7fa
parent61b5997ba333e44e7c58e8caa26e463c40ada5db
IB/hfi1: Fix SL array bounds check

commit 0dbfaa9f2813787679e296eb5476e40938ab48c8 upstream.

The SL specified by a user needs to be a valid SL.

Add a range check to the user specified SL value which protects from
running off the end of the SL to SC table.

CC: stable@vger.kernel.org
Fixes: 7724105686e7 ("IB/hfi1: add driver files")
Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/infiniband/hw/hfi1/verbs.c