linux/drivers/infiniband
Florian Westphal 87111356d5 RDMA/core: Prefer NLA_NUL_STRING
[ Upstream commit 6ed3d14fc4 ]

These attributes are evaluated as c-string (passed to strcmp), but
NLA_STRING doesn't check for the presence of a \0 terminator.

Either this needs to switch to nla_strcmp() and needs to adjust printf fmt
specifier to not use plain %s, or this needs to use NLA_NUL_STRING.

As the code has been this way for long time, it seems to me that userspace
does include the terminating nul, even tough its not enforced so far, and
thus NLA_NUL_STRING use is the simpler solution.

Fixes: 30dc5e63d6 ("RDMA/core: Add support for iWARP Port Mapper user space service")
Link: https://patch.msgid.link/r/20260330122742.13315-1-fw@strlen.de
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2026-06-01 17:35:36 +02:00
..
core RDMA/core: Prefer NLA_NUL_STRING 2026-06-01 17:35:36 +02:00
hw RDMA/vmw_pvrdma: Fix double free on pvrdma_alloc_ucontext() error path 2026-06-01 17:35:24 +02:00
sw RDMA/rxe: Reject unknown opcodes before ICRC processing 2026-06-01 17:35:24 +02:00
ulp RDMA/rtrs-clt: For conn rejection use actual err number 2026-03-04 07:20:13 -05:00
Kconfig RDMA/irdma: Add irdma Kconfig/Makefile and remove i40iw 2021-06-02 20:06:36 -03:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00