Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp459002rdg; Thu, 12 Oct 2023 10:21:27 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH6f0AQi2sZ5woeO54QoZTs1CM2NOjasdhh7nDlBIHwGpsVfVqby8KFMb21/orruQkjQzzx X-Received: by 2002:a05:6358:785:b0:143:82e0:8cbc with SMTP id n5-20020a056358078500b0014382e08cbcmr28387236rwj.1.1697131286833; Thu, 12 Oct 2023 10:21:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697131286; cv=none; d=google.com; s=arc-20160816; b=G2nWbNcCHyhnc1JsrAT/sraizOyNhCydq358OLB8NbXHrOrClEMGI4CQnfw603xfTV xipVGJ/7AwxYi4C6Vw0zCrdMTGNaxn0aGr18gScvPngo7JtVDbPSgHjyK0EMomfLNKuu fXTlErsw0Dhem07eWH83SZlEsW8FePgqQg20fz03I4cVzZjSkni5CqvqEeeF2giiJ4Sr rO3zs4H1TWC5QXvi0gJEC1clh75gBZf3CU6/3mLEcHNa6StFVRovg29itF3ZUDZj21B/ p6UBHGoO+kx1HIQht0LmAVrZ6tnfwFI/4HwtwigzgVXsks+V+SYlNEVxOfribSBFUGin uIgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=4Currw3NJmkeOxUQJFfzpcg2M4jLfQd7rVC9AHteNlA=; fh=+R+Tmq+BH1AyB8trCbYXGS/OdHvGmoOPW640qCmyW14=; b=y1Fm5FiP5ZqZLRCc98+MKyJ4jIoAEo9lcxpeJWIasBA/s1TFFIvwzKb2QOuUHXI0am /jPXzRM4/LBoRKieyVDIScxrOoLmKdmyBotcxt6Epp7XaiJxY849hmxXhEZPqd550LiL sYn2mTSqTW4U9J9bbKA5+3XKMpXDOJJ+k/bq6zCSHo4qY1l9aIQ80iJL5lQXVlZTdPpP Jz2lbrqsSS2Q2F4BYMoLFFp+h4yp+bhjyD3VYddhgS8VuydKcgMr+TLgsP88AxW0Xo7U cf3z4DeQxccYmqCpGrhSz4tQ/Bxmsr6Yibj/UTGiiMHXAT7DlWBu7gh/oNupfNBGe3d2 8hdg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id c9-20020a056a00248900b0068e405d9217si15985505pfv.302.2023.10.12.10.21.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Oct 2023 10:21:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id E8B3E8098E8F; Thu, 12 Oct 2023 10:21:02 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1379320AbjJLRUw convert rfc822-to-8bit (ORCPT + 99 others); Thu, 12 Oct 2023 13:20:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60634 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344077AbjJLRUv (ORCPT ); Thu, 12 Oct 2023 13:20:51 -0400 Received: from mail-pj1-f46.google.com (mail-pj1-f46.google.com [209.85.216.46]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 00BA0B8; Thu, 12 Oct 2023 10:20:48 -0700 (PDT) Received: by mail-pj1-f46.google.com with SMTP id 98e67ed59e1d1-27d1f57bda7so844389a91.0; Thu, 12 Oct 2023 10:20:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697131248; x=1697736048; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=bGM0orxolwQDYHlwlGGazTy0jcBbxhs1wdeAXhV7h3Y=; b=hhZ4zuysFFLsDu2d89pncICkGNOrYaWQzeNDazuRKYpcTLCfNPjZbpNoRvGyxZBSIu 6y067hb1jW2mpkqUGH9KdG+mGQ9Qo1S7Fc+rJUjvEHp522xDzlyD8tnjTgMTBY9wy0eG E2xBt+i99IV2yvh0EnARQ2SZODT3+qV3YKamKZ2dcuNHRUyDC8LVv5rRBYtYO/Dped5x JMHXUDpMnnSyb90bHkhWpzbY9Qe7jAum1E/qDJk3m8X2MtbYWpa+mkLz7sVkQ2iKbcXo Xo+zKs1Ek0c73eKjPU3NvVAV/qHS3t/y/bKB37elh4i0ALtxM6/wgKYUVqGtOfT8O/Pn rWRA== X-Gm-Message-State: AOJu0YztyToEeh6HW0PzpQ5TibA3Y3zJHeWs/6mrTV0ASFfrG8QSkodU hoYary1T179YxpMHGfLehSdLUIrGG2njxww4Wvq22oWo X-Received: by 2002:a17:90b:ecc:b0:27d:a59:ebae with SMTP id gz12-20020a17090b0ecc00b0027d0a59ebaemr4670194pjb.46.1697131248206; Thu, 12 Oct 2023 10:20:48 -0700 (PDT) MIME-Version: 1.0 References: <20230907210533.3712979-1-irogers@google.com> In-Reply-To: From: Namhyung Kim Date: Thu, 12 Oct 2023 10:20:37 -0700 Message-ID: Subject: Re: [PATCH v1] perf parse-events: Avoid erange from hex numbers To: Ian Rogers Cc: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Adrian Hunter , Rob Herring , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Thu, 12 Oct 2023 10:21:03 -0700 (PDT) On Fri, Oct 6, 2023 at 12:05 PM Namhyung Kim wrote: > > Hi Ian, > > On Fri, Oct 6, 2023 at 8:30 AM Ian Rogers wrote: > > > > On Thu, Sep 7, 2023 at 2:05 PM Ian Rogers wrote: > > > > > > We specify that a "num_hex" comprises 1 or more digits, however, that > > > allows strtoull to fail with ERANGE. Limit the number of hex digits to > > > being between 1 and 16. > > > > > > Before: > > > ``` > > > $ perf stat -e 'cpu/rE7574c47490475745/' true > > > perf: util/parse-events.c:215: fix_raw: Assertion `errno == 0' failed. > > > Aborted (core dumped) > > > ``` > > > > > > After: > > > ``` > > > $ perf stat -e 'cpu/rE7574c47490475745/' true > > > event syntax error: 'cpu/rE7574c47490475745/' > > > \___ Bad event or PMU > > > > > > Unable to find PMU or event on a PMU of 'cpu' > > > > > > Initial error: > > > event syntax error: 'cpu/rE7574c47490475745/' > > > \___ unknown term 'rE7574c47490475745' for pmu 'cpu' > > > > > > valid terms: event,pc,edge,offcore_rsp,ldlat,inv,umask,frontend,cmask,config,config1,config2,config3,name,period,percore,metric-id > > > Run 'perf list' for a list of valid events > > > > > > Usage: perf stat [] [] > > > > > > -e, --event event selector. use 'perf list' to list available events > > > ``` > > > > > > Issue found through fuzz testing. > > > > > > Signed-off-by: Ian Rogers > > Acked-by: Namhyung Kim Applied to perf-tools-next, thanks!