From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <stable-bounces@dpdk.org> Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id D76D1A04BC for <public@inbox.dpdk.org>; Fri, 9 Oct 2020 13:22:40 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5B7421D454; Fri, 9 Oct 2020 13:22:35 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 727FF1D454; Fri, 9 Oct 2020 13:22:32 +0200 (CEST) IronPort-SDR: ycI6EARHOoFpfSiMIRBcis3sZhRmOgMe1qUndJq5kL8v7rLwW1RtHobmqIfmNPVsk1VtW3QbT+ FoNGfsKuAO0Q== X-IronPort-AV: E=McAfee;i="6000,8403,9768"; a="250165515" X-IronPort-AV: E=Sophos;i="5.77,354,1596524400"; d="scan'208";a="250165515" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Oct 2020 04:22:30 -0700 IronPort-SDR: 2p0kJ1qJdilkhNanYm5+akN4HPQfyOs6y+tjKLb2lQwh/Ua1taZbNmn79MsaB8WGbrFrgqL0el 7OtYuCqO8f0A== X-IronPort-AV: E=Sophos;i="5.77,354,1596524400"; d="scan'208";a="343779579" Received: from rnicolau-mobl1.ger.corp.intel.com (HELO [10.252.17.210]) ([10.252.17.210]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Oct 2020 04:22:29 -0700 To: Bruce Richardson <bruce.richardson@intel.com>, dev@dpdk.org Cc: stable@dpdk.org, Stephen Hemminger <stephen@networkplumber.org>, Anatoly Burakov <anatoly.burakov@intel.com> References: <20200814110045.217724-1-bruce.richardson@intel.com> <20200821171017.50531-1-bruce.richardson@intel.com> <20200821171017.50531-4-bruce.richardson@intel.com> From: "Nicolau, Radu" <radu.nicolau@intel.com> Message-ID: <d45c50fa-680f-c94d-3187-d8a5d2888f28@intel.com> Date: Fri, 9 Oct 2020 12:22:27 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.12.1 MIME-Version: 1.0 In-Reply-To: <20200821171017.50531-4-bruce.richardson@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-GB Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH v2 3/4] examples/mp_server: fix snprintf overflow X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches <stable.dpdk.org> List-Unsubscribe: <https://mails.dpdk.org/options/stable>, <mailto:stable-request@dpdk.org?subject=unsubscribe> List-Archive: <http://mails.dpdk.org/archives/stable/> List-Post: <mailto:stable@dpdk.org> List-Help: <mailto:stable-request@dpdk.org?subject=help> List-Subscribe: <https://mails.dpdk.org/listinfo/stable>, <mailto:stable-request@dpdk.org?subject=subscribe> Errors-To: stable-bounces@dpdk.org Sender: "stable" <stable-bounces@dpdk.org> On 8/21/2020 6:10 PM, Bruce Richardson wrote: > When producing a printable mac address the buffer was appropriately sized > for holding the mac address exactly, but the actual snprintf included a > '\n' character at the end, which means that the snprintf technically is > getting truncated i.e. the \n would not be added due to lack of space. > This gets flagged as a problem by modern versions of gcc, e.g. on Ubuntu > 20.04. > > main.c:77:37: warning: ‘__builtin___snprintf_chk’ output truncated before the last format character [-Wformat-truncation=] > 77 | "%02x:%02x:%02x:%02x:%02x:%02x\n", > | ^ > > Since the \n is getting stripped anyway, we can fix the issue by just > removing it. In the process we can switch to using the standard ethernet > address formating function from rte_ether.h. > > Fixes: af75078fece3 ("first public release") > Cc: stable@dpdk.org > Cc: Stephen Hemminger <stephen@networkplumber.org> > > Signed-off-by: Bruce Richardson <bruce.richardson@intel.com> > > --- > V2: switched code to use standard formatting function > --- Acked-by: Radu Nicolau <radu.nicolau@intel.com>