]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
RDMA/irdma: Prevent zero-length STAG registration
authorChristopher Bednarz <christopher.n.bednarz@intel.com>
Fri, 18 Aug 2023 14:48:38 +0000 (09:48 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Sep 2023 07:48:33 +0000 (09:48 +0200)
commitceba966f1d6391800cab3c1c9ac1661b5166bc5b
tree3e80676d68691d5dd94f9b7a53121722225962e0
parent9406ad6d6c84414b6ec001d357700cedc18fe10e
RDMA/irdma: Prevent zero-length STAG registration

[ Upstream commit bb6d73d9add68ad270888db327514384dfa44958 ]

Currently irdma allows zero-length STAGs to be programmed in HW during
the kernel mode fast register flow. Zero-length MR or STAG registration
disable HW memory length checks.

Improve gaps in bounds checking in irdma by preventing zero-length STAG or
MR registrations except if the IB_PD_UNSAFE_GLOBAL_RKEY is set.

This addresses the disclosure CVE-2023-25775.

Fixes: b48c24c2d710 ("RDMA/irdma: Implement device supported verb APIs")
Signed-off-by: Christopher Bednarz <christopher.n.bednarz@intel.com>
Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com>
Link: https://lore.kernel.org/r/20230818144838.1758-1-shiraz.saleem@intel.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/infiniband/hw/irdma/ctrl.c
drivers/infiniband/hw/irdma/type.h
drivers/infiniband/hw/irdma/verbs.c