Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2983339imu; Sun, 9 Dec 2018 14:16:09 -0800 (PST) X-Google-Smtp-Source: AFSGD/UT2gOWORZHFh1i3Cbq4hMqS3zRg6Vpjfzo8lxEpl+chigbD9CWJ9gE7syTQOX15BAL0AWM X-Received: by 2002:a63:ee0e:: with SMTP id e14mr8700709pgi.8.1544393769359; Sun, 09 Dec 2018 14:16:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544393769; cv=none; d=google.com; s=arc-20160816; b=agik/z3i60ZXd5vGT8ronqBrSnA7c08yVa1pM7Y1rqS+GcTSJfusQR2igpui3d4XIt JeldPEWCjckf17n1XIbb0yCR/IOI6gp2VGC34T2QiwAHr82DgJHlIRIR0JW/FYghBrUb ui2f9QNiToY4LkQTF7h2SW1q2sQF5LVUwmAVQI7PnltvfgYCmDnOMj3257ml+LMuk7B2 10nthlqDpops7cjS+2Tj5G43CadprLxqW8Y3N3A02jCqzdMPG7Tt+oXtC1vKKMHy4PP0 nOjctaoK48kEqEiL1ui8vZaxE3mO6uzB5C5DfMfr0oE1CR1A5tiRd++Khmuo7U6zU1AL phQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition; bh=Scjtxglts3PcQ4yICWxMvFF/9tpDLIDf2vsfzcbTl8Y=; b=ihsLNFHuwVVqjD7dPuALGaRAN0G51vt8M7nSl7W+3Li2rLb36rnFtk+sd4uBl6Bvmo mHbKso2vgyNDbBXDzyZJ7+FqQn3R18XdLSXq00TgRln+rZHkiz9uSBEMtjOv1QandHld xx9d0QyolUvgxh1cLkty5Dzsej3Zgii3UrMUffSntNVbkmZGZ2WI6Jh5/rg6336TM9Bc 9/rK1CQ5fpLCOC16aqWEur9b03aItvvcGD9hGnicKRfU0js2Lw3nLZYHhzXTh52w8zzD DGr+qNO2XsUy59jK1p5ljffGI/uANBcpqncZx+p2mUFXr4Yet12GD3+ka7F6yv+baRE3 BYLw== ARC-Authentication-Results: i=1; mx.google.com; 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 m35si7600761pgb.246.2018.12.09.14.15.54; Sun, 09 Dec 2018 14:16:09 -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; 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 S1728395AbeLIWNa (ORCPT + 99 others); Sun, 9 Dec 2018 17:13:30 -0500 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:37916 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726500AbeLIWN2 (ORCPT ); Sun, 9 Dec 2018 17:13:28 -0500 Received: from pub.yeoldevic.com ([81.174.156.145] helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1gW73F-0002ih-GZ; Sun, 09 Dec 2018 21:55:49 +0000 Received: from ben by deadeye with local (Exim 4.91) (envelope-from ) id 1gW72d-0003NJ-2Z; Sun, 09 Dec 2018 21:55:11 +0000 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "Oleg Nesterov" , "Steven Rostedt (VMware)" Date: Sun, 09 Dec 2018 21:50:33 +0000 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) X-Patchwork-Hint: ignore Subject: [PATCH 3.16 126/328] uprobes: Use synchronize_rcu() not synchronize_sched() In-Reply-To: X-SA-Exim-Connect-IP: 81.174.156.145 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.62-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: "Steven Rostedt (VMware)" commit 016f8ffc48cb01d1e7701649c728c5d2e737d295 upstream. While debugging another bug, I was looking at all the synchronize*() functions being used in kernel/trace, and noticed that trace_uprobes was using synchronize_sched(), with a comment to synchronize with {u,ret}_probe_trace_func(). When looking at those functions, the data is protected with "rcu_read_lock()" and not with "rcu_read_lock_sched()". This is using the wrong synchronize_*() function. Link: http://lkml.kernel.org/r/20180809160553.469e1e32@gandalf.local.home Fixes: 70ed91c6ec7f8 ("tracing/uprobes: Support ftrace_event_file base multibuffer") Acked-by: Oleg Nesterov Signed-off-by: Steven Rostedt (VMware) Signed-off-by: Ben Hutchings --- kernel/trace/trace_uprobe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/kernel/trace/trace_uprobe.c +++ b/kernel/trace/trace_uprobe.c @@ -949,7 +949,7 @@ probe_event_disable(struct trace_uprobe list_del_rcu(&link->list); /* synchronize with u{,ret}probe_trace_func */ - synchronize_sched(); + synchronize_rcu(); kfree(link); if (!list_empty(&tu->tp.files))