Message ID | 20211206145549.947913004@linuxfoundation.org |
---|---|
State | New |
Headers | show
Return-Path: <stable-owner@kernel.org> 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 C09AEC433F5 for <stable@archiver.kernel.org>; Mon, 6 Dec 2021 15:02:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345583AbhLFPFi (ORCPT <rfc822;stable@archiver.kernel.org>); Mon, 6 Dec 2021 10:05:38 -0500 Received: from ams.source.kernel.org ([145.40.68.75]:37802 "EHLO ams.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345609AbhLFPFP (ORCPT <rfc822;stable@vger.kernel.org>); Mon, 6 Dec 2021 10:05:15 -0500 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 ADA13B81017; Mon, 6 Dec 2021 15:01:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F24BCC341C1; Mon, 6 Dec 2021 15:01:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1638802904; bh=bO9+XPBbKaWVLHMsAOPojuxdVmFx/mi41a56665IBq4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AnY9ZXTiV8uyxZTpQjPcjf2amOVUNbLwFyyMfEo+TPCXeRvTfhiCPgSGYUTwgbNul i0YiJHUqwVFnqnykowR7zjKotOxiUvvr4ftKUOmTo5LUgZz41CcujIfCo7Nwy5VHAX ZTgPAt1zXJMNAQxZZxrJOcXE19Pk72ifH6MXRJWs= From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>, stable@vger.kernel.org, "Steven Rostedt (VMware)" <rostedt@goodmis.org> Subject: [PATCH 4.9 22/62] tracing: Check pid filtering when creating events Date: Mon, 6 Dec 2021 15:56:05 +0100 Message-Id: <20211206145549.947913004@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20211206145549.155163074@linuxfoundation.org> References: <20211206145549.155163074@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: <stable.vger.kernel.org> X-Mailing-List: stable@vger.kernel.org |
Series |
None
|
expand
|
--- a/kernel/trace/trace_events.c +++ b/kernel/trace/trace_events.c @@ -2241,12 +2241,19 @@ static struct trace_event_file * trace_create_new_event(struct trace_event_call *call, struct trace_array *tr) { + struct trace_pid_list *pid_list; struct trace_event_file *file; file = kmem_cache_alloc(file_cachep, GFP_TRACE); if (!file) return NULL; + pid_list = rcu_dereference_protected(tr->filtered_pids, + lockdep_is_held(&event_mutex)); + + if (pid_list) + file->flags |= EVENT_FILE_FL_PID_FILTER; + file->event_call = call; file->tr = tr; atomic_set(&file->sm_ref, 0);