Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp321101rdh; Sat, 23 Sep 2023 11:52:43 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHlx2eWsYk8UY2lyPmWp9V3LQA2Raknv7W3SdNAUojqeXB1EjAutnoK76YyBfwKYrMVTLhO X-Received: by 2002:a17:90b:33c2:b0:274:8951:b5ed with SMTP id lk2-20020a17090b33c200b002748951b5edmr4230744pjb.20.1695495163278; Sat, 23 Sep 2023 11:52:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695495163; cv=none; d=google.com; s=arc-20160816; b=J2n3WlQGTXp9nndSn9mdLSwqWEs0zHhE49NLXxYTssBaYLavSwlueP/RRLnZz9/628 0nFBQfvNed5V4GsEGMEtkIuGPpUQEaDhrKgtkxwbEYFCC0eHvIm6o4MNzKl4VkBx5oIF Gtq6Kxfh2d1Od1T29HvWAiGkaWkT82XARPMYrklkiDnfYuVKg8bTPf0ekiu4pZUeUgX8 U9U7Ut49c4KSnwfSsbYxYqVot1DxY9z5ZAosRNNogP6UrFHmFKGTUMODzPjgwkapN/47 69Gj0f6X6bSiLm1vxzdZHNo+MdIETK+U4/h6tBzEgRPjVA/pU6NN6St2CueMmqB/a2V5 HqDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=bMioBUUQKarjVY3CMoKXqa+VJbrsAj3S1tw2SzHTjsQ=; fh=vufARQ4kHd/xjgl6vCoyFTNDv5WOnxEa0xkyMMixvDE=; b=JkAOkU8vK8L28Ax0v6jiZIWVXiRNvznVXl8z3IZIzvRwTf9JJWPuxPdipNMUZGgNOq YsaS5TiLELuG5u9bpsRGR1UhcFBN1J40/9AsKb4tae+zRXrvPlqwx2pAEyGAUqCT7Bz3 7raIO+irN2pTvd4e26Dvdy/RSkDxTCuDiKCm1FU9q1ITKB7pTetc4/7DmvyytJhDRHhy cu5mN9sagI4YEGpxrqYU+QGHMCMfpGm7qKSlMFtnbB3xESQbFaE9LdRFRKZHbfEcMjHb kwI11HyKndNDniW06c2ru36AgfS+brjDd8SH6nxiame8YmmNYoOnoXx8LZ/WinFIhpMb 5DaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jZaa9DjP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id oj15-20020a17090b4d8f00b00252d84b7af0si7128339pjb.181.2023.09.23.11.52.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Sep 2023 11:52:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jZaa9DjP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id BA3D6811ED97; Sat, 23 Sep 2023 11:52:39 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230515AbjIWSwi (ORCPT + 99 others); Sat, 23 Sep 2023 14:52:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49270 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229634AbjIWSwh (ORCPT ); Sat, 23 Sep 2023 14:52:37 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 72B79FA; Sat, 23 Sep 2023 11:52:31 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7A206C433C7; Sat, 23 Sep 2023 18:52:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695495151; bh=F7de3crm3LCfSbjyukI9kxChF2B638DBUriCQ/rXhMg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=jZaa9DjPkIh55AGwWY/u7y9dxlwEODQ/VwNNq+t59ssiX5bFfd73d/KhvcgWtgW++ LSt+SgeKhEKdhL2Rp9sAZ3yXVyzdH0+GwQMwegKdLmq11BReWMz/3tgpBNGIYfwIn3 dy1iJrCmhuv6ORNBvLMHUUuEYl59m+BfPHRLn7lv3FXGT19azkldsloRLd7RzyNJiH 9/TsJEEdlBqhWr0fTEF/N4xe6pCRcAev1DLSN/1/RZgytn8aW5rMACY+9vesEKjd2l OItKMgeKq2rKw/J95FuLvi44lOvwWIlVYSwrgVJtZxbYykL0NLOuLnK+rkCdoYK3Xa cWt1DP1QiAOQg== Date: Sat, 23 Sep 2023 21:52:26 +0300 From: Leon Romanovsky To: Christophe JAILLET Cc: Jason Gunthorpe , Matan Barak , Doug Ledford , linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, linux-rdma@vger.kernel.org Subject: Re: [PATCH] RDMA/cma: Fix the size of a buffer in add_port_entries() Message-ID: <20230923185226.GE1642130@unreal> References: <91395b73a64c13dfe45c3fd3b088b216ba0c9332.1695449697.git.christophe.jaillet@wanadoo.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <91395b73a64c13dfe45c3fd3b088b216ba0c9332.1695449697.git.christophe.jaillet@wanadoo.fr> X-Spam-Status: No, score=2.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Sat, 23 Sep 2023 11:52:39 -0700 (PDT) X-Spam-Level: ** On Sat, Sep 23, 2023 at 08:15:25AM +0200, Christophe JAILLET wrote: > In order to be sure that 'buff' is never truncated, its size should be > 11, not 10. > > When building with W=1, this fixes the following warnings: > > drivers/infiniband/core/cma_configfs.c: In function ‘make_cma_ports’: > drivers/infiniband/core/cma_configfs.c:223:57: error: ‘snprintf’ output may be truncated before the last format character [-Werror=format-truncation=] > 223 | snprintf(port_str, sizeof(port_str), "%u", i + 1); > | ^ > drivers/infiniband/core/cma_configfs.c:223:17: note: ‘snprintf’ output between 2 and 11 bytes into a destination of size 10 > 223 | snprintf(port_str, sizeof(port_str), "%u", i + 1); > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > Fixes: 045959db65c67 ("IB/cma: Add configfs for rdma_cm") > Signed-off-by: Christophe JAILLET > --- > drivers/infiniband/core/cma_configfs.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Thanks, it was already fixed. https://lore.kernel.org/all/a7e3b347ee134167fa6a3787c56ef231a04bc8c2.1694434639.git.leonro@nvidia.com/