Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp3555878pxb; Tue, 19 Apr 2022 05:24:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyLyIWXNdOzwY/4TfmpGf3xkSg3uNEqX8vZr9EZ1qBo4o6rY3ZlI8t75vk42aV5rka6e17U X-Received: by 2002:a05:6402:14c2:b0:41d:816a:4eb0 with SMTP id f2-20020a05640214c200b0041d816a4eb0mr17049150edx.301.1650371085080; Tue, 19 Apr 2022 05:24:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650371085; cv=none; d=google.com; s=arc-20160816; b=0MlI4PhyKs5sqPSBd6AHW5hoHS62Tw4rgvlE27X6vuOVkMUY9L1HAvdMAus3BNl+Cb BnpQE7c7IN/8J5wr0FsbphuytzN0Cl7S02wOiUiuNfW59G0Tuu35sM/nckQOqJmAyLfh Sx8O0GTTqRXLgAMZvJCbBQJDdtzvOv3N28V09NyIS8CVKpACPLydoec1Hy5sciaqaFbl JYGPak7c3yHKOHWFy7zcJ4ixJsVdddnwDecFNkVY7TrqCqjj5nwao+FU6/yJvYZAPUXJ HXZ/2Xej3QBOyS63+ZaWSGOmW3lR4SI7An55iMh35viCgURjPCnr57kOn0sWouVXEwhz /NOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=8e89x/h51DwU9lEdRFYYsNfzwzyJgVFYRlMjPJbrCCU=; b=XUptJTkrO4v3H355lHbjuufSvjVNekmd010wIZ8bgyPcB/UUdhoj6DQZm+B11AO2J3 pz6g2V3nPXEarZlyYhp7ZE5BJnio0CVRnNj10b0QO5+mAhsbNxLf1KAdReFzRThIA72T PiT/gSqdAeujsX8onFbsqbEJ4op9kia1T3u30DTJvKfnFHzbT4Ev8MIM+Zr6JKiq0fF5 oGaeGJ1Y4dywTT2+m0LoL4FJ8WqKAtbyfm2CADH0l4nErsFQ1b2sLG8GQHuv8UNbcLDA CCTpVtbBhZv9k9g3bQ4TtmQpq0DajblBe9NxAVt5E8V1dtfh8LakKx2SVpyn5T55YXuK Xv+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=QDshMKBb; 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=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s4-20020a1709062ec400b006efb4a96f87si4107917eji.942.2022.04.19.05.24.21; Tue, 19 Apr 2022 05:24:45 -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=@linuxfoundation.org header.s=korg header.b=QDshMKBb; 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=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243090AbiDRNjg (ORCPT + 99 others); Mon, 18 Apr 2022 09:39:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54022 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241138AbiDRNLP (ORCPT ); Mon, 18 Apr 2022 09:11:15 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5C03E3983D; Mon, 18 Apr 2022 05:50:36 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 09FEAB80E4B; Mon, 18 Apr 2022 12:50:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7A51EC385A1; Mon, 18 Apr 2022 12:50:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650286233; bh=HQCpx33vyRLby1m3u6tUxCLiMO0pt5p7L09eWaKirC0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QDshMKBbxNWVEhS+q+kiVGmWdEyfl7gYCH8qLRl1fu9cfg7XtCGz2IE0qeIKGz52C snGoN5qpJsvu4c3ThZEI9y+2c10UQXMOA9tPYJ/m9RevborTLbDO+4RqBT+1dGySis 7uoHYr+BD7mCL5u8rOIhj7psmAMxLENhczQrBJ9w= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Adrian Hunter , "Peter Zijlstra (Intel)" , Sasha Levin Subject: [PATCH 4.14 069/284] perf/core: Fix address filter parser for multiple filters Date: Mon, 18 Apr 2022 14:10:50 +0200 Message-Id: <20220418121212.651325774@linuxfoundation.org> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220418121210.689577360@linuxfoundation.org> References: <20220418121210.689577360@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 From: Adrian Hunter [ Upstream commit d680ff24e9e14444c63945b43a37ede7cd6958f9 ] Reset appropriate variables in the parser loop between parsing separate filters, so that they do not interfere with parsing the next filter. Fixes: 375637bc524952 ("perf/core: Introduce address range filtering") Signed-off-by: Adrian Hunter Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20220131072453.2839535-4-adrian.hunter@intel.com Signed-off-by: Sasha Levin --- kernel/events/core.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kernel/events/core.c b/kernel/events/core.c index 54da9e12381f..0f49ab48cb14 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c @@ -8641,8 +8641,11 @@ perf_event_parse_addr_filter(struct perf_event *event, char *fstr, } /* ready to consume more filters */ + kfree(filename); + filename = NULL; state = IF_STATE_ACTION; filter = NULL; + kernel = 0; } } -- 2.34.1