OpenCloudOS-Kernel/drivers/infiniband
Bernard Metzler 60da2d11fc RDMA/siw: Set defined status for work completion with undefined status
A malicious user may write undefined values into memory mapped completion
queue elements status or opcode. Undefined status or opcode values will
result in out-of-bounds access to an array mapping siw internal
representation of opcode and status to RDMA core representation when
reaping CQ elements. While siw detects those undefined values, it did not
correctly set completion status to a defined value, thus defeating the
whole purpose of the check.

This bug leads to the following Smatch static checker warning:

	drivers/infiniband/sw/siw/siw_cq.c:96 siw_reap_cqe()
	error: buffer overflow 'map_cqe_status' 10 <= 21

Fixes: bdf1da5df9 ("RDMA/siw: Fix immediate work request flush to completion queue")
Link: https://lore.kernel.org/r/20221115170747.1263298-1-bmt@zurich.ibm.com
Reported-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Bernard Metzler <bmt@zurich.ibm.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
2022-11-15 16:47:00 -04:00
..
core RDMA/nldev: Return "-EAGAIN" if the cm_id isn't from expected port 2022-11-15 09:56:45 +02:00
hw RDMA/mana: Remove redefinition of basic u64 type 2022-11-14 10:16:46 +02:00
sw RDMA/siw: Set defined status for work completion with undefined status 2022-11-15 16:47:00 -04:00
ulp IB/iser: open code iser_disconnected_handler 2022-10-19 10:38:35 +03:00
Kconfig RDMA/mana_ib: Add a driver for Microsoft Azure Network Adapter 2022-11-11 11:40:09 +02:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00