From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 33EF5455A6; Sat, 6 Jul 2024 16:08:28 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 186C540270; Sat, 6 Jul 2024 16:08:28 +0200 (CEST) Received: from mail-lf1-f43.google.com (mail-lf1-f43.google.com [209.85.167.43]) by mails.dpdk.org (Postfix) with ESMTP id 89E944025D for ; Sat, 6 Jul 2024 16:08:26 +0200 (CEST) Received: by mail-lf1-f43.google.com with SMTP id 2adb3069b0e04-52e9c6b5a62so2670710e87.0 for ; Sat, 06 Jul 2024 07:08:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1720274906; x=1720879706; darn=dpdk.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=yaSafN6HfA4RZwYPaLdh8+IOMGso1ndx4ui/zznhgZ0=; b=THqPrQuMoF7IFewE9ekC+ShvfC/4KuwAHlvl7grc9M7dxxRvB5vUYRjyqxSTlEZojs TWZnrNsJ+tSgaGkS6LNrNKMkt8VJw85CMSpDiEV1bZOzfnO4z1q0bztpCkIRor9lo0oG faiCaUjYIsGxPUH97qx3igobshAnsok7NhTLidQ8o39fH5kkKkEutze3K5sAOa6O7pr8 br7ERdp5vidc1SqX+8Qul86oJRcB2Xw1RMWBo1O/5wXbsDZsi8eU3l6UEKBZkv5ggAY9 rVU4lFlIZrBYemK9B+wmjwbknbkJNn/ZPQhyv1lBjmeXseTduNRpXOi60Z/0EOaomO4Y gj3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720274906; x=1720879706; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=yaSafN6HfA4RZwYPaLdh8+IOMGso1ndx4ui/zznhgZ0=; b=h2KeZmNg9g2/O+gme+plLqFHROYR8zug1SW9l1XqPVwYHpqvQ6PLQI2m3rPjEdi8y5 F/jOKjdZLkHrkQjYaXdD0xuZPHUijuPPWoj2aS3l9+GtPXdDNSBKBgkqsweSfE6zmvxl j9kEkF7OX8oqQwk15h6+W0OR8jg5xPPqLsVpiV7PvO4TnsP6203+W2/3+ih15klM82TS vjGsUaJP8msdWIfGDoc8a97vXAcqhMfqAPX3c+ClW06GHa3voTlPHJ4E1fTaoMyJnBsv fdUio0ULOH9fBaV8HxPvP7v0lyAMono8LeO6oA/TptjUInLefcyxHz9AA2lbBm1C4AUe oTSA== X-Forwarded-Encrypted: i=1; AJvYcCUplxaBGBg2NxzmiXgJoWEvoVC6w4PK04ML0FuLaw1UyZLRJlzSNnkGnjiH+DwjL0CfJxEqd+qoAaY6CDQ= X-Gm-Message-State: AOJu0Ywoacv2ra5hdUavF+pIUbpXqhUT66hTojQrxbg8zz8nLF1JQjxm GXEFlkwmK68cyOhbltTVKGDYwB4IAXCw0UmdPLMrkgZoxveYbmiH X-Google-Smtp-Source: AGHT+IF50YEee3R3NePAltPkXMfpcISLJk1ap3RSLlLj1+1untwxXhUeLDUh4LYkOiwLklaNQRDASA== X-Received: by 2002:a05:6512:219:b0:52e:9d2c:1c86 with SMTP id 2adb3069b0e04-52ea0636ae0mr4793815e87.14.1720274905259; Sat, 06 Jul 2024 07:08:25 -0700 (PDT) Received: from localhost.localdomain (bba-2-50-154-164.alshamil.net.ae. [2.50.154.164]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-52eaa731db6sm174787e87.294.2024.07.06.07.08.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 06 Jul 2024 07:08:24 -0700 (PDT) Date: Sat, 6 Jul 2024 18:08:20 +0400 From: Mahmoud Matook To: David Marchand Cc: Kiran Kumar Kokkilagadda , Sunil Kumar Kori , Rakesh Kudurumalla , Nithin Kumar Dabilpuram , Jerin Jacob , "dev@dpdk.org" Subject: Re: [EXTERNAL] [PATCH v2] app/graph: fix destination buffer too small Message-ID: <6gh5by5aqykgfc3eepigk3s7ffrkdibel4qw4ik5w26nexzvbi@okhns7dd654e> References: <20240623200921.1715890-1-mahmoudmatook.mm@gmail.com> <20240624200114.1792214-1-mahmoudmatook.mm@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On 07/04, David Marchand wrote: > On Thu, Jun 27, 2024 at 2:44 AM Kiran Kumar Kokkilagadda > wrote: > > > On 06/25, Kiran Kumar Kokkilagadda wrote: > > > From: Mahmoud Maatuq > > > > Sent: Tuesday, June 25, 2024 1: 31 > > > AM > To: Sunil Kumar Kori ; Rakesh Kudurumalla > > > ; > > > On 06/25, Kiran Kumar Kokkilagadda wrote: > > > > Subject: [EXTERNAL] [PATCH v2] app/graph: fix destination buffer too > > > > small > > > > > > > > as sizeof(config. rx. mempool_name) is < sizeof(res->mempool) we > > > > should copy at most sizeof(config. rx. mempool_name) and replace memcpy > > > with strlcpy as mempool name is a null terminated string Coverity issue: > > > 415430 Fixes: 3850cb06ab9c ("app/graph: > > > > > > > > > > > > as sizeof(config.rx.mempool_name) is < sizeof(res->mempool) we should > > > > > > > > copy at most sizeof(config.rx.mempool_name) and replace memcpy with > > > > > > > > strlcpy as mempool name is a null terminated string > > > > > > > > > > > > > > > > Coverity issue: 415430 > > > > > > > > Fixes: 3850cb06ab9c ("app/graph: add ethdev commands") > > > > > > > > Cc: skori@marvell.com > > > > > > > > > > > > > > > > Signed-off-by: Mahmoud Maatuq > > > > > > > > > m>> > > > > > > > > --- > > > > Acked-by: Kiran Kumar Kokkilagadda > > This patch does not pass the CI, please check. The warning in CI is clear, (truncation warning) as the size of destination buffer: config.rx.mempool_name is around 26 bytes but the size of of source buffer: res->mempool is 128 bytes Some possible solutions: * increase the destination buffer size: by tracking it we need to increase RTE_MEMZONE_NAMESIZE, (more memory consumption). * if the mem pool name is usually around the same size as destination we could decrease the size of source buffer, but res->mempool of type cmdline_fixed_string_t and maybe used somewhere else that could also produce truncation. * change the type of source buffer and use size as destination. what do you think? > > > -- > David Marchand >