Received: by 2002:a17:90a:9307:0:0:0:0 with SMTP id p7csp3948077pjo; Tue, 3 Mar 2020 09:56:18 -0800 (PST) X-Google-Smtp-Source: ADFU+vvCdELEdW/dVLxVURPjiY+dRD9FdW1rphy16PRu9RZpm/dtlkFZyDPkSqBayqQeJHr50x6o X-Received: by 2002:aca:403:: with SMTP id 3mr3333128oie.60.1583258178134; Tue, 03 Mar 2020 09:56:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583258178; cv=none; d=google.com; s=arc-20160816; b=1KOAFr8F0Jrk3kOCG10jmIqLohgUifwtHIauoDlkknWor5MCbJTGH/VF8yoRhz1B7Y ylTxCtvYjgc95UDlsVjPAzBAyfyzePsj4phe7YX7rLiw1boNl4/B52LEx+gjoKNDh1w2 aWiQKit3ZeJhKPru/TmWVco1UXriK0nFT+5moNLHIr/pJ+wqOCcfJswhdZY6BEVVf3/Z Wxg+WooYeYXGCrkcmjx1+uZ2z7snJTyhqOkmJ6by2ycsV78+8wOhETtYIwQ3BVzBiczc zkrI3pwlMJAnWvipde3uKi1+Uf5z0j+BoGy1uE/DxZ8t68yt9two+p/hwAx8xCSNWIn7 dIvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=geYjiKqr2KjOG4MMTpPXCquqxImTKIMJ/FxiNJha98Q=; b=xKO8wnwEKrZ647yjQii+ZnYqgXvy7i5r7Oer/G8Cu4QpdrR5B8i4eviQblshgJ32pp wnJIMxN8Rb57P/Fvi2mRJYs6zGN4ayptw6IKGU2TK7uazibGYpigu0bw2MfSPX0JUdE6 +TECM1Qp2ljE1ThiiQn7P2LKGe0+W34SorRIhFbeo8cliRnvah5nSp+HICeg91AxFuX9 rNeXOQmXedrUlR5WZe7O8aNoSR5rPHgbqNJlOQURToSMzysv4slCxltMCVp78Ts4UvN/ mlANdc9Enuwj3E36+cxOrY83Wk1wQX1/WZcUUIYJjH6//PwCcgeVPH4tSnS/AIAdd/8e hE3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=wYBqd+h3; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u207si1349971oia.176.2020.03.03.09.56.05; Tue, 03 Mar 2020 09:56:18 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=wYBqd+h3; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732733AbgCCRze (ORCPT + 99 others); Tue, 3 Mar 2020 12:55:34 -0500 Received: from mail.kernel.org ([198.145.29.99]:37236 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732726AbgCCRzc (ORCPT ); Tue, 3 Mar 2020 12:55:32 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1FAA6214D8; Tue, 3 Mar 2020 17:55:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583258131; bh=j97uCJQ9NGHO2e3d3Wo4LUPwE2bp4oAQuteoTsUP1p0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wYBqd+h3HeFWgUt3PUIdrOs0gPr02J/ntkpMxvm5shK1be0Vqcn8UITSJ1A+5WUDR x6VEEHyDuIdSrUebUn3Vbd7qyMd/dVemyoPAFhUSh9qB2EKbkke5MuG8+20mkyGCr3 ndY7NRsV8Cfr1LKvpl+rssYCG0QTdmwP/769rpTc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Steven Rostedt (VMware)" Subject: [PATCH 5.4 082/152] tracing: Disable trace_printk() on post poned tests Date: Tue, 3 Mar 2020 18:43:00 +0100 Message-Id: <20200303174311.867738681@linuxfoundation.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200303174302.523080016@linuxfoundation.org> References: <20200303174302.523080016@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Steven Rostedt (VMware) commit 78041c0c9e935d9ce4086feeff6c569ed88ddfd4 upstream. The tracing seftests checks various aspects of the tracing infrastructure, and one is filtering. If trace_printk() is active during a self test, it can cause the filtering to fail, which will disable that part of the trace. To keep the selftests from failing because of trace_printk() calls, trace_printk() checks the variable tracing_selftest_running, and if set, it does not write to the tracing buffer. As some tracers were registered earlier in boot, the selftest they triggered would fail because not all the infrastructure was set up for the full selftest. Thus, some of the tests were post poned to when their infrastructure was ready (namely file system code). The postpone code did not set the tracing_seftest_running variable, and could fail if a trace_printk() was added and executed during their run. Cc: stable@vger.kernel.org Fixes: 9afecfbb95198 ("tracing: Postpone tracer start-up tests till the system is more robust") Signed-off-by: Steven Rostedt (VMware) Signed-off-by: Greg Kroah-Hartman --- kernel/trace/trace.c | 2 ++ 1 file changed, 2 insertions(+) --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -1743,6 +1743,7 @@ static __init int init_trace_selftests(v pr_info("Running postponed tracer tests:\n"); + tracing_selftest_running = true; list_for_each_entry_safe(p, n, &postponed_selftests, list) { /* This loop can take minutes when sanitizers are enabled, so * lets make sure we allow RCU processing. @@ -1765,6 +1766,7 @@ static __init int init_trace_selftests(v list_del(&p->list); kfree(p); } + tracing_selftest_running = false; out: mutex_unlock(&trace_types_lock);