Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp553368rwb; Thu, 27 Jul 2023 17:46:07 -0700 (PDT) X-Google-Smtp-Source: APBJJlGIhsWZGTDGjdBqXa7yX04jA89rnpEL52AI7Y0stBHiisIduEgDzM3G5y9FxJI8w0h/Srha X-Received: by 2002:a05:6a20:8f0f:b0:137:3224:16c1 with SMTP id b15-20020a056a208f0f00b00137322416c1mr239242pzk.45.1690505166720; Thu, 27 Jul 2023 17:46:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690505166; cv=none; d=google.com; s=arc-20160816; b=FjOn9E1/YQkW+RbvoxI2D9OlogocysROe4B7lJhjtBVdQeCB4AIHJjVa1Hf8pQvWzz m1FNjF6q6qmRupdXM+r6dUVDYAfxg17BPu5InT0V5n9v9Xap2UZ29d1McAjFQjfdzxKp Lt30bUAkpK+dFAnutn3dxA9/j3ZkI39iggtSO2H25Vx4riPciE7pTUw8ICaifnbBcIXn eAj1umzyFrJ/Zlh6Y4pZOzJNPWrvCd626lL6HYLvD6rvJ6g446XBaqZKe83MK27QADFK Hy+KqGqdth+LbJLJdNY5t3iXSlWB5Y4/XCkcyg4QrGxjv6Lobjsbma8pZWhY18L1BT8i ZPxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:references:mime-version :message-id:in-reply-to:date:dkim-signature; bh=o6neUT/Z5ZxqZSvjTzsd3t4vT8zLu+ilqjGFbF/BwHo=; fh=5F7CF02SThLXmbX2PSXlBUcf/GKobYuFBd/4z18HIQI=; b=EJff9rQDj0/Ij88kN9PHiE8ktHPejqzqJC1WtsJnk6bYGkiHH079rZoPHDHa/Zmc+y B+4v39/tNVSN50z1F/Uls3qSSngZSFqAEJGybaRZ3acq161MdRoAD9yhSLHrXJHtz5c2 9AuEandsj28dIKQTKvivbDDciU23DgIeiq+9ZcolQ6oIFxyZ6CCdXXqkntBnwKODnCyU neNP/9ywfsDKmRRbZLHbr7evnThAV1jAcrXteTz/kCR8MvpDjNl63thewbFZSa7JQiYg yWdp0nPX7YgfuhVI6J86RLcSgZ8Hk3l6BygghxLmnuEbMKGZmTcgJ0OE3jckWxbNi8Q0 glww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=p3UY5Ort; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k5-20020a170902c40500b001bbbb70c23asi2224149plk.232.2023.07.27.17.45.53; Thu, 27 Jul 2023 17:46:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=p3UY5Ort; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232010AbjG1AND (ORCPT + 99 others); Thu, 27 Jul 2023 20:13:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52880 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229808AbjG1AM7 (ORCPT ); Thu, 27 Jul 2023 20:12:59 -0400 Received: from mail-yw1-x1149.google.com (mail-yw1-x1149.google.com [IPv6:2607:f8b0:4864:20::1149]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F306C2139 for ; Thu, 27 Jul 2023 17:12:56 -0700 (PDT) Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-57059f90cc5so17012367b3.0 for ; Thu, 27 Jul 2023 17:12:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1690503176; x=1691107976; h=cc:to:from:subject:references:mime-version:message-id:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=o6neUT/Z5ZxqZSvjTzsd3t4vT8zLu+ilqjGFbF/BwHo=; b=p3UY5OrtqjoAHr4YStHKi65rVDwgAEV7PTWNIAzOHMRRHlj/Q7SO5SS/iWoKuNGKNQ q3KH8pM5awvIVnWOT63BFHtZwwa9Eg1ijQC251g+h0PH1+pOncYTEvnlR8HJPVc1e9Zw zy2Bs+axgBATCD+3uHBG/x3UhoysgCIiCEISgdeClzUhp3C4K/PSNQXAIfZ/egs9XtIc LNUaKQbzbgSGfpDnqiWt7O2TA6OSyg3VFwMTP/o3zYgJ1HL654KUYJIiINd3H+rL9i+4 quOk3i/9iHtGRcOE3yKsB9jhMKECdvcp+GKr49ZFChLE+XmKDMnN3oxeiRt5QV5mIeUn dLyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690503176; x=1691107976; h=cc:to:from:subject:references:mime-version:message-id:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=o6neUT/Z5ZxqZSvjTzsd3t4vT8zLu+ilqjGFbF/BwHo=; b=W/gis6keWNGhmwk0GBmsye5x0b0sDz2tqkNUxKHR9SYj0+EYVUBSRTLTXEtGV2EssP dB3lznVVUkL5Sxl8JdEOImf9nqUULPWy1aB5vcSBcSV2LQrIN0Ca2Zui4Z6G/Qp1+8Dg 2TF6a150uvVtyNngR3FHpS6cJwN1Bp5DUPVM0kePmM95XQ6tlXnrDsNWbUT3qWHwhGcI jgSJT/ODfskNu7iFMF1whtJpjvPj94ypdxBgiD/FEW0zX9qoG/Ceo9yXDtdqBT8kyvzf F1fpWY8qTBKrWJFktGSwtZhePfN7E66du+EsL2f7+/9GRRIeLXyEA1ILErBmMiVSxQB9 Ej6w== X-Gm-Message-State: ABy/qLYg9uB5OHga5LhcxTSOnj311x1KoKsdZUtTWbvJwwhqFudhRglM WvfGloE/D385zVOiHkfdaQClV90xE2mP X-Received: from irogers.svl.corp.google.com ([2620:15c:2a3:200:3d03:ff18:af30:2dad]) (user=irogers job=sendgmr) by 2002:a05:690c:72b:b0:57a:118a:f31 with SMTP id bt11-20020a05690c072b00b0057a118a0f31mr1109ywb.7.1690503176098; Thu, 27 Jul 2023 17:12:56 -0700 (PDT) Date: Thu, 27 Jul 2023 17:12:10 -0700 In-Reply-To: <20230728001212.457900-1-irogers@google.com> Message-Id: <20230728001212.457900-2-irogers@google.com> Mime-Version: 1.0 References: <20230728001212.457900-1-irogers@google.com> X-Mailer: git-send-email 2.41.0.487.g6d72f3e995-goog Subject: [PATCH v1 1/3] perf parse-event: Avoid BPF test segv From: Ian Rogers To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Adrian Hunter , Eduard Zingerman , Kan Liang , Rob Herring , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, Wang Nan , Wang ShaoBo , YueHaibing , He Kuang Cc: Ian Rogers Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL autolearn=ham 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 loc is passed as NULL in tools/perf/tests/bpf.c do_test, meaning errors trigger a segv when trying to access. Add the missing NULL check. Signed-off-by: Ian Rogers --- tools/perf/util/parse-events.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c index 926d3ac97324..02647313c918 100644 --- a/tools/perf/util/parse-events.c +++ b/tools/perf/util/parse-events.c @@ -758,7 +758,7 @@ int parse_events_load_bpf_obj(struct parse_events_state *parse_state, return 0; errout: - parse_events_error__handle(parse_state->error, param.loc->first_column, + parse_events_error__handle(parse_state->error, param.loc ? param.loc->first_column : 0, strdup(errbuf), strdup("(add -v to see detail)")); return err; } -- 2.41.0.487.g6d72f3e995-goog