Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp4758796pxb; Tue, 5 Oct 2021 09:42:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwRaCB3FaP6GO/OANUoeGMl/CSGa5+znO1GPHyF7zwEpfRXrtIRyxjjkN/6GTbRYG8BHuXZ X-Received: by 2002:a17:90b:908:: with SMTP id bo8mr5007588pjb.138.1633452167884; Tue, 05 Oct 2021 09:42:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633452167; cv=none; d=google.com; s=arc-20160816; b=AqDyNOUKBw3PwIGh8EjsWAdgmOZZshfeklFOO759JxQhP18V/qqLtf9+V6x712HiXc sZnWUDgdZx5DoJbaff19QVVpbSNO4deUB0gMTUfgzzyyxkRUZehk2xhlWZn52bJF6lJN y/bxVtd1yeSGbB4J8VD9V4z8wiTvKjzYGwfGcYlGH3E7IyLcefapv2m9y2LkFdMSzDl5 9YnVi8cN9M3o3J+yag8k39V6NgcD5aRRK7QqHDrR7DCKUGIpLtqoAN63zMlfPg0/bqMR rOEdmdadP1GTVLN7H1YmWDAsO67uApLCHsdfHhV12FDH1KU3SHswXEUDtejKSz7qC5Fa Zswg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=IRQ9pAumhnbpV7P2w3qXJ4fxFrM6QOTJ6RhFhbYprLc=; b=rz8lssq4Ixk/KPc3OKSrqW5zutPPGjOny5ETaBeByPo0ueOZqGgMMBe7gbEjPRk1SX 3TzI422SgBUfTzzzAR8kBQtuFVdIxAbc1i2n7WIxhB4YFfeKC/JoT7EkdDrUz44uUw+H NmycnE0YfFCd/rx8Bc0756ZI8q+4Te6TFlzmW5w1yi2jfEC5O6mp9+f3tkl51KIDGuD7 r50s616STb9e0HjarqVXQ5qrv+aOVLOTiQqrB5SmPxKB53sFY1IRXVVh/uOjyu4XWjDf EL5NzNGbspZDPhlLsQHjiPK1rUOYXOY/ttiQHgETCJpWR9sdhDotX76m0wetnmDJIdF/ PZuw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h128si22973077pfb.155.2021.10.05.09.42.34; Tue, 05 Oct 2021 09:42:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236540AbhJEQmM (ORCPT + 99 others); Tue, 5 Oct 2021 12:42:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:41614 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233896AbhJEQmL (ORCPT ); Tue, 5 Oct 2021 12:42:11 -0400 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id F247B611C5; Tue, 5 Oct 2021 16:40:18 +0000 (UTC) Date: Tue, 5 Oct 2021 12:40:17 -0400 From: Steven Rostedt To: Mathieu Desnoyers Cc: linux-kernel , Linus Torvalds , Paul , Josh Triplett , Lai Jiangshan , "Joel Fernandes, Google" , Pablo Neira Ayuso , Jozsef Kadlecsik , Florian Westphal , "David S. Miller" , Hideaki YOSHIFUJI , David Ahern , Jakub Kicinski , rcu , netfilter-devel , coreteam , netdev Subject: Re: [RFC][PATCH] rcu: Use typeof(p) instead of typeof(*p) * Message-ID: <20211005124017.1662f3f3@gandalf.local.home> In-Reply-To: <155148572.2789.1633450504238.JavaMail.zimbra@efficios.com> References: <20211005094728.203ecef2@gandalf.local.home> <505004021.2637.1633446912223.JavaMail.zimbra@efficios.com> <20211005115817.2e1b57bd@gandalf.local.home> <155148572.2789.1633450504238.JavaMail.zimbra@efficios.com> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 5 Oct 2021 12:15:04 -0400 (EDT) Mathieu Desnoyers wrote: > See Documentation/RCU/arrayRCU.rst: > > "It might be tempting to consider use > of RCU to instead protect the index into an array, however, this use Ah, array indexes. Now that makes sense. > case is **not** supported. The problem with RCU-protected indexes into > arrays is that compilers can play way too many optimization games with > integers, which means that the rules governing handling of these indexes > are far more trouble than they are worth. If RCU-protected indexes into > arrays prove to be particularly valuable (which they have not thus far), > explicit cooperation from the compiler will be required to permit them > to be safely used." > > So AFAIU validation that rcu_dereference receives a pointer as parameter > is done on purpose. Thanks for looking at this. I'll go punt and just expose the structure. It's not a big deal, but I like abstraction of structures when they can be, just to keep from the temptation of tweaking them directly, and causing updates later to be more difficult. Too bad that the failure here is not RCU or the macros, but what I would call a bug in a specific compiler. -- Steve