RDMA/mlx5: Fix integer overflow of user QP buffer size
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ e126ba97dba9edeb6fafa3665b5f8497fc9cdf8c · < 5b6cfc6d7ff0959dd9766fdc24286a253b59ca77| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
RDMA/mlx5: Fix integer overflow of user QP buffer size
set_user_buf_size() computes the QP buffer size by left-shifting the user-supplied rq.wqe_cnt and rq.wqe_shift values as signed integers. A sufficiently large rq.wqe_cnt causes signed integer overflow, which is undefined behavior, and yields a small or negative buf_size, causing ib_umem_get() to map a buffer smaller than the hardware will actually write into.
Replace the shifts and addition with check_shl_overflow() and check_add_overflow(), rejecting invalid user inputs.
Moreover, guard the identical shift computing qp->sq.offset in _create_user_qp() before set_user_buf_size() is reached.
From the CVE record · Linux
The Linux kernel’s RDMA/mlx5 user QP code can overflow signed integers when calculating a buffer size from user-supplied values. A local user who supplies a sufficiently large rq.wqe_cnt can cause the driver to map a buffer smaller than the hardware will write into.
Engineers running Linux kernels with RDMA/mlx5 user QP support should check whether their kernel includes the fix; affected versions were not specified.