IB/uverbs: Fix command checking as part of ib_uverbs_ex_modify_qp()
authorMoni Shoua <monis@mellanox.com>
Sun, 24 Dec 2017 11:54:57 +0000 (13:54 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 2 Jan 2018 19:31:04 +0000 (20:31 +0100)
commit5f3b36984c7b15e9d6ace5fc836b3474a8bb4213
tree4888fc3a92012f982098f72bafff578da61bbe9a
parentd471542b9f0706b9d37dba40bc02ef27b05a6bc1
IB/uverbs: Fix command checking as part of ib_uverbs_ex_modify_qp()

commit 05d14e7b0c138cb07ba30e464f47b39434f3fdef upstream.

If the input command length is larger than the kernel supports an error should
be returned in case the unsupported bytes are not cleared, instead of the
other way aroudn. This matches what all other callers of ib_is_udata_cleared
do and will avoid user ABI problems in the future.

Fixes: 189aba99e700 ("IB/uverbs: Extend modify_qp and support packet pacing")
Reviewed-by: Yishai Hadas <yishaih@mellanox.com>
Signed-off-by: Moni Shoua <monis@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/infiniband/core/uverbs_cmd.c