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 DC36AE95A96 for ; Mon, 9 Oct 2023 13:15:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376856AbjJINPD (ORCPT ); Mon, 9 Oct 2023 09:15:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49984 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376889AbjJINPC (ORCPT ); Mon, 9 Oct 2023 09:15:02 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B0C7FFB for ; Mon, 9 Oct 2023 06:14:59 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DF3FDC433CC; Mon, 9 Oct 2023 13:14:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1696857299; bh=dsYGrWlo8xPhJAXCQssWJxJ94WBCKGBGZcv4O+cGTM4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sB5yRvmsQ1a5G4cC34ukbSKTZbMcYvgkSBR2l8Zh+YEyPyxtB8Uq9SdBZbt4+Wd23 q7yYLDU7A62cjwOQfSp8MWDxm/ye6v2oQksdoH9koCyjqGNKWt2tIrlp+ii7m0mraU aHVpvT2PXquz/R7afFRRkFXAtf35F+GAGYz7IipI= 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 6.5 149/163] RDMA/uverbs: Fix typo of sizeof argument Date: Mon, 9 Oct 2023 15:01:53 +0200 Message-ID: <20231009130128.143911832@linuxfoundation.org> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231009130124.021290599@linuxfoundation.org> References: <20231009130124.021290599@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 6.5-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