Commit 028fcce3 authored by Doug Ledford's avatar Doug Ledford Committed by Xie XiuQi
Browse files

RDMA/umem: Fix potential addition overflow



mainline inclusion
from mainline-4.20-rc1
commit c6ce5807
category: bugfix
bugzilla: 6452
CVE: NA

--------------------------

Since Virtual Lanes BCT credits and MTU are set through separate MADs, we
Given a large enough memory allocation, it is possible to wrap the
pinned_vm counter.  Check for addition overflow to prevent such
eventualities.

Fixes: 40ddacf2 ("RDMA/umem: Don't hold mmap_sem for too long")
Reported-by: default avatarJason Gunthorpe <jgg@ziepe.ca>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
Reviewed-by: default avatarLeon Romanovsky <leonro@mellanox.com>
Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
Signed-off-by: default avatarJing Xiangfeng <jingxiangfeng@huawei.com>
Reviewed-by: default avatarHanjun Guo <guohanjun@huawei.com>
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
parent 071f5d01
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment