IB/qib: Protect from buffer overflow in struct qib_user_sdma_pkt fields
stable inclusion from stable-5.10.77 commit c3e17e58f571f34c51aeb17274ed02c2ed5cf780 bugzilla: 185677 https://gitee.com/openeuler/kernel/issues/I4IAP7 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=c3e17e58f571f34c51aeb17274ed02c2ed5cf780 -------------------------------- commit d39bf40e upstream. Overflowing either addrlimit or bytes_togo can allow userspace to trigger a buffer overflow of kernel memory. Check for overflows in all the places doing math on user controlled buffers. Fixes: f931551b ("IB/qib: Add new qib driver for QLogic PCIe InfiniBand adapters") Link: https://lore.kernel.org/r/20211012175519.7298.77738.stgit@awfm-01.cornelisnetworks.comReported-by: NIlja Van Sprundel <ivansprundel@ioactive.com> Reviewed-by: NDennis Dalessandro <dennis.dalessandro@cornelisnetworks.com> Signed-off-by: NMike Marciniszyn <mike.marciniszyn@cornelisnetworks.com> Signed-off-by: NDennis Dalessandro <dennis.dalessandro@cornelisnetworks.com> Signed-off-by: NJason Gunthorpe <jgg@nvidia.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: NChen Jun <chenjun102@huawei.com> Acked-by: NWeilong Chen <chenweilong@huawei.com> Signed-off-by: NChen Jun <chenjun102@huawei.com> Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
Showing
想要评论请 注册 或 登录