linux/drivers/infiniband
Jason Gunthorpe 515f60004e RDMA/hns: Prevent undefined behavior in hns_roce_set_user_sq_size()
The "ucmd->log_sq_bb_count" variable is a user controlled variable in the
0-255 range.  If we shift more than then number of bits in an int then
it's undefined behavior (it shift wraps), and potentially the int could
become negative.

Fixes: 9a4435375c ("IB/hns: Add driver files for hns RoCE driver")
Link: https://lore.kernel.org/r/20190608092514.GC28890@mwanda
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
2019-10-28 11:20:34 -03:00
..
core RDMA/cm: Update copyright together with SPDX tag 2019-10-28 10:15:11 -03:00
hw RDMA/hns: Prevent undefined behavior in hns_roce_set_user_sq_size() 2019-10-28 11:20:34 -03:00
sw RDMA/rxe: Remove useless rxe_init_device_param assignments 2019-10-24 15:20:18 -03:00
ulp infiniband: fix ulp/iser/iser_initiator.c kernel-doc warnings 2019-10-22 14:52:56 -03:00
Kconfig RDMA/iw_cxgb3: Remove the iw_cxgb3 module from kernel 2019-10-04 15:08:59 -03:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00