Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp586212rdb; Fri, 6 Oct 2023 12:08:00 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHnhtBPSiTDHZoa6i7ypSBqi4q+GHQ9FIfzbWD5d7BXyI2CgZTWpDbwK+EeevwuvQDRMivM X-Received: by 2002:a05:6a00:2d8c:b0:68f:c078:b0b6 with SMTP id fb12-20020a056a002d8c00b0068fc078b0b6mr10033166pfb.10.1696619279784; Fri, 06 Oct 2023 12:07:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696619279; cv=none; d=google.com; s=arc-20160816; b=sgJ/xquea73s7R1wLA9sm4CyZtwXb0yU2h/SKYpa79MyB3JcbNlNyGg1inaJYBgYOq aYH82x3ph1WvN6ecaO94RsqwI34i5R+F8IvCvIOzMz1k/ymrOxsFJyc4NEMyMlnmAAX4 eRDilNWMeICgAKuoOh5BiPmh08AEwH5FYDMedJtU+aLe4KeEYNnXvZDkYVCGtXEpNkCC 7ysR+F6oTHmFPF/y+TC5uTkJwoe5B9Ng3vrBL3mlMi74jL51H6Q5i45SYCbLaW3p+OAm rpdc0cfL+mP1trshpSLPdbOG/WSvZITteRjm1U7kToK4JlwJP37rmC4xz1fj7pU3KKvl jOTg== 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=2Z/rWPqPWq9iw1NIP8AmTbL0vKsP9uZuxPviNB9NIFY=; fh=+R+Tmq+BH1AyB8trCbYXGS/OdHvGmoOPW640qCmyW14=; b=Uwn+AaAwhxluBY6oG3fEJ+5V+If9wNdsqRhSP8GLQPk2KxIvY8qCPkM560LmYG1nMN E1w28BKLR3G4x+BFK8fO9OjL/3vYsqDE9Kfghs2iu/b8wsvOYVXZl1vwu3O/FQ7o/0yV fJBtSHkMkXhGGxn4adSHz6R+XnAqkBGjmtta2qbRygb4uWhazo1tD5ljIIrx+EV1vqOo Dtbx/oScyfI84n2sXpX1myCgFpx1O/xaE0+mf95JeOLA36H+ufRGsDrqyHH2s48XUECE P0uBCqtocCARIReWGHhHbLIt1oPigcvYamFAQbAFLXxcGis51DFHZLAxtbcIImBfVJYH qzyg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id d18-20020a056a0010d200b00691018e3f4dsi2062661pfu.201.2023.10.06.12.07.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Oct 2023 12:07:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (Postfix) with ESMTP id B2B6D8061B66; Fri, 6 Oct 2023 12:06:16 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233460AbjJFTGH convert rfc822-to-8bit (ORCPT + 99 others); Fri, 6 Oct 2023 15:06:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45154 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233438AbjJFTFs (ORCPT ); Fri, 6 Oct 2023 15:05:48 -0400 Received: from mail-oo1-f45.google.com (mail-oo1-f45.google.com [209.85.161.45]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 251ABCA; Fri, 6 Oct 2023 12:05:39 -0700 (PDT) Received: by mail-oo1-f45.google.com with SMTP id 006d021491bc7-57b8cebf57dso1344084eaf.0; Fri, 06 Oct 2023 12:05:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696619138; x=1697223938; 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=rTVoeVfMOxsjEM7ujAVqwzrstYR+YNmGmlAo8xZUyMo=; b=ahx8z5uV0WL9ctIOMDegl9omLN+95Edtqz+etGLiAsFZIie1bF/UTV4q4BYDZCHhmA aa86+UGsPL4yuSGQ7Qij/98biA28SLq/oAaB8WPE407eoQ6QauIZzVw3jKbeMaRMIPhU dvD1DW5QdamR+TXGf5jp8gqMaDNNr84fIv5zoh35/qxn76eHWOkUiM2ADWvEll+DsdSK +Lw/f7BhRlQTLH8XyCGnbsjc6q/6tkRIcZsCrjr94qh6rkAZR+pkcc3k4TNHhesKEAvi hx+e25rRCc+yzkZdZTl4tPBC70c/2YqK0lQYuSiFEwb3insOB2XI6Wb5Pe6r0xsyCtnj zyiw== X-Gm-Message-State: AOJu0YwEmV0XZzr9vQ25XdUfs73Pv+/1jsgZHuBCh62esO5U3sDJXyXu wUvGQfpkHECvZGTYvENxnrO+9/MktBmzdcnIZ6w= X-Received: by 2002:a05:6358:938f:b0:140:ecf2:4c69 with SMTP id h15-20020a056358938f00b00140ecf24c69mr9234027rwb.3.1696619137983; Fri, 06 Oct 2023 12:05:37 -0700 (PDT) MIME-Version: 1.0 References: <20230907210533.3712979-1-irogers@google.com> In-Reply-To: From: Namhyung Kim Date: Fri, 6 Oct 2023 12:05:26 -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.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Fri, 06 Oct 2023 12:06:16 -0700 (PDT) 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 Thanks, Namhyung