In the Linux kernel, the following vulnerability has been resolved:
IB/mlx5: Fix initializing CQ fragments buffer
The function initcqfragbuf() can be called to initialize the current CQ fragments buffer cq->buf, or the temporary cq->resizebuf that is filled during CQ resize operation.
However, the offending commit started to use function getcqe() for getting the CQEs, the issue with this change is that getcqe() always returns CQEs from cq->buf, which leads us to initialize the wrong buffer, and in case of enlarging the CQ we try to access elements beyond the size of the current cq->buf and eventually hit a kernel panic.
[exception RIP: initcqfragbuf+103] [ffff9f799ddcbcd8] mlx5ibresizecq at ffffffffc0835d60 [mlx5ib] [ffff9f799ddcbdb0] ibresizecq at ffffffffc05270df [ibcore] [ffff9f799ddcbdc0] lltrdmasetupqp at ffffffffc0a6a712 [llt] [ffff9f799ddcbe10] lltrdmacceventaction at ffffffffc0a6b411 [llt] [ffff9f799ddcbe98] lltrdmaclientconnthread at ffffffffc0a6bb75 [llt] [ffff9f799ddcbec8] kthread at ffffffffa66c5da1 [ffff9f799ddcbf50] retfromforknospec_begin at ffffffffa6d95ddd
Fix it by getting the needed CQE by calling mlx5fragbufgetwqe() that takes the correct source buffer as a parameter.