From patchwork Thu Apr 14 13:09:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 562573 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DF4E9C433EF for ; Thu, 14 Apr 2022 13:21:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244227AbiDNNYN (ORCPT ); Thu, 14 Apr 2022 09:24:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47624 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244149AbiDNNXk (ORCPT ); Thu, 14 Apr 2022 09:23:40 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D511699ECE; Thu, 14 Apr 2022 06:18:18 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 42A8861670; Thu, 14 Apr 2022 13:18:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4D9F6C385A9; Thu, 14 Apr 2022 13:18:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649942297; bh=WU0OW8t+pGBPSMyHCZhXLQ4VgSJNRxH9ZY7qO6nlb78=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SVzngb7BVuy3tTERZMPaJ6Iz/jDirL6t3xmWZYIst+6EhXI6EF263AHVcjp3dYH2f jgv6dmBdchzhlxDObst/+7AuaOIVC+ZG2u1ABBFuZG6eN2JZpQXqmnA/kQglTv2qrE ohd2jTLMhoyaDmCNNsbx0zCaczL5nkjkJBs48Djk= 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.19 085/338] perf/core: Fix address filter parser for multiple filters Date: Thu, 14 Apr 2022 15:09:48 +0200 Message-Id: <20220414110841.320333710@linuxfoundation.org> X-Mailer: git-send-email 2.35.2 In-Reply-To: <20220414110838.883074566@linuxfoundation.org> References: <20220414110838.883074566@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@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 2adde229d1af..ec2f9e433208 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c @@ -9137,8 +9137,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; } }