From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-f196.google.com (mail-pl1-f196.google.com [209.85.214.196]) by dpdk.org (Postfix) with ESMTP id E18F01B4B8 for ; Wed, 3 Apr 2019 17:53:45 +0200 (CEST) Received: by mail-pl1-f196.google.com with SMTP id cv12so8246563plb.9 for ; Wed, 03 Apr 2019 08:53:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=KFWTGq0ssTEU8ChKINCfvihSDedOCma/W8jNA3fQE6U=; b=AhKbWGa2a+mb64wwrDT9oU8NfkITjQLMTiioIdLqlFnCnMXvpYfJnK5tBVauHi48ZR wYtJgNmN86LKaoXEL6O9+ArltXWvITQ8LdiK4OULC2uwy3XaEWXMOzj3GZHmuk8JXnb3 iHZw3GVr5cqvB+7pvGlYzL/rypE1eX3F1O32NsTIqmrPeihSi4mremu75ZHwWDrrIUbR o03+dUTZI23J5VJpba3T0Ftih5kM9moyop2wkNL4FyUKD03LVOkPxI16SmUlI2f2q+oz bstbU4LKAHPVjcSS5yTOdOpzo5DHBrDslBDxqJmnoQ8tlyqdzPzYs3oRmGc4pHGmg0WO u4qw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=KFWTGq0ssTEU8ChKINCfvihSDedOCma/W8jNA3fQE6U=; b=tq3/fRnwbiHKRNoSClfR1FFajiZFoL3+1DYc5JHyMGtoHnu+ZebYZ/orUdCbXAymp8 b+rJ0dISABax7rPxSru6lHZeUUHruIINylU/GGnP04lKt1o4wN6WKaVE7LFZQd1sBWIg AIWvnUXcmJ56HDqIJqg5hlxpN8Xm9Xn0rtEFMhAF/y6IOtNHHjSuKX7eS6huSS1ZVtbN AKZm920n2K9u7xu3g8CZ1ccIWbxmX5pFvQCnrSbNXcwH5pLDUFV/VD2h8hfkc28DBaR8 gaFo8crwzE6l7GFE411/cuATPsZ7b8UpucSHwmdmLYudLva9vbglbe68dSqLyxNA+tc2 1X/w== X-Gm-Message-State: APjAAAXd/eCwUPUgskKy6VA5IrlU/Le9p5+otOWGZJvCuQ2jvYarny02 rpVIr25WDOzNxfhxNr7+G0ZKiw== X-Google-Smtp-Source: APXvYqyf9ZG1rwIJGuBuNL8NaL3LLZQWZqYrWodroMRT7xDwmER4wIIgS0lpUE+jc6mGtIDH4luwZA== X-Received: by 2002:a17:902:7081:: with SMTP id z1mr697922plk.252.1554306825120; Wed, 03 Apr 2019 08:53:45 -0700 (PDT) Received: from shemminger-XPS-13-9360 (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id j22sm21670990pfn.129.2019.04.03.08.53.44 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Apr 2019 08:53:45 -0700 (PDT) Date: Wed, 3 Apr 2019 08:53:41 -0700 From: Stephen Hemminger To: Bruce Richardson Cc: dev@dpdk.org, Declan Doherty , stable@dpdk.org Message-ID: <20190403085341.516957b7@shemminger-XPS-13-9360> In-Reply-To: <20190403155117.GA1332@bricha3-MOBL.ger.corp.intel.com> References: <20190403144505.46234-1-bruce.richardson@intel.com> <20190403144505.46234-2-bruce.richardson@intel.com> <20190403084758.2b7bed7f@shemminger-XPS-13-9360> <20190403155117.GA1332@bricha3-MOBL.ger.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH 1/5] net/bonding: fix buffer length when printing strings X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Apr 2019 15:53:46 -0000 On Wed, 3 Apr 2019 16:51:17 +0100 Bruce Richardson wrote: > On Wed, Apr 03, 2019 at 08:47:58AM -0700, Stephen Hemminger wrote: > > On Wed, 3 Apr 2019 15:45:01 +0100 > > Bruce Richardson wrote: > > > > > > > > static void > > > -arp_op_name(uint16_t arp_op, char *buf) > > > +arp_op_name(uint16_t arp_op, char *buf, size_t buf_len) > > > { > > > switch (arp_op) { > > > case ARP_OP_REQUEST: > > > - snprintf(buf, sizeof("ARP Request"), "%s", "ARP Request"); > > > + snprintf(buf, buf_len, "%s", "ARP Request"); > > > return; > > This should be strlcpy not snprintf > > Yes, it should, but I just let that get fixed by cocci script in the later > patch. For this one, I just fixed the most egregious error. Ok, I see From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 2BF68A0679 for ; Wed, 3 Apr 2019 17:53:48 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E2D8F1B4BD; Wed, 3 Apr 2019 17:53:47 +0200 (CEST) Received: from mail-pl1-f196.google.com (mail-pl1-f196.google.com [209.85.214.196]) by dpdk.org (Postfix) with ESMTP id E18F01B4B8 for ; Wed, 3 Apr 2019 17:53:45 +0200 (CEST) Received: by mail-pl1-f196.google.com with SMTP id cv12so8246563plb.9 for ; Wed, 03 Apr 2019 08:53:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=KFWTGq0ssTEU8ChKINCfvihSDedOCma/W8jNA3fQE6U=; b=AhKbWGa2a+mb64wwrDT9oU8NfkITjQLMTiioIdLqlFnCnMXvpYfJnK5tBVauHi48ZR wYtJgNmN86LKaoXEL6O9+ArltXWvITQ8LdiK4OULC2uwy3XaEWXMOzj3GZHmuk8JXnb3 iHZw3GVr5cqvB+7pvGlYzL/rypE1eX3F1O32NsTIqmrPeihSi4mremu75ZHwWDrrIUbR o03+dUTZI23J5VJpba3T0Ftih5kM9moyop2wkNL4FyUKD03LVOkPxI16SmUlI2f2q+oz bstbU4LKAHPVjcSS5yTOdOpzo5DHBrDslBDxqJmnoQ8tlyqdzPzYs3oRmGc4pHGmg0WO u4qw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=KFWTGq0ssTEU8ChKINCfvihSDedOCma/W8jNA3fQE6U=; b=tq3/fRnwbiHKRNoSClfR1FFajiZFoL3+1DYc5JHyMGtoHnu+ZebYZ/orUdCbXAymp8 b+rJ0dISABax7rPxSru6lHZeUUHruIINylU/GGnP04lKt1o4wN6WKaVE7LFZQd1sBWIg AIWvnUXcmJ56HDqIJqg5hlxpN8Xm9Xn0rtEFMhAF/y6IOtNHHjSuKX7eS6huSS1ZVtbN AKZm920n2K9u7xu3g8CZ1ccIWbxmX5pFvQCnrSbNXcwH5pLDUFV/VD2h8hfkc28DBaR8 gaFo8crwzE6l7GFE411/cuATPsZ7b8UpucSHwmdmLYudLva9vbglbe68dSqLyxNA+tc2 1X/w== X-Gm-Message-State: APjAAAXd/eCwUPUgskKy6VA5IrlU/Le9p5+otOWGZJvCuQ2jvYarny02 rpVIr25WDOzNxfhxNr7+G0ZKiw== X-Google-Smtp-Source: APXvYqyf9ZG1rwIJGuBuNL8NaL3LLZQWZqYrWodroMRT7xDwmER4wIIgS0lpUE+jc6mGtIDH4luwZA== X-Received: by 2002:a17:902:7081:: with SMTP id z1mr697922plk.252.1554306825120; Wed, 03 Apr 2019 08:53:45 -0700 (PDT) Received: from shemminger-XPS-13-9360 (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id j22sm21670990pfn.129.2019.04.03.08.53.44 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Apr 2019 08:53:45 -0700 (PDT) Date: Wed, 3 Apr 2019 08:53:41 -0700 From: Stephen Hemminger To: Bruce Richardson Cc: dev@dpdk.org, Declan Doherty , stable@dpdk.org Message-ID: <20190403085341.516957b7@shemminger-XPS-13-9360> In-Reply-To: <20190403155117.GA1332@bricha3-MOBL.ger.corp.intel.com> References: <20190403144505.46234-1-bruce.richardson@intel.com> <20190403144505.46234-2-bruce.richardson@intel.com> <20190403084758.2b7bed7f@shemminger-XPS-13-9360> <20190403155117.GA1332@bricha3-MOBL.ger.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH 1/5] net/bonding: fix buffer length when printing strings X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Message-ID: <20190403155341.JGPdIqa96-ewFtPXm6y5Yl6IKobXta-2Tel8XX2_tCQ@z> On Wed, 3 Apr 2019 16:51:17 +0100 Bruce Richardson wrote: > On Wed, Apr 03, 2019 at 08:47:58AM -0700, Stephen Hemminger wrote: > > On Wed, 3 Apr 2019 15:45:01 +0100 > > Bruce Richardson wrote: > > > > > > > > static void > > > -arp_op_name(uint16_t arp_op, char *buf) > > > +arp_op_name(uint16_t arp_op, char *buf, size_t buf_len) > > > { > > > switch (arp_op) { > > > case ARP_OP_REQUEST: > > > - snprintf(buf, sizeof("ARP Request"), "%s", "ARP Request"); > > > + snprintf(buf, buf_len, "%s", "ARP Request"); > > > return; > > This should be strlcpy not snprintf > > Yes, it should, but I just let that get fixed by cocci script in the later > patch. For this one, I just fixed the most egregious error. Ok, I see