RDAM/netlink: Fix out-of-bound access while checking message validity
authorLeon Romanovsky <leon@kernel.org>
Fri, 8 Sep 2017 10:02:26 +0000 (13:02 +0300)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 8 Sep 2017 17:01:03 +0000 (10:01 -0700)
commit8b2c7e7a3cb2093bf3257c146c5822437fdf3124
tree1b923f9e883b12a36643c43211213a5aec8e3d63
parent5969d1bb3082b41eba8fd2c826559abe38ccb6df
RDAM/netlink: Fix out-of-bound access while checking message validity

The netlink message sent with type == 0, which doesn't have any client
behind it, caused to the overflow in max_num_ops array.

Fix it by declaring zero number of ops for the first client.

Fixes: c9901724a2f1 ("RDMA/netlink: Remove netlink clients infrastructure")
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/infiniband/core/netlink.c