From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 36B7BE95A91 for ; Mon, 9 Oct 2023 13:46:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377604AbjJINqh (ORCPT ); Mon, 9 Oct 2023 09:46:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47128 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377615AbjJINqQ (ORCPT ); Mon, 9 Oct 2023 09:46:16 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 85F8BD51 for ; Mon, 9 Oct 2023 06:46:09 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7625DC433C8; Mon, 9 Oct 2023 13:46:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1696859168; bh=FDaoQPjhSdPMnQcWUjBq8HOPQGlkkiPNjJtTkebq4Qs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BJMx7BRWKyF7cEujcMVb53LFKEFwBJFN0U967LO9fCUZwnDdgTaFusLyDmb4BJ+mX M7Pgt9Iu1ThLZvvgLCvB1xlIUvQjWnR1ePCcPteSodds0ESIqH1YFsRsJQj+b6CFEq H3g/IK4tN/U3BrPYy83lM7yYFToSRASLLiVlkGdA= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Ivanov Mikhail , Konstantin Meskhidze , Leon Romanovsky Subject: [PATCH 5.10 221/226] RDMA/uverbs: Fix typo of sizeof argument Date: Mon, 9 Oct 2023 15:03:02 +0200 Message-ID: <20231009130132.297940389@linuxfoundation.org> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231009130126.697995596@linuxfoundation.org> References: <20231009130126.697995596@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org 5.10-stable review patch. If anyone has any objections, please let me know. ------------------ From: Konstantin Meskhidze 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 Signed-off-by: Ivanov Mikhail Signed-off-by: Konstantin Meskhidze Link: https://lore.kernel.org/r/20230905103258.1738246-1-konstantin.meskhidze@huawei.com Signed-off-by: Leon Romanovsky Signed-off-by: Greg Kroah-Hartman --- drivers/infiniband/core/uverbs_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- 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_uver 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