Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp421499yba; Fri, 12 Apr 2019 06:22:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqyqJwyCIv8XAMLXbevCkNgqSDbhkaEOMFP3BmgNKIps2xXm98nE6UxyTVww1ikralqlCYfL X-Received: by 2002:a62:6fc6:: with SMTP id k189mr38651421pfc.154.1555075332056; Fri, 12 Apr 2019 06:22:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555075332; cv=none; d=google.com; s=arc-20160816; b=nTBihDc4ZzaLuvkz3vLV/DxYCKyZWdsh0qbXw9Od7SzVu8ORsLU8bMcU2EsVwbjnPo ltDHnWNLZo8Ax70boxlVMjfXibONU1NnVyYFcXtayF3b3DjJfoxXxZMUc2XuQ0x2ge3T vliLmDRGsYwIPE6nsr7LN+NMyqVsJ722fQPi786o6u7NuEj0V7i5gYcZOar7FpxpjQfT 8PeaLFUSSHhy+vZ9GrBv3mJE4ZE2uOpR8rPJosKpH2vNEmPVsL1KzUCm97+UbglnaPAS EIRYrZ64jWg253lJVwjo1B8fW19XLe30y1iG8XDJopMlqy68dr7lAzLh6G8iwIQPiFpA 682Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:autocrypt:openpgp:from:references:cc:to:subject :dkim-signature; bh=RD5e3nY4gSGKvY1dPERdEJF3Duo6Im/qEyST4NxZfjk=; b=gPF2uEw0nHlFQXVCugNdCiklHuqd7yjLs4BoWNHgBZGoopnZjVoGITARUX/p/xNMj5 itshwUWSmJqI82pHfaGdpIHDFtALmmlq1bpBYchiG11gDgdElK+k7b2ELDxqd5BPMMyo uZ4aJtfXQXLSu+mCCR3AepvC53CpVDc3Ip1UYeJPvjSb7B7SSDHb68pknz8qjtFuEFa7 4OW2h6LUDBptYMeMCED9ALR+Zvj8HQkfvg897plPItCas99Fa4wuk4hGR9y9Y0qbPr9l C9AmJzQOPl9t8JI43lnVHwUB/oFJIFDvpaEfpT56IpTp6S0zeI2s92Tk4F8ggkB8rulW kyBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@netronome-com.20150623.gappssmtp.com header.s=20150623 header.b=lADMS5s4; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x131si37280830pgx.73.2019.04.12.06.21.55; Fri, 12 Apr 2019 06:22:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@netronome-com.20150623.gappssmtp.com header.s=20150623 header.b=lADMS5s4; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726851AbfDLNUv (ORCPT + 99 others); Fri, 12 Apr 2019 09:20:51 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:36635 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726829AbfDLNUv (ORCPT ); Fri, 12 Apr 2019 09:20:51 -0400 Received: by mail-wr1-f66.google.com with SMTP id y13so11962979wrd.3 for ; Fri, 12 Apr 2019 06:20:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netronome-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:openpgp:autocrypt:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=RD5e3nY4gSGKvY1dPERdEJF3Duo6Im/qEyST4NxZfjk=; b=lADMS5s4NQBE+2YJwhMzPXbp57vD/aJJRK4khgoEdAMfrGPZ/T5LNmO38/dpLX4Wb8 TYbp5rUzNGLEwXb8k6bzsIWByMzGM0ZtEMGAf41oPifQY17lise8NjwKLlfHIsKAGiK5 9h3Hiudmr9YPlkYn8KzR/XGfbp/G4JNhYFtS4QRMGGzUQ/ykF2QSChcXSmTH+x8hSHmh khpdJThC+gdcoUKh3w3mCB8KQPH3TV0gsbwNwmnWnfXtriMXL3UWI6qP0bV7uL9g1MUH 5uIEeuvntDToS03YT1Yq9HTxxAm8dD4Ip3sTgPuN87IpzHq6B3WhxSpQBCUU/Ukxk/u3 LJfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=RD5e3nY4gSGKvY1dPERdEJF3Duo6Im/qEyST4NxZfjk=; b=krQzzrwqq0FidD4A1FVNZ9CBuiJ3Ye05v/A6wWLq/NmKzcvuTsBEbfhrZrAXzP87wj nvDnbxvtSonyw/pJLJTuL4jObiah2580Vk2H799FrQU8PTCF79mX/JA/kKeXBms/y5lA r5+6MqIM8k4BOUtIybDb02yHBXj8y9oGM5EkJxlNw5xg2jYdku8ibEt6Gy52xgEmB49w R4xRIB3NWDCno8f0uR9X6slVsnTqnih6fHcJCzkXrlmxzdJVScbb0Y7U3UQG/RAA37ej CIlgo+pcIvqWQprtK2w1iloSAENT5ejm2elVjZkGnMcaGB9axv7+WRS2pBL6CsWr1E8x VZng== X-Gm-Message-State: APjAAAVeZS6DJgIaV1zLMpqavj72QeAlDR5HMdYGQDM+wC2goOjWUFpD WBtiVRrnaK3gleTkqnMxTy7rAQ== X-Received: by 2002:adf:eb84:: with SMTP id t4mr8579724wrn.43.1555075249195; Fri, 12 Apr 2019 06:20:49 -0700 (PDT) Received: from [172.20.1.104] ([217.38.71.146]) by smtp.gmail.com with ESMTPSA id w130sm11051415wma.36.2019.04.12.06.20.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 12 Apr 2019 06:20:48 -0700 (PDT) Subject: Re: [PATCH bpf v2] tools: bpftool: fix infinite loop in map create To: Alban Crequy , ast@kernel.org, daniel@iogearbox.net Cc: bpf@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, alban@kinvolk.io, iago@kinvolk.io References: <20190412124050.32120-1-alban@kinvolk.io> From: Quentin Monnet Openpgp: preference=signencrypt Autocrypt: addr=quentin.monnet@netronome.com; prefer-encrypt=mutual; keydata= mQINBFnqRlsBEADfkCdH/bkkfjbglpUeGssNbYr/TD4aopXiDZ0dL2EwafFImsGOWmCIIva2 MofTQHQ0tFbwY3Ir74exzU9X0aUqrtHirQHLkKeMwExgDxJYysYsZGfM5WfW7j8X4aVwYtfs AVRXxAOy6/bw1Mccq8ZMTYKhdCgS3BfC7qK+VYC4bhM2AOWxSQWlH5WKQaRbqGOVLyq8Jlxk 2FGLThUsPRlXKz4nl+GabKCX6x3rioSuNoHoWdoPDKsRgYGbP9LKRRQy3ZeJha4x+apy8rAM jcGHppIrciyfH38+LdV1FVi6sCx8sRKX++ypQc3fa6O7d7mKLr6uy16xS9U7zauLu1FYLy2U N/F1c4F+bOlPMndxEzNc/XqMOM9JZu1XLluqbi2C6JWGy0IYfoyirddKpwzEtKIwiDBI08JJ Cv4jtTWKeX8pjTmstay0yWbe0sTINPh+iDw+ybMwgXhr4A/jZ1wcKmPCFOpb7U3JYC+ysD6m 6+O/eOs21wVag/LnnMuOKHZa2oNsi6Zl0Cs6C7Vve87jtj+3xgeZ8NLvYyWrQhIHRu1tUeuf T8qdexDphTguMGJbA8iOrncHXjpxWhMWykIyN4TYrNwnyhqP9UgqRPLwJt5qB1FVfjfAlaPV sfsxuOEwvuIt19B/3pAP0nbevNymR3QpMPRl4m3zXCy+KPaSSQARAQABtC1RdWVudGluIE1v bm5ldCA8cXVlbnRpbi5tb25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8x+tWD8x53SEOSn94g2AyJA9Txh2xBhWGuZ9CpBuXjtPrnRSd8xdrw36AL53goTt/NiLHUd RHhSHGnKaQ6MfrTge5Q0h5A= Message-ID: <8fb1d2e0-f8c0-4e01-ddf8-158c9e80558c@netronome.com> Date: Fri, 12 Apr 2019 14:20:48 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190412124050.32120-1-alban@kinvolk.io> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2019-04-12 14:40 UTC+0200 ~ Alban Crequy > From: Alban Crequy > > "bpftool map create" has an infinite loop on "while (argc)". The error > case is missing. > > Symptoms: when forgetting to type the keyword 'type' in front of 'hash': > $ sudo bpftool map create /sys/fs/bpf/dir/foobar hash key 8 value 8 entries 128 > (infinite loop, taking all the CPU) > ^C > > After the patch: > $ sudo bpftool map create /sys/fs/bpf/dir/foobar hash key 8 value 8 entries 128 > Error: unknown arg hash > > Fixes: 0b592b5a01be ("tools: bpftool: add map create command") > Signed-off-by: Alban Crequy > > --- > > Changes in v2: > - Explain the cause of the bug in commitmsg > - Add the "fixes" line in the commitmsg (Jakub's review) > - Rebase on the bpf tree > > v1 was initially based on bpf-next and submitted on > https://marc.info/?l=linux-kernel&m=155310327709613&w=2 > --- > tools/bpf/bpftool/map.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/tools/bpf/bpftool/map.c b/tools/bpf/bpftool/map.c > index 05b029b934a6..1ccc38718458 100644 > --- a/tools/bpf/bpftool/map.c > +++ b/tools/bpf/bpftool/map.c > @@ -1151,6 +1151,9 @@ static int do_create(int argc, char **argv) > return -1; > } > NEXT_ARG(); > + } else { > + p_err("unknown arg %s", *argv); > + return -1; > } > } > > Reviewed-by: Quentin Monnet Thanks Alban!