Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2327767imm; Fri, 7 Sep 2018 14:44:45 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYo4Ji+8SsahLeVD/58Wria1bV0XrFEVZAMPXuvwQWSHI4NHRmPsTNb95ujbFGVT5bkEb0B X-Received: by 2002:a63:b44c:: with SMTP id n12-v6mr10382953pgu.337.1536356685469; Fri, 07 Sep 2018 14:44:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536356685; cv=none; d=google.com; s=arc-20160816; b=Z7CUcNA8fOkFBfKFvTih2DcZOekMS9Rve4VNC7tfcwO0Fkt69EawvsB/obNPdGz/C9 nDFDyNKSzclqqnPXkIqN++brIk56osEvfwmor8WlS8NdM1KDXOMsEMJipf+Se0x9+Fqp jRnJD3No0h17B8bzCmvefgM1CHU74obCLtNjKdnF6cMPzdwpqJT0Nh7bIqpSRWnoDgfa GaoRMvb41+u0rRitQpzD+rGljdNi5joBb6kx+znwpZuO8UZdWLfTWAAQYJSNvNIv3wmj Iyr9LZ4iXLmIeFlUhCyK/QrsL9Aqw6qMMY+NADBlJDAt8j6OPGlhoNQcILKa44sKJAiW EcEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from; bh=63o152N3gCzCTf0OG6MeNgYjGsddbACaKNQAL/HwzcY=; b=OcnkJWwaEmSGqSnHa1yAhncKtIUU9LvSw1AbW44Ew+H8Mkbw8nKMdAxn8ybpTtaRyD Qk3frRbivK7H1Ydv5O5ARTJOIFGNEaWE6VMQn+cT0OqmnpQcgHGqS2hfCQVHo861PS68 x3sGKVEDf8hZWFoZwf+HVE5ExvkcyPEahdVkHe5wcZPTAT6M2O4QhS93qnapOr8t1vpF AV3PSVTgrq3CsH0Rk8EIBDhKL3OX4ymhjHbmso/yPVJXGTIAWfzcXb0dn6ifQDKJa1sI 18ISgmiZXcok7R4qhXdICYbzgmly515PWxY3KLCVx2qpDgPyYkpWPY6wE6aUL7LEaoV6 SDkA== 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 c1-v6si9835545pli.497.2018.09.07.14.44.30; Fri, 07 Sep 2018 14:44:45 -0700 (PDT) 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 S1730800AbeIHC0C (ORCPT + 99 others); Fri, 7 Sep 2018 22:26:02 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:56844 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729910AbeIHC0A (ORCPT ); Fri, 7 Sep 2018 22:26:00 -0400 Received: from localhost (ip-213-127-74-90.ip.prioritytelecom.net [213.127.74.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 3CF57BBF; Fri, 7 Sep 2018 21:43:05 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Oleg Nesterov , "Steven Rostedt (VMware)" Subject: [PATCH 3.18 13/29] uprobes: Use synchronize_rcu() not synchronize_sched() Date: Fri, 7 Sep 2018 23:10:34 +0200 Message-Id: <20180907210910.514585931@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180907210909.523240901@linuxfoundation.org> References: <20180907210909.523240901@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.18-stable 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 Cc: stable@vger.kernel.org Fixes: 70ed91c6ec7f8 ("tracing/uprobes: Support ftrace_event_file base multibuffer") Acked-by: Oleg Nesterov Signed-off-by: Steven Rostedt (VMware) Signed-off-by: Greg Kroah-Hartman --- 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 @@ -957,7 +957,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))