Searched hist:"9 b6d3bbc1335404b331f4f11dc896066bdf1c752" (Results 1 – 1 of 1) sorted by relevance
/openbmc/linux/drivers/infiniband/hw/mlx5/ |
H A D | main.c | diff 9b6d3bbc1335404b331f4f11dc896066bdf1c752 Wed Feb 12 01:26:35 CST 2020 Leon Romanovsky <leonro@mellanox.com> RDMA/mlx5: Prevent overflow in mmap offset calculations
The cmd and index variables declared as u16 and the result is supposed to be stored in u64. The C arithmetic rules doesn't promote "(index >> 8) << 16" to be u64 and leaves the end result to be u16.
Fixes: 7be76bef320b ("IB/mlx5: Introduce VAR object and its alloc/destroy methods") Link: https://lore.kernel.org/r/20200212072635.682689-10-leon@kernel.org Signed-off-by: Leon Romanovsky <leonro@mellanox.com> Reviewed-by: Jason Gunthorpe <jgg@mellanox.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
|