OpenCloudOS-Kernel/drivers/infiniband/ulp
Alexey Kodanev fd8de72924 RDMA/rtrs-clt: Check strnlen return len in sysfs mpath_policy_store()
[ Upstream commit 7a7b7f575a25aa68ee934ee8107294487efcb3fe ]

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:01 -04:00
..
ipoib IB/ipoib: Fix mcast list locking 2024-02-05 20:14:28 +00:00
iser IB/iser: Prevent invalidating wrong MR 2024-01-25 15:35:40 -08:00
isert Revert "IB/isert: Fix incorrect release of isert connection" 2023-08-22 17:01:04 +03:00
opa_vnic IB: move from strlcpy with unused retval to strscpy 2022-08-21 14:18:02 +03:00
rtrs RDMA/rtrs-clt: Check strnlen return len in sysfs mpath_policy_store() 2024-03-26 18:20:01 -04:00
srp RDMA/srp: Do not call scsi_done() from srp_abort() 2023-09-11 14:15:58 +03:00
srpt RDMA/srpt: Do not register event handler until srpt device is fully setup 2024-03-26 18:19:58 -04:00
Makefile RDMA/rtrs: include client and server modules into kernel compilation 2020-05-17 18:57:15 -03:00