Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2325253imm; Fri, 7 Sep 2018 14:41:57 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaESulmbkD/FxDUrFeZynmvBsDAOE3RxZI5eFuepPVMXEqS/yAuWWMDeUs7fpO3Apw/g3Ua X-Received: by 2002:a17:902:6f10:: with SMTP id w16-v6mr9891061plk.216.1536356517265; Fri, 07 Sep 2018 14:41:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536356517; cv=none; d=google.com; s=arc-20160816; b=TWoYNO5ksGb+aZ0z5Q9KFMDqjA4PEGylQXa+uwy3RlV66Sk1lWPAi3Wig0IpT+VIVF Szx5H3aMj0wqQOCInaXI2M24H/YnucVTyyx64MDRMdj82DKiAf23buHTa8DmM/VIn5Hs YlMmpCZ4PsvPvH5T4n+YFk1LKZKzY0pPALMm0TGrOXgIjN9LNMaguRHF6YcxCbmzJtyG y9EifUPYQxKCorsuZkfbDmxLDMlwF+SbOMBzLWM0fNSCxTk09UM4NlqNwHw6ro5npzU9 8XZ6B2d0fcTdX6MA5BUGUOVGUTjo3okJoSv8Rd1vEX6tDGhcF+IxmSdD1rM3NnBU7xqg dizw== 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=Aip6Un4UsIrOJ6WpSlMqFdQuX5JdHLgmlkia0jlUcn4=; b=UtQNo4+aui8IkRR0PmfEs+CufD1HqJU4NLHADVjORf6szRc2B/NeQ3ynIvSLU9JNvK p5y6PDMo7cyQ6udR2q/A9ggLQMf6UxueRtnVkmn4ApqgYfTfK7Y8sUJNNKJVuytfzqW3 dUyoOk3TJORp0oRSRKi0vyKTC6gyLQHxwXFQDGLSzt2N4KFucju4dEf+W1G19c30zqcQ pEOR7Ma9U6yh8uN9rt6S5dIeIbyS5dA4wr3wV5gVfRaeBlTaKxYv44SJ08VXJm2t5fUv sHvBeEsJwyePJ4+ibR0kjTrdKWqpirbRgi21J5BVsEHdFs/VsEQfrhDtVYTkG4S0agq/ KU4A== 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 l3-v6si9219970pld.501.2018.09.07.14.41.42; Fri, 07 Sep 2018 14:41:57 -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 S1730119AbeIHCXL (ORCPT + 99 others); Fri, 7 Sep 2018 22:23:11 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:54376 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728505AbeIHCXK (ORCPT ); Fri, 7 Sep 2018 22:23:10 -0400 Received: from localhost (ip-213-127-74-90.ip.prioritytelecom.net [213.127.74.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id BA1DDFEF; Fri, 7 Sep 2018 21:40:15 +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 4.4 24/47] uprobes: Use synchronize_rcu() not synchronize_sched() Date: Fri, 7 Sep 2018 23:10:20 +0200 Message-Id: <20180907210907.327312282@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180907210904.607934824@linuxfoundation.org> References: <20180907210904.607934824@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 4.4-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 @@ -969,7 +969,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))