linux_dsm_epyc7002/drivers/infiniband
Aharon Landau 56c1362981 RDMA/umem: Avoid undefined behavior of rounddown_pow_of_two()
[ Upstream commit b79f2dc5ffe17b03ec8c55f0d63f65e87bcac676 ]

rounddown_pow_of_two() is undefined when the input is 0. Therefore we need
to avoid it in ib_umem_find_best_pgsz and return 0.  Otherwise, it could
result in not rejecting an invalid page size which eventually causes a
kernel oops due to the logical inconsistency.

Fixes: 3361c29e92 ("RDMA/umem: Use simpler logic for ib_umem_find_best_pgsz()")
Link: https://lore.kernel.org/r/20210113121703.559778-2-leon@kernel.org
Signed-off-by: Aharon Landau <aharonl@nvidia.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Reviewed-by: Maor Gottlieb <maorg@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-01-27 11:55:08 +01:00
..
core RDMA/umem: Avoid undefined behavior of rounddown_pow_of_two() 2021-01-27 11:55:08 +01:00
hw IB/mlx5: Fix error unwinding when set_has_smi_cap fails 2021-01-19 18:27:32 +01:00
sw RDMA/siw,rxe: Make emulated devices virtual in the device tree 2021-01-09 13:46:24 +01:00
ulp RDMA/rtrs-srv: Don't guard the whole __alloc_srv with srv_mutex 2020-12-30 11:52:59 +01:00
Kconfig RMDA/sw: Don't allow drivers using dma_virt_ops on highmem configs 2020-11-12 13:27:41 -04:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00