linux-stable/drivers/infiniband/ulp
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
..
ipoib IB/ipoib: Fix mcast list locking 2024-02-05 20:12:56 +00:00
iser IB/iser: Prevent invalidating wrong MR 2024-01-25 15:27:38 -08:00
isert Revert "IB/isert: Fix incorrect release of isert connection" 2023-09-13 09:42:57 +02: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:55 -04:00
srp RDMA/srp: Do not call scsi_done() from srp_abort() 2023-10-10 22:00:45 +02:00
srpt RDMA/srpt: Do not register event handler until srpt device is fully setup 2024-03-26 18:20:54 -04:00
Makefile