]> Git Repo - linux.git/commitdiff
RDMA/nldev: Enforce device index check for port callback
authorLeon Romanovsky <[email protected]>
Tue, 31 Oct 2017 18:09:54 +0000 (20:09 +0200)
committerLinus Torvalds <[email protected]>
Tue, 31 Oct 2017 19:12:55 +0000 (12:12 -0700)
IB device index is nldev's handler and it should be checked always.

Fixes: c3f66f7b0052 ("RDMA/netlink: Implement nldev port doit callback")
Signed-off-by: Leon Romanovsky <[email protected]>
Acked-by: Doug Ledford <[email protected]>
[ Applying directly, since Doug fried his SSD's and is rebuilding  - Linus ]
Signed-off-by: Linus Torvalds <[email protected]>
drivers/infiniband/core/nldev.c

index 3ba24c428c3bda48ec8698934f275828754ac19d..2fae850a3eff6a92703aed33975af9b1e0fc3835 100644 (file)
@@ -214,7 +214,9 @@ static int nldev_port_get_doit(struct sk_buff *skb, struct nlmsghdr *nlh,
 
        err = nlmsg_parse(nlh, 0, tb, RDMA_NLDEV_ATTR_MAX - 1,
                          nldev_policy, extack);
-       if (err || !tb[RDMA_NLDEV_ATTR_PORT_INDEX])
+       if (err ||
+           !tb[RDMA_NLDEV_ATTR_DEV_INDEX] ||
+           !tb[RDMA_NLDEV_ATTR_PORT_INDEX])
                return -EINVAL;
 
        index = nla_get_u32(tb[RDMA_NLDEV_ATTR_DEV_INDEX]);
This page took 0.058632 seconds and 4 git commands to generate.