linux-stable/drivers/infiniband/ulp
Alexey Kodanev 16a5bed6d2 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:21:33 -04:00
..
ipoib IB/ipoib: Fix mcast list locking 2024-02-23 08:54:48 +01:00
iser IB/iser: Prevent invalidating wrong MR 2024-01-25 14:52:45 -08:00
isert Revert "IB/isert: Fix incorrect release of isert connection" 2023-09-19 12:22:48 +02:00
opa_vnic
rtrs RDMA/rtrs-clt: Check strnlen return len in sysfs mpath_policy_store() 2024-03-26 18:21:33 -04:00
srp RDMA/srp: Do not call scsi_done() from srp_abort() 2023-10-19 23:05:32 +02:00
srpt RDMA/srpt: Do not register event handler until srpt device is fully setup 2024-03-26 18:21:32 -04:00
Makefile