IB/hfi1: Validate fault injection opcode user input
authorKaike Wan <kaike.wan@intel.com>
Fri, 7 Jun 2019 12:25:25 +0000 (08:25 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 25 Jun 2019 03:35:53 +0000 (11:35 +0800)
commit7cc9c993094773c409338da34f7d0231b0e69024
tree0bd8b09915e0d5a82f914312d3b13d6cf0d4e0e8
parent17027034a47bda8a8fc96f2875ff19062c90e18c
IB/hfi1: Validate fault injection opcode user input

commit 5f90677ed31963abb184ee08ebee4a4a68225dd8 upstream.

The opcode range for fault injection from user should be validated before
it is applied to the fault->opcodes[] bitmap to avoid out-of-bound
error.

Cc: <stable@vger.kernel.org>
Fixes: a74d5307caba ("IB/hfi1: Rework fault injection machinery")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Kaike Wan <kaike.wan@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/fault.c