Received: by 2002:a05:7412:f584:b0:e2:908c:2ebd with SMTP id eh4csp2043890rdb; Tue, 5 Sep 2023 12:32:56 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEEqiLP1xlzaiVHi8gdQpEL33heMdTfR0EbhpcbDbbGSdRt8q7MS6nM3KIdDhWXCxrLy+Ar X-Received: by 2002:a05:6a20:9786:b0:14d:e075:fc5d with SMTP id hx6-20020a056a20978600b0014de075fc5dmr10998000pzc.40.1693942376162; Tue, 05 Sep 2023 12:32:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693942376; cv=none; d=google.com; s=arc-20160816; b=JJcMTK+hRT8NFOF603vfdE1t9YCMBZQEjJvoFeZtO4YDsObNqS4Ir3D6MW9u3MCCPl O0bkp4aSJYQROlaIk+BHGWiWHUd1UQnUZk7c/kUlGC+AZaUoCXi08myvAquENeJFnxjH fh5ErpomGQnsVlZn1zTz88MTObihbQseh4OSRM+8Wk0d3Ws8Ow3VoNC/+cLLX56daqW7 9eYFTNCdabyZ1ouvIa+tC+E0qP2efxVHa1TGnpCBFUG5NsEtYQs2YoRcs3iSzzfEOxEQ 5tNMLobXVlkRjGAz0fGF5lrEkSPtS+/cDHC0wGy55HDzveT0OvrwGBh1f7RfLYwuwQmg n5gg== 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=6tlex2s5JBfg+IJAbA2QI0/AyyzlS3thopNU5QMJAMA=; fh=78bv9edtz9uBEPcDQPDIMQcQQcH7ROeQgtPGoqsuRRY=; b=ZVFt+mYQYYG9ACMFLALF/Kzag/q+azpCAR1c98PubYveds/6QOiD0s25wocT/fUSSz Hx9ucep96b2+NXtAjCse9GLNVjNdXMNIGgIU9JdSUXAX0kDICSovBKzOIomQFXxRhFEg BTmaSu6cWlYY81vOwDOctJiL84H937ffUl9ISORT4LEpYFuIw6AXZbcUDJDxogZKpWDB foWx8dQ2gcPrkT8pcsDURXPEyUcxnqSJzp1x6oJF5RvyNO9li38qdTnex+BF5PIz/Q8W FJ2BcDNYdohP9SlOuxpK0mC1eOx7zfpqC7SDgUpLVh2IHRh1f45DWd2NC6TDtG1N4YiT iV0g== 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 k23-20020a63f017000000b00565fb7714a5si10012959pgh.800.2023.09.05.12.32.42; Tue, 05 Sep 2023 12:32:56 -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 S1353820AbjIEQ3C (ORCPT + 99 others); Tue, 5 Sep 2023 12:29:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52636 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354221AbjIEKKb (ORCPT ); Tue, 5 Sep 2023 06:10:31 -0400 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B95E2C2; Tue, 5 Sep 2023 03:10:27 -0700 (PDT) Received: from lhrpeml500004.china.huawei.com (unknown [172.18.147.207]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4Rg1Nk0Lh7z67Gnx; Tue, 5 Sep 2023 18:05:58 +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:10:24 +0100 From: Konstantin Meskhidze To: CC: , , , , , , Subject: [PATCH] RDMA/uverbs: Fix typo of sizeof argument Date: Tue, 5 Sep 2023 18:10:21 +0800 Message-ID: <20230905101021.1722796-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: mscpeml100002.china.huawei.com (7.188.26.75) 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: 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