]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
IB/hfi1: Ensure ucast_dlid access doesnt exceed bounds
authorDennis Dalessandro <dennis.dalessandro@intel.com>
Wed, 26 Sep 2018 17:55:53 +0000 (10:55 -0700)
committerKhalid Elmously <khalid.elmously@canonical.com>
Thu, 28 Nov 2019 04:59:27 +0000 (23:59 -0500)
commit07313520b3947623ef4c4ec12b2a377674f46be3
tree53a1fd9773abc2e17037a483709c0611b359d4a4
parentf9c5f2f003521e511e6a4f8811b2365ac1efbf8f
IB/hfi1: Ensure ucast_dlid access doesnt exceed bounds

BugLink: https://bugs.launchpad.net/bugs/1854216
[ Upstream commit 3144533bf667c8e53bb20656b78295960073e57b ]

The dlid assignment made by looking into the u_ucast_dlid array does not
do an explicit check for the size of the array. The code path to arrive at
def_port, the index value is long and complicated so its best to just have
an explicit check here.

Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/infiniband/ulp/opa_vnic/opa_vnic_encap.c