Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp2076845rdb; Mon, 9 Oct 2023 11:40:41 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE4HAJS4CtI92XP2f+DBAIkSrAx8pqJzDJe6oJ6of0lwm4gmsW4Kiu6qL4P7Xf6ICR9GPXp X-Received: by 2002:a05:6a00:1941:b0:692:b429:390 with SMTP id s1-20020a056a00194100b00692b4290390mr17041873pfk.29.1696876840995; Mon, 09 Oct 2023 11:40:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696876840; cv=none; d=google.com; s=arc-20160816; b=qNUwJRNDrWAqbEhB1VBNWLjxmHp3NWacqb0AWICaITJUp+pofGzey9pZaZ9av2sMJp +ANbAnesNh5Xc51gGYK/jvMqaK+L47mxDTqo1syw1M1vq3VrioN0lCV8LZ1gjDjyIQMk 22STVK5KFSJ1zAZ6bHeIfsXQezpZqWby126e0x5en2FMwWlSeziUxIorJDNzteMwYr3S goEAU9GNeB1rwRE8SxGWN9akvul9HpCHPssI9GZ++R5YepoAZ7/DGrymzycsEof2QKFO pkhlESNvt4da4+9Wx6jwyF7ogu6/eAAa6wJY3Cyx/P6CycARh26El1PpHd+X2qpoovR7 U9PQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:from:subject:references:mime-version :message-id:in-reply-to:date:dkim-signature; bh=i2XqQMJ0GkpZoKYBOeb+AHUkFWOwFAfTNDekNOfqFv8=; fh=8uoRd8OfBKdrcgzCS0TCbKG83gg6rx5b6zeE6Tx82zI=; b=0dHJUwsb5lWpKOHLWCESH2+rTMYzakgoLKmR2cMay6mMPFjCTuEDGQOEbIy3ucftkd GiRN7b7mtlGDz8mnNyuPcl3PUwmue/BxOpUB37nAmZ82g7BrlNuqyWLqaQF3K8eF0obK 6ZSURcl+bAlSDfjiYE1Tmhx7lGQqp2g0eGHn/q6A+ZQHI/O5GqbvQAgUb84s7FYbj8zU YPkd+uBH5JEayc8TY/8bm02NQMhEeHS5+nUoUxl7wCI4WDUhiqV601xtYvxxhxVbC5Y7 93dlgRxslsj8aG0R/a05iV7oTC11KOZbjctGDv9ubvnY8I6nV0MfX8Ua5S6g4o4ROWbj GSIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=yJ7plmLe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id fc6-20020a056a002e0600b0068fcca7b3f7si7928740pfb.2.2023.10.09.11.40.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 11:40:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=yJ7plmLe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 0E85480BB203; Mon, 9 Oct 2023 11:40:21 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378331AbjJISjw (ORCPT + 99 others); Mon, 9 Oct 2023 14:39:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43060 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378201AbjJISjl (ORCPT ); Mon, 9 Oct 2023 14:39:41 -0400 Received: from mail-yb1-xb4a.google.com (mail-yb1-xb4a.google.com [IPv6:2607:f8b0:4864:20::b4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BC627FB for ; Mon, 9 Oct 2023 11:39:38 -0700 (PDT) Received: by mail-yb1-xb4a.google.com with SMTP id 3f1490d57ef6-d9a4ae873edso293127276.3 for ; Mon, 09 Oct 2023 11:39:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1696876778; x=1697481578; darn=vger.kernel.org; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :from:to:cc:subject:date:message-id:reply-to; bh=i2XqQMJ0GkpZoKYBOeb+AHUkFWOwFAfTNDekNOfqFv8=; b=yJ7plmLe4lpsv+raN9xFF/rU7/DGO5wkyB71VErLaVEJqqPFzGWQmA4JONtB/J867G W60pawhGLCANJV9jhSoZt3DqwXzlvCm/0p7Clz84lfk0JOFiiAtkUKb3lV5G5WgQKPfX OWgp77Zs2c+ZO90MAfurYZUD+RINLwhHyAJ23aBWeacroCgeEC6I80dxnI3Pk+15o6XX rgyTB1WIqwDEneGrUOjs7qFxpVkA7oEHynZMTclaq4zZms7BXm3/Ef0rnQeVfA51sT5O dtOryD5Mh9C8II+5L8/3QFOP8+tVguAmgjp0l+lr9VoDJqeGqQ/lnjTUHLAWnX7naP4e X5gA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696876778; x=1697481578; h=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=i2XqQMJ0GkpZoKYBOeb+AHUkFWOwFAfTNDekNOfqFv8=; b=ps/pse+c2sDUUH0TZ7oKuwgkgxYDuTiqyVvAp5ZaQedIaI8okrcmz/by6SzcZJ+Wxi 87gH+GBBJC+xn1+9KSCcSyejfpi0kmmL52QtpShqmLIEzfsQz5Iqx8P8K+wIa6aZpTHY eSWJPvlqFmpKFhKXS7WdNMnJPGtRk9FItETpnW/y+5cniPYTtWnGpCNht1B6PylT9Pqs xrUP0Cij52LuLmg9z9h105DoAzFt1l0MWu6VKnNxu38m2Hmz3yAqCGCkR+7hW2/sjzg8 9BpZMgdWHLcEOiwbly8Kbg8Nnzez+TJpUWncCCRbh3F6YCGWZ3oMmyt9ZGf8/+Kinutv oSjw== X-Gm-Message-State: AOJu0YxJt7xz5w2wdDq5gO27CeBazaUeAm+VEkLKNry0kw4r2lv5+gIY ntuguUNoW5lrAhn/VhucT3h+QxZV7rl9 X-Received: from irogers.svl.corp.google.com ([2620:15c:2a3:200:ac4a:9b94:7158:3f4e]) (user=irogers job=sendgmr) by 2002:a25:bec9:0:b0:d9a:5349:4bdd with SMTP id k9-20020a25bec9000000b00d9a53494bddmr423ybm.8.1696876777869; Mon, 09 Oct 2023 11:39:37 -0700 (PDT) Date: Mon, 9 Oct 2023 11:39:06 -0700 In-Reply-To: <20231009183920.200859-1-irogers@google.com> Message-Id: <20231009183920.200859-6-irogers@google.com> Mime-Version: 1.0 References: <20231009183920.200859-1-irogers@google.com> X-Mailer: git-send-email 2.42.0.609.gbb76f46606-goog Subject: [PATCH v3 04/18] perf bench uprobe: Fix potential use of memory after free From: Ian Rogers To: Nathan Chancellor , Nick Desaulniers , Tom Rix , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Ian Rogers , Adrian Hunter , Yang Jihong , Huacai Chen , Ming Wang , Kan Liang , Ravi Bangoria , llvm@lists.linux.dev, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, bpf@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-4.8 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.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 (groat.vger.email [0.0.0.0]); Mon, 09 Oct 2023 11:40:21 -0700 (PDT) Found by clang-tidy: ``` bench/uprobe.c:98:3: warning: Use of memory after it is freed [clang-analyzer-unix.Malloc] bench_uprobe_bpf__destroy(skel); ``` Signed-off-by: Ian Rogers --- tools/perf/bench/uprobe.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/perf/bench/uprobe.c b/tools/perf/bench/uprobe.c index 914c0817fe8a..5c71fdc419dd 100644 --- a/tools/perf/bench/uprobe.c +++ b/tools/perf/bench/uprobe.c @@ -89,6 +89,7 @@ static int bench_uprobe__setup_bpf_skel(enum bench_uprobe bench) return err; cleanup: bench_uprobe_bpf__destroy(skel); + skel = NULL; return err; } -- 2.42.0.609.gbb76f46606-goog