RDMA/nldev: Reply with the command of the request
cover RDMA/nldev: Reply with the command of the request
Two doit handlers reply with another command's message type:RDMA_NLDEV_CMD_PORT_GET with RDMA_NLDEV_CMD_GET, and RDMA_NLDEV_CMD_STAT_DEL with RDMA_NLDEV_CMD_STAT_SET. A client that decodes replies based on their type mis-decodes them. AFAIK iproute2 igores the reply type and rdma-core does not use these commands. I spotted these when writing an RDMA netlink client for Go.
I used AI to prepare the patches but I reviewed and tested myself.
Nikolaos Gkarlis (2):
RDMA/nldev: Reply to RDMA_NLDEV_CMD_PORT_GET with its own command RDMA/nldev: Reply to RDMA_NLDEV_CMD_STAT_DEL with its own command
drivers/infiniband/core/nldev.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
base-commit: c3e8e9451e6f1b69f685b75e0fbf14f3d0fb2539
Signature · 1 line
2.55.0
PATCH 1/2 RDMA/nldev: Reply to RDMA_NLDEV_CMD_PORT_GET with its own command
nldev_port_get_doit() replies with RDMA_NLDEV_CMD_GET, while the dump replies with RDMA_NLDEV_CMD_PORT_GET. Use RDMA_NLDEV_CMD_PORT_GET for both.
--- drivers/infiniband/core/nldev.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/infiniband/core/nldev.c +2 -1
@@ -1304,7 +1304,8 @@ static int nldev_port_get_doit(struct sk_buff *skb, struct nlmsghdr *nlh, } nlh =nlmsg_put (msg,NETLINK_CB (skb).portid, nlh->nlmsg_seq, -RDMA_NL_GET_TYPE (RDMA_NL_NLDEV ,RDMA_NLDEV_CMD_GET ), +RDMA_NL_GET_TYPE (RDMA_NL_NLDEV , +RDMA_NLDEV_CMD_PORT_GET ),0 ,0 );if (!nlh) { err = -EMSGSIZE ;
Signature · 1 line
2.55.0
[email protected]
AI reviewRe: [PATCH 1/2] RDMA/nldev: Reply to RDMA_NLDEV_CMD_PORT_GET with its own command
Sashiko has reviewed this patch and found no issues.
Quoted 7 lines
nldev_port_get_doit()replies withRDMA_NLDEV_CMD_GET, while the dump replies withRDMA_NLDEV_CMD_PORT_GET. UseRDMA_NLDEV_CMD_PORT_GETfor both.Fixes c3f66f7b0052 ("RDMA/netlink: Implement nldev port doit callback")Assisted-by LLMSigned-off-by Nikolaos Gkarlis <[email protected]>
Sashiko has reviewed this patch and found no issues.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
PATCH 2/2 RDMA/nldev: Reply to RDMA_NLDEV_CMD_STAT_DEL with its own command
In reply to Nikolaos Gkarlisnldev_stat_del_doit() replies with RDMA_NLDEV_CMD_STAT_SET. Use RDMA_NLDEV_CMD_STAT_DEL.
--- drivers/infiniband/core/nldev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/core/nldev.c +1 -1
@@ -2316,7 +2316,7 @@ static int nldev_stat_del_doit(struct sk_buff *skb, struct nlmsghdr *nlh, } nlh =nlmsg_put (msg,NETLINK_CB (skb).portid, nlh->nlmsg_seq,RDMA_NL_GET_TYPE (RDMA_NL_NLDEV , -RDMA_NLDEV_CMD_STAT_SET ), +RDMA_NLDEV_CMD_STAT_DEL ),0 ,0 );if (!nlh) { ret = -EMSGSIZE ;
Signature · 1 line
2.55.0
[email protected]
AI reviewRe: [PATCH 2/2] RDMA/nldev: Reply to RDMA_NLDEV_CMD_STAT_DEL with its own command
Sashiko has reviewed this patch and found no issues.
Quoted 6 lines
nldev_stat_del_doit()replies withRDMA_NLDEV_CMD_STAT_SET. UseRDMA_NLDEV_CMD_STAT_DEL.Fixes b389327df905 ("RDMA/nldev: Allow counter manual mode configration through RDMA netlink")Assisted-by LLMSigned-off-by Nikolaos Gkarlis <[email protected]>
Sashiko has reviewed this patch and found no issues.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=2
Leon Romanovsky
AppliedQuoted 8 lines · Nikolaos Gkarlis
Two doit handlers reply with another command's message type:
RDMA_NLDEV_CMD_PORT_GETwithRDMA_NLDEV_CMD_GET, andRDMA_NLDEV_CMD_STAT_DELwithRDMA_NLDEV_CMD_STAT_SET. A client that decodes replies based on their type mis-decodes them. AFAIK iproute2 igores the reply type and rdma-core does not use these commands. I spotted these when writing an RDMA netlink client for Go.[...]
Applied, thanks!
[1/2] RDMA/nldev: Reply to RDMA_NLDEV_CMD_PORT_GET with its own command
https://git.kernel.org/rdma/rdma/c/8cf5406b86249a [2/2] RDMA/nldev: Reply to RDMA_NLDEV_CMD_STAT_DEL with its own command https://git.kernel.org/rdma/rdma/c/f3980f8abd2d11
Best regards,
Signature · 1 line
Leon Romanovsky <[email protected]>