RDMA/hns: Fix memory corruption when allocating XRCDN
mainline inclusion from mainline-v5.13-rc1 commit 783cf673 category: feature bugzilla: 174002 CVE:NA Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=783cf673b05ebf290317f583ee7eb6967ed9c964 ---------------------------------------------------------------------- It's incorrect to cast the type of pointer to xrcdn from (u32 *) to (unsigned long *), then pass it into hns_roce_bitmap_alloc(), this will lead to a memory corruption. Fixes: 32548870 ("RDMA/hns: Add support for XRC on HIP09") Link: https://lore.kernel.org/r/1616381069-51759-1-git-send-email-liweihang@huawei.com Reported-by:Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by:
Weihang Li <liweihang@huawei.com> Reviewed-by:
Leon Romanovsky <leonro@nvidia.com> Signed-off-by:
Jason Gunthorpe <jgg@nvidia.com> Signed-off-by:
wangsirong <wangsirong@huawei.com> Reviewed-by:
ChunZhi Hu <huchunzhi@huawei.com> Signed-off-by:
Zheng Zengkai <zhengzengkai@huawei.com>
Loading
Please sign in to comment