Received: by 2002:a05:7412:f584:b0:e2:908c:2ebd with SMTP id eh4csp1994734rdb; Tue, 5 Sep 2023 10:59:06 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGiKhgh18N8L0GYavFrBI5zjQOJ5KBs3gbo8Y3TIUL9vCeZB3WUm8E4nX8PEUBphfgiOZuJ X-Received: by 2002:a05:6808:1b0f:b0:3a7:559a:1fca with SMTP id bx15-20020a0568081b0f00b003a7559a1fcamr15684618oib.20.1693936746701; Tue, 05 Sep 2023 10:59:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693936746; cv=none; d=google.com; s=arc-20160816; b=vsqu2cw7Pbm0RoBrN4j4FAUAxUuNN4ZGUEdfW6WV1WxPaTXgRCqY+7anKgGXjjrsQS 0ogpSZHcyPshH4hjLJ+gBt4iJO+pkfKO8Qil24Jc2n5G/8eXvBYByqW7+3bKYRT2nxvG R35bLKwZZZPkRRC/rHzFA2Wxqwx3IUWHSv/z5YhAirQ/enSxj9PYFzCNhRRKA5VO+y21 cU1KLiCeijbHaMmE65c7z0GnffaL0st1Eo4iWa6XnFwDoIww+yvVNIL6s1RyJ5ipRd5M /SJMOjpS8jATWuTpWZOAQDn4W6L1xCZgmuJsdELhtkipyz11DaR+9xQ3YG4fNZWxiSjd WA7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=HylwA0Z3DfM//iNWeE7Nz8PUSm/n7FBrJSCaTjDvKYU=; fh=78bv9edtz9uBEPcDQPDIMQcQQcH7ROeQgtPGoqsuRRY=; b=yw3003IJow9qvvZkPGXyzmbvrzX/263iCoBRp77DL2et3fDxxDL53fL2oSpQkEMuUH 5RhYDaWwiRUTTgeDtMI2f8lWGXXZpp0QYAWNuqghd0cl46lxA5KFJjM4w68suc2QFFYm naAEfyS26XJphipcEP0EFbSooe/AQOKhnpUihz06NNeABgdycT6ZXt0U9VIUP1qwtWPZ fjleVSBhVd/tow8DSkg0jie/39IzkculpIEDIke4PHjueycaHca1UM7Zt6pumQZHxqeG 0dQz2+me1NCI2SPkbHo5niXSzfvXaYeyv2vzWDOxF6o1K1HJL0GRlX19YFaQxnPxBrJE r3sQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 36-20020a631964000000b00565bef99dbdsi9775826pgz.141.2023.09.05.10.58.53; Tue, 05 Sep 2023 10:59:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353272AbjIERF4 (ORCPT + 99 others); Tue, 5 Sep 2023 13:05:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35922 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354286AbjIEKdL (ORCPT ); Tue, 5 Sep 2023 06:33:11 -0400 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8C858E8; Tue, 5 Sep 2023 03:33:06 -0700 (PDT) Received: from lhrpeml500004.china.huawei.com (unknown [172.18.147.201]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4Rg1zs2lvSz6K6K2; Tue, 5 Sep 2023 18:32:57 +0800 (CST) Received: from mscphis00759.huawei.com (10.123.66.134) by lhrpeml500004.china.huawei.com (7.191.163.9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Tue, 5 Sep 2023 11:33:03 +0100 From: Konstantin Meskhidze To: CC: , , , , , , Subject: [PATCH] RDMA/uverbs: Fix typo of sizeof argument Date: Tue, 5 Sep 2023 18:32:58 +0800 Message-ID: <20230905103258.1738246-1-konstantin.meskhidze@huawei.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.123.66.134] X-ClientProxiedBy: mscpeml500002.china.huawei.com (7.188.26.138) To lhrpeml500004.china.huawei.com (7.191.163.9) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/infiniband/core/uverbs_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/core/uverbs_main.c b/drivers/infiniband/core/uverbs_main.c index 7c9c79c13941..508d6712e14d 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 -- 2.34.1