From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.4 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6F19DC742A4 for ; Thu, 11 Jul 2019 23:52:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 44FEC214AF for ; Thu, 11 Jul 2019 23:52:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=joelfernandes.org header.i=@joelfernandes.org header.b="CxBe3d8Z" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729036AbfGKXwm (ORCPT ); Thu, 11 Jul 2019 19:52:42 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:34679 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728757AbfGKXwm (ORCPT ); Thu, 11 Jul 2019 19:52:42 -0400 Received: by mail-pf1-f195.google.com with SMTP id b13so3478042pfo.1 for ; Thu, 11 Jul 2019 16:52:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=vzPJBuv0k8P0t8Fk03qEA7CPumyNmMWBbrpcTz+B5LE=; b=CxBe3d8Zwlq5eL/iHH4cKObNrwN70wlF8xtsD1I9rfzWGpI08HFrr4wIWB2T69jow5 b2lv6BT26WXPLNNrt1kHYxqidntzBEQOohmGQyo0s/zVMREIMGcPNNnH2ajWazjZ27tN P6OQ0nVIq6uS31nbqOg1g6gOYFDBjP6C+Y7qQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=vzPJBuv0k8P0t8Fk03qEA7CPumyNmMWBbrpcTz+B5LE=; b=Wrac1di5077cmfDx1qnoY0pPCIm7UE1lVldoHKhxnH0gNqrJMRdrdFNIPk5DZ0ehaa rT21bskxWQ1GGYLLhw6bLX7Ip+RoJA0/fbRuibq/nSPPxlvrh/GHOFvMqMSK/NbYJVh2 lbTIWuHgbshtkQ3Xox2X+SqjvyNBvrhM6bQxebErhOmIrgaivizdiAC3AIO5OBshmJZ9 Xu8Ub1zaIJN1SxkydIHqfYg/zf33BWUjgF1dkDv7Sr7RQsjldbn5sAWn8OECEKZDCyLI Gk2xj1uTFOCoH/kdX44ETpSHzjdhUrv24TooRIVPHregcMH3a0zxS6GHtd4cWzKthPwI ZVig== X-Gm-Message-State: APjAAAVMBTTvWy65lqO/sUDPyLzYMZDu3Dz5ylaV2attk4Fmvo2+P7LV 3csUyKisHeR5VsuVrY7OjTU= X-Google-Smtp-Source: APXvYqwIJ+xh/ZMSwOrZyW9D85A/Q5tV1WJbBUxRCaU5JBaWiRNgZb7BBjzCKyyOKdbk76jwZnPfNQ== X-Received: by 2002:a63:d950:: with SMTP id e16mr7508053pgj.271.1562889161442; Thu, 11 Jul 2019 16:52:41 -0700 (PDT) Received: from localhost ([2620:15c:6:12:9c46:e0da:efbf:69cc]) by smtp.gmail.com with ESMTPSA id q69sm8518053pjb.0.2019.07.11.16.52.40 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 11 Jul 2019 16:52:40 -0700 (PDT) Date: Thu, 11 Jul 2019 19:52:39 -0400 From: Joel Fernandes To: linux-kernel@vger.kernel.org Cc: Alexey Kuznetsov , Bjorn Helgaas , Borislav Petkov , c0d1n61at3@gmail.com, "David S. Miller" , edumazet@google.com, Greg Kroah-Hartman , Hideaki YOSHIFUJI , "H. Peter Anvin" , Ingo Molnar , Josh Triplett , keescook@chromium.org, kernel-hardening@lists.openwall.com, Lai Jiangshan , Len Brown , linux-acpi@vger.kernel.org, linux-pci@vger.kernel.org, linux-pm@vger.kernel.org, Mathieu Desnoyers , neilb@suse.com, netdev@vger.kernel.org, oleg@redhat.com, "Paul E. McKenney" , Pavel Machek , peterz@infradead.org, "Rafael J. Wysocki" , Rasmus Villemoes , rcu@vger.kernel.org, Steven Rostedt , Tejun Heo , Thomas Gleixner , will@kernel.org, "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" Subject: Re: [PATCH v1 0/6] Harden list_for_each_entry_rcu() and family Message-ID: <20190711235239.GA221389@google.com> References: <20190711234401.220336-1-joel@joelfernandes.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190711234401.220336-1-joel@joelfernandes.org> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org On Thu, Jul 11, 2019 at 07:43:55PM -0400, Joel Fernandes (Google) wrote: > Hi, > This series aims to provide lockdep checking to RCU list macros. > > RCU has a number of primitives for "consumption" of an RCU protected pointer. > Most of the time, these consumers make sure that such accesses are under a RCU > reader-section (such as rcu_dereference{,sched,bh} or under a lock, such as > with rcu_dereference_protected()). > > However, there are other ways to consume RCU pointers, such as by > list_for_each_entry_rcu or hlist_for_each_enry_rcu. Unlike the rcu_dereference > family, these consumers do no lockdep checking at all. And with the growing > number of RCU list uses (1000+), it is possible for bugs to creep in and go > unnoticed which lockdep checks can catch. I forgot to add in my cover letter, I have kept this option default-disabled under a new config: CONFIG_PROVE_RCU_LIST. This is so that until all users are converted to pass the optional argument, we should keep the check disabled. There are about a 1000 or so users and it is not possible to pass in the optional lockdep expression in a single series since it is done on a case-by-case basis. I did convert a few users in this series itself. Also, I plans to update the RCU documentation as well which I will do, but do review this series and thank you!