summaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
authorDoug Ledford2017-11-01 20:25:27 +0100
committerDoug Ledford2017-11-01 20:25:27 +0100
commit5c08681b4857684795e386781696908fc8e8a5d0 (patch)
treee7631d63abd59c1834a21299ca8f497f55fab728 /drivers/infiniband
parentIB/hfi1: Take advantage of kvzalloc_node in sdma initialization (diff)
parentRDMA/netlink: OOPs in rdma_nl_rcv_msg() from misinterpreted flag (diff)
downloadkernel-qcow2-linux-5c08681b4857684795e386781696908fc8e8a5d0.tar.gz
kernel-qcow2-linux-5c08681b4857684795e386781696908fc8e8a5d0.tar.xz
kernel-qcow2-linux-5c08681b4857684795e386781696908fc8e8a5d0.zip
Merge branch 'k.o/for-rc' into k.o/for-next
Pick up the missing netlink oops fix Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r--drivers/infiniband/core/netlink.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/infiniband/core/netlink.c b/drivers/infiniband/core/netlink.c
index b12e58787c3d..1fb72c356e36 100644
--- a/drivers/infiniband/core/netlink.c
+++ b/drivers/infiniband/core/netlink.c
@@ -175,13 +175,24 @@ static int rdma_nl_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh,
!netlink_capable(skb, CAP_NET_ADMIN))
return -EPERM;
+ /*
+ * LS responses overload the 0x100 (NLM_F_ROOT) flag. Don't
+ * mistakenly call the .dump() function.
+ */
+ if (index == RDMA_NL_LS) {
+ if (cb_table[op].doit)
+ return cb_table[op].doit(skb, nlh, extack);
+ return -EINVAL;
+ }
/* FIXME: Convert IWCM to properly handle doit callbacks */
if ((nlh->nlmsg_flags & NLM_F_DUMP) || index == RDMA_NL_RDMA_CM ||
index == RDMA_NL_IWCM) {
struct netlink_dump_control c = {
.dump = cb_table[op].dump,
};
- return netlink_dump_start(nls, skb, nlh, &c);
+ if (c.dump)
+ return netlink_dump_start(nls, skb, nlh, &c);
+ return -EINVAL;
}
if (cb_table[op].doit)