Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp163123ybi; Thu, 11 Jul 2019 16:54:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqz+w3HjdG6OAxMaI4vCAXzyfXzMqbWVcd1fmeIrMcxbQ9+Xd1vP+YgqA5qTEtML9E0zgJ1y X-Received: by 2002:a63:1b66:: with SMTP id b38mr7200092pgm.54.1562889244905; Thu, 11 Jul 2019 16:54:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562889244; cv=none; d=google.com; s=arc-20160816; b=TJPQ3/NcK0UY0/itAiRRR2JE5XGcYPq0tyWA+fruIALarq2CH7wej6YuU3hhIeaJOH +HHJFovD34NoSe2jUfKd5UKc8g/Gt859ganIvjdkwXqswlS9IykRFlehc1tGrrFAnH3A soLfLPvF54T03YM7tg/TJd35onV9i8YA8E1+rqxTyHiCA1AF6iuNLdmCxLIQbFqxC8sP E/4jDjfctPTH78y0Zk/X8fRvv7SDg3bp1L1AczTxgj9mvCB+dsa1aDcONqwUmQPdGP5I n3eaXiq4zDjjKSPHfTIlq+Bmc8MfjVv8A0TAj/1JY7StpNJoTTMY24VjlV2nceXSb9Lr 0d3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=vzPJBuv0k8P0t8Fk03qEA7CPumyNmMWBbrpcTz+B5LE=; b=DvDibqaPDyhjkQbRKs3VeUrdL2Od6/3T16oVbtpxhtiUH2oA0bJ9syDjVMi83Fl9nZ uJFkvCoUT6RgVcm2EiKJaCTdx7yxgfR9Xk2Tdxv58MUVvT//trvaHZoW0ageiUaiF7qw bHBwchJ6ATkmwkqlQ+3Gdezj1jw2HCcH0X6fpj23NUHSxHq3WwK1bLtqPIt4fBkS8QXf x1OmxLR8tfoAJ+h2YDr/2mpIfTXbw8IMFYDO0gviqBIkgfntPsx1qF1jxUwVaA4TVlcE lLw4l3bcVej6VfNy7mPFWRgR7zDg2lQ2Xu0wRjyr4wepOp98PHAYhXBpU8Z8C+3dMEjd OjUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=CxBe3d8Z; 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 v10si6331790plg.320.2019.07.11.16.53.48; Thu, 11 Jul 2019 16:54:04 -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; dkim=pass header.i=@joelfernandes.org header.s=google header.b=CxBe3d8Z; 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 S1729502AbfGKXwo (ORCPT + 99 others); Thu, 11 Jul 2019 19:52:44 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:33749 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728985AbfGKXwn (ORCPT ); Thu, 11 Jul 2019 19:52:43 -0400 Received: by mail-pf1-f196.google.com with SMTP id g2so3481311pfq.0 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=tqaP0YW5H9smfCbG4xA6nAEwOJfRHvfaMA8VPfNSubRp/bo1wiYCtq3FfBkKWDFC9a rin1qxr0GK7t9eDmRuvHmOF8dnILbrOeSmv9V+cfV4O3NprfLxxBjV6ogFtsV61anHKU fWLoKzQn6V/50AXCZwIDaLy8uZXZy3V0F2HveJSjAILklOqv72tqDfU/5pAcqBbHBPeY 33JhimpSo+4YrqHk6YaWubJ8zxHJQ2FWyVrOo3t1tUyeFbZELO5Fhwd1AuTWcefzlHKu WsWo9mT+0V3BsYxCnOHpHIgQF0Jlili6F+AfyBY1NXnrofG3NLTGaSCiCypHUVt895FF QNnQ== X-Gm-Message-State: APjAAAUBOrbGv2TLsP4NEWmu+9xAt9uHtemfq46b8vZfMUlMxMUMYfLb 71INTgNhWfnVaNqwp4APu9Ha7Kl+ 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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!