[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <505004021.2637.1633446912223.JavaMail.zimbra@efficios.com>
Date: Tue, 5 Oct 2021 11:15:12 -0400 (EDT)
From: Mathieu Desnoyers <mathieu.desnoyers@...icios.com>
To: rostedt <rostedt@...dmis.org>
Cc: linux-kernel <linux-kernel@...r.kernel.org>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Paul <paulmck@...ux.vnet.ibm.com>,
Josh Triplett <josh@...htriplett.org>,
Lai Jiangshan <jiangshanlai@...il.com>,
"Joel Fernandes, Google" <joel@...lfernandes.org>,
Pablo Neira Ayuso <pablo@...filter.org>,
Jozsef Kadlecsik <kadlec@...filter.org>,
Florian Westphal <fw@...len.de>,
"David S. Miller" <davem@...emloft.net>,
Hideaki YOSHIFUJI <yoshfuji@...ux-ipv6.org>,
David Ahern <dsahern@...nel.org>,
Jakub Kicinski <kuba@...nel.org>, rcu <rcu@...r.kernel.org>,
netfilter-devel <netfilter-devel@...r.kernel.org>,
coreteam@...filter.org, netdev <netdev@...r.kernel.org>
Subject: Re: [RFC][PATCH] rcu: Use typeof(p) instead of typeof(*p) *
----- On Oct 5, 2021, at 9:47 AM, rostedt rostedt@...dmis.org wrote:
[...]
> #define rcu_dereference_raw(p) \
> ({ \
> /* Dependency order vs. p above. */ \
> typeof(p) ________p1 = READ_ONCE(p); \
> - ((typeof(*p) __force __kernel *)(________p1)); \
> + ((typeof(p) __force __kernel)(________p1)); \
> })
AFAIU doing so removes validation that @p is indeed a pointer, so a user might mistakenly
try to use rcu_dereference() on an integer, and get away with it. I'm not sure we want to
loosen this check. I wonder if there might be another way to achieve the same check without
requiring the structure to be declared, e.g. with __builtin_types_compatible_p ?
Thanks,
Mathieu
--
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com
Powered by blists - more mailing lists