[{"id":1718891,"web_url":"http://patchwork.ozlabs.org/comment/1718891/","msgid":"<26D9FDECA4FBDD4AADA65D8E2FC68A4A10DB1C40@ORSMSX104.amr.corp.intel.com>","list_archive_url":null,"date":"2017-07-14T22:35:55","subject":"Re: [Intel-wired-lan] [next PATCH S75-V3 08/11] i40evf: fix\n\tpossible\tsnprintf truncation of q_vector->name","submitter":{"id":66945,"url":"http://patchwork.ozlabs.org/api/people/66945/","name":"Bowers, AndrewX","email":"andrewx.bowers@intel.com"},"content":"> -----Original Message-----\n> From: Intel-wired-lan [mailto:intel-wired-lan-bounces@osuosl.org] On\n> Behalf Of Alice Michael\n> Sent: Wednesday, July 12, 2017 2:46 AM\n> To: Michael, Alice <alice.michael@intel.com>; intel-wired-\n> lan@lists.osuosl.org\n> Subject: [Intel-wired-lan] [next PATCH S75-V3 08/11] i40evf: fix possible\n> snprintf truncation of q_vector->name\n> \n> From: Jacob Keller <jacob.e.keller@intel.com>\n> \n> The q_vector names are based on the interface name with a driver prefix,\n> the type of q_vector setup, and the queue number. We previously set the\n> size of this variable to IFNAMSIZ + 9, which is incorrect, because we actually\n> include a minimum of 14 characters extra beyond the interface name size.\n> \n> New versions of GCC since 7 include a new warning that detects this possible\n> truncation and complains. We can fix this by increasing the size incase our\n> interface name is too large to avoid truncation. We don't need to go beyond\n> 14 because the compiler is smart enough to realize our values can never\n> exceed size of 1. We do go up to 15 here because possible future changes\n> may increase the number of queues beyond one digit.\n> \n> While we are here, also change some variables to be unsigned (since they\n> are never negative) and stop using an extra unnecessary %s format specifier.\n> \n> Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>\n> ---\n>  drivers/net/ethernet/intel/i40evf/i40evf.h      |  2 +-\n>  drivers/net/ethernet/intel/i40evf/i40evf_main.c | 21 +++++++++------------\n>  2 files changed, 10 insertions(+), 13 deletions(-)\n\nTested-by: Andrew Bowers <andrewx.bowers@intel.com>","headers":{"Return-Path":"<intel-wired-lan-bounces@osuosl.org>","X-Original-To":["incoming@patchwork.ozlabs.org","intel-wired-lan@lists.osuosl.org"],"Delivered-To":["patchwork-incoming@bilbo.ozlabs.org","intel-wired-lan@lists.osuosl.org"],"Received":["from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3x8SFv5PYZz9s7m\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSat, 15 Jul 2017 08:36:03 +1000 (AEST)","from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id 4B0AB30B46;\n\tFri, 14 Jul 2017 22:36:02 +0000 (UTC)","from silver.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id 91DAZ3M3974I; Fri, 14 Jul 2017 22:36:00 +0000 (UTC)","from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby silver.osuosl.org (Postfix) with ESMTP id 3C98730B54;\n\tFri, 14 Jul 2017 22:36:00 +0000 (UTC)","from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n\tby ash.osuosl.org (Postfix) with ESMTP id C46D91C0376\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 14 Jul 2017 22:35:58 +0000 (UTC)","from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id B463F89141\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 14 Jul 2017 22:35:58 +0000 (UTC)","from whitealder.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id aF9AZOylF8dL for <intel-wired-lan@lists.osuosl.org>;\n\tFri, 14 Jul 2017 22:35:57 +0000 (UTC)","from mga06.intel.com (mga06.intel.com [134.134.136.31])\n\tby whitealder.osuosl.org (Postfix) with ESMTPS id BE5DF8913C\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 14 Jul 2017 22:35:57 +0000 (UTC)","from fmsmga001.fm.intel.com ([10.253.24.23])\n\tby orsmga104.jf.intel.com with ESMTP; 14 Jul 2017 15:35:57 -0700","from orsmsx110.amr.corp.intel.com ([10.22.240.8])\n\tby fmsmga001.fm.intel.com with ESMTP; 14 Jul 2017 15:35:57 -0700","from orsmsx104.amr.corp.intel.com ([169.254.4.205]) by\n\tORSMSX110.amr.corp.intel.com ([169.254.10.129]) with mapi id\n\t14.03.0319.002; Fri, 14 Jul 2017 15:35:56 -0700"],"X-Virus-Scanned":["amavisd-new at osuosl.org","amavisd-new at osuosl.org"],"X-Greylist":"domain auto-whitelisted by SQLgrey-1.7.6","X-ExtLoop1":"1","X-IronPort-AV":"E=Sophos; i=\"5.40,360,1496127600\"; d=\"scan'208\";\n\ta=\"1172729645\"","From":"\"Bowers, AndrewX\" <andrewx.bowers@intel.com>","To":"\"intel-wired-lan@lists.osuosl.org\" <intel-wired-lan@lists.osuosl.org>","Thread-Topic":"[Intel-wired-lan] [next PATCH S75-V3 08/11] i40evf: fix\n\tpossible\tsnprintf truncation of q_vector->name","Thread-Index":"AQHS+zdwtK9/n3gzu0q+HVpE3bvF4KJT7Jzw","Date":"Fri, 14 Jul 2017 22:35:55 +0000","Message-ID":"<26D9FDECA4FBDD4AADA65D8E2FC68A4A10DB1C40@ORSMSX104.amr.corp.intel.com>","References":"<20170712094614.76501-1-alice.michael@intel.com>\n\t<20170712094614.76501-8-alice.michael@intel.com>","In-Reply-To":"<20170712094614.76501-8-alice.michael@intel.com>","Accept-Language":"en-US","Content-Language":"en-US","X-MS-Has-Attach":"","X-MS-TNEF-Correlator":"","x-titus-metadata-40":"eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiOTZkMTdhNWYtMmIyNi00NDU2LTk2ZjgtODYyOTU4Zjg3Y2E5IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6IlZkVGlPV2hnNGVWcmxSM1J4cnBkc3NiT1JWRkJYenNIdVFvWGhnTkZNbFU9In0=","x-ctpclassification":"CTP_IC","dlp-product":"dlpe-windows","dlp-version":"10.0.102.7","dlp-reaction":"no-action","x-originating-ip":"[10.22.254.139]","MIME-Version":"1.0","Subject":"Re: [Intel-wired-lan] [next PATCH S75-V3 08/11] i40evf: fix\n\tpossible\tsnprintf truncation of q_vector->name","X-BeenThere":"intel-wired-lan@osuosl.org","X-Mailman-Version":"2.1.18-1","Precedence":"list","List-Id":"Intel Wired Ethernet Linux Kernel Driver Development\n\t<intel-wired-lan.osuosl.org>","List-Unsubscribe":"<https://lists.osuosl.org/mailman/options/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@osuosl.org?subject=unsubscribe>","List-Archive":"<http://lists.osuosl.org/pipermail/intel-wired-lan/>","List-Post":"<mailto:intel-wired-lan@osuosl.org>","List-Help":"<mailto:intel-wired-lan-request@osuosl.org?subject=help>","List-Subscribe":"<https://lists.osuosl.org/mailman/listinfo/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@osuosl.org?subject=subscribe>","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"intel-wired-lan-bounces@osuosl.org","Sender":"\"Intel-wired-lan\" <intel-wired-lan-bounces@osuosl.org>"}}]