linux-stable/drivers/infiniband
Alexey Kodanev b0455371cc RDMA/rtrs-clt: Check strnlen return len in sysfs mpath_policy_store()
[ Upstream commit 7a7b7f575a ]

strnlen() may return 0 (e.g. for "\0\n" string), it's better to
check the result of strnlen() before using 'len - 1' expression
for the 'buf' array index.

Detected using the static analysis tool - Svace.

Fixes: dc3b66a0ce ("RDMA/rtrs-clt: Add a minimum latency multipath policy")
Signed-off-by: Alexey Kodanev <aleksei.kodanev@bell-sw.com>
Link: https://lore.kernel.org/r/20240221113204.147478-1-aleksei.kodanev@bell-sw.com
Acked-by: Jack Wang <jinpu.wang@ionos.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-03-26 18:20:55 -04:00
..
core RDMA/device: Fix a race between mad_client and cm_client init 2024-03-26 18:20:55 -04:00
hw RDMA/hns: Fix mis-modifying default congestion control algorithm 2024-03-26 18:20:55 -04:00
sw RDMA/siw: Fix connection failure handling 2023-10-10 22:00:45 +02:00
ulp RDMA/rtrs-clt: Check strnlen return len in sysfs mpath_policy_store() 2024-03-26 18:20:55 -04:00
Kconfig RDMA: Disable IB HW for UML 2022-12-31 13:32:36 +01:00
Makefile