OSDN Git Service

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>
Wed, 3 Oct 2018 23:59:20 +0000 (16:59 -0700)
commit2cced23e54834ebef19152b5246b1209329b27e0
tree12f7b5034ae53dbdae70abe4b538e57927e7ba44
parentfa22f4874e9409bcb321839ceefeadb88e423b9f
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