summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Meskhidze <konstantin.meskhidze@huawei.com>2023-09-05 18:32:58 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-10-10 21:53:39 +0200
commit5a4a6a47e0740653e416d5dda370c8aed2d7a3d4 (patch)
tree1aef717a215b26cf4086d6229db900d9d32a3e20
parent626868282c361463f1da40255c346887aa8e44bd (diff)
downloadcommon-5a4a6a47e0740653e416d5dda370c8aed2d7a3d4.tar.gz
RDMA/uverbs: Fix typo of sizeof argument
commit c489800e0d48097fc6afebd862c6afa039110a36 upstream. Since size of 'hdr' pointer and '*hdr' structure is equal on 64-bit machines issue probably didn't cause any wrong behavior. But anyway, fixing of typo is required. Fixes: da0f60df7bd5 ("RDMA/uverbs: Prohibit write() calls with too small buffers") Co-developed-by: Ivanov Mikhail <ivanov.mikhail1@huawei-partners.com> Signed-off-by: Ivanov Mikhail <ivanov.mikhail1@huawei-partners.com> Signed-off-by: Konstantin Meskhidze <konstantin.meskhidze@huawei.com> Link: https://lore.kernel.org/r/20230905103258.1738246-1-konstantin.meskhidze@huawei.com Signed-off-by: Leon Romanovsky <leon@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/infiniband/core/uverbs_main.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/infiniband/core/uverbs_main.c b/drivers/infiniband/core/uverbs_main.c
index 099f5acc749e..f2fcdb70d903 100644
--- a/drivers/infiniband/core/uverbs_main.c
+++ b/drivers/infiniband/core/uverbs_main.c
@@ -535,7 +535,7 @@ static ssize_t verify_hdr(struct ib_uverbs_cmd_hdr *hdr,
if (hdr->in_words * 4 != count)
return -EINVAL;
- if (count < method_elm->req_size + sizeof(hdr)) {
+ if (count < method_elm->req_size + sizeof(*hdr)) {
/*
* rdma-core v18 and v19 have a bug where they send DESTROY_CQ
* with a 16 byte write instead of 24. Old kernels didn't