]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
RDMA/core: Prefer NLA_NUL_STRING
authorFlorian Westphal <fw@strlen.de>
Mon, 30 Mar 2026 12:27:39 +0000 (14:27 +0200)
committerJason Gunthorpe <jgg@nvidia.com>
Thu, 9 Apr 2026 13:58:56 +0000 (10:58 -0300)
commit6ed3d14fc45d3da6025e7fe4a6a09066856698e2
tree438d0875ceffa793e584401b2d2eda5158acba1c
parent973403ca3553f0367a6982687f5f0ee4212e9ab9
RDMA/core: Prefer NLA_NUL_STRING

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: 30dc5e63d6a5 ("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>
drivers/infiniband/core/iwpm_msg.c