net: Fix race of rtnl_net_lock(dev_net(dev)).
Subsystems (2)
v3 cover net: Fix race of rtnl_net_lock(dev_net(dev)).
Yael Chemla reported that commit 7fb1073300a2 ("net: Hold rtnl_net_lock() in (un)?register_netdevice_notifier_dev_net().") started to trigger KASAN's use-after-free splat.
The problem is that dev_net(dev) fetched before rtnl_net_lock() might be different after rtnl_net_lock().
The patch 1 fixes the issue by checking dev_net(dev) after rtnl_net_lock(), and the patch 2 fixes the same potential issue that would emerge once RTNL is removed.
Changes:
v3:
* Bump net->passive instead of maybe_get_net()
* Remove msleep(1) loop
* Use rcu_access_pointer() instead of rcu_read_lock().
v2:
* Use dev_net_rcu()
* Use msleep(1) instead of cond_resched() after maybe_get_net()
* Remove cond_resched() after net_eq() check
v1: https://lore.kernel.org/netdev/[email protected]/
Kuniyuki Iwashima (2):
net: Fix dev_net(dev) race in unregister_netdevice_notifier_dev_net().
dev: Use rtnl_net_dev_lock() in unregister_netdev().
net/core/dev.c | 47 +++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 39 insertions(+), 8 deletions(-)
Signature · 1 line
2.39.5 (Apple Git-154)
PATCH v3 1/2 net: Fix dev_net(dev) race in unregister_netdevice_notifier_dev_net().
After the cited commit, dev_net(dev) is fetched before holding RTNL and passed to __unregister_netdevice_notifier_net().
However, dev_net(dev) might be different after holding RTNL.
In the reported case [0], while removing a VF device, its netns was being dismantled and the VF was moved to init_net.
So the following sequence is basically illegal when dev was fetched without lookup:
net = dev_net(dev); rtnl_net_lock(net);
Let's use a new helper rtnl_net_dev_lock() to fix the race.
It fetches dev_net_rcu(dev), bumps its net->passive, and checks if dev_net_rcu(dev) is changed after rtnl_net_lock().
[0]:
BUG: KASAN: slab-use-after-free in notifier_call_chain (kernel/notifier.c:75 (discriminator 2)) Read of size 8 at addr ffff88810cefb4c8 by task test-bridge-lag/21127 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.13.0-0-gf21b5a4aeb02-prebuilt.qemu.org 04/01/2014 Call Trace: <TASK> dump_stack_lvl (lib/dump_stack.c:123) print_report (mm/kasan/report.c:379 mm/kasan/report.c:489) kasan_report (mm/kasan/report.c:604) notifier_call_chain (kernel/notifier.c:75 (discriminator 2)) call_netdevice_notifiers_info (net/core/dev.c:2011) unregister_netdevice_many_notify (net/core/dev.c:11551) unregister_netdevice_queue (net/core/dev.c:11487) unregister_netdev (net/core/dev.c:11635) mlx5e_remove (drivers/net/ethernet/mellanox/mlx5/core/en_main.c:6552 drivers/net/ethernet/mellanox/mlx5/core/en_main.c:6579) mlx5_core auxiliary_bus_remove (drivers/base/auxiliary.c:230) device_release_driver_internal (drivers/base/dd.c:1275 drivers/base/dd.c:1296) bus_remove_device (./include/linux/kobject.h:193 drivers/base/base.h:73 drivers/base/bus.c:583) device_del (drivers/base/power/power.h:142 drivers/base/core.c:3855) mlx5_rescan_drivers_locked (./include/linux/auxiliary_bus.h:241 drivers/net/ethernet/mellanox/mlx5/core/dev.c:333 drivers/net/ethernet/mellanox/mlx5/core/dev.c:535 drivers/net/ethernet/mellanox/mlx5/core/dev.c:549) mlx5_core mlx5_unregister_device (drivers/net/ethernet/mellanox/mlx5/core/dev.c:468) mlx5_core mlx5_uninit_one (./include/linux/instrumented.h:68 ./include/asm-generic/bitops/instrumented-non-atomic.h:141 drivers/net/ethernet/mellanox/mlx5/core/main.c:1563) mlx5_core remove_one (drivers/net/ethernet/mellanox/mlx5/core/main.c:965 drivers/net/ethernet/mellanox/mlx5/core/main.c:2019) mlx5_core pci_device_remove (./include/linux/pm_runtime.h:129 drivers/pci/pci-driver.c:475) device_release_driver_internal (drivers/base/dd.c:1275 drivers/base/dd.c:1296) unbind_store (drivers/base/bus.c:245) kernfs_fop_write_iter (fs/kernfs/file.c:338) vfs_write (fs/read_write.c:587 (discriminator 1) fs/read_write.c:679 (discriminator 1)) ksys_write (fs/read_write.c:732) do_syscall_64 (arch/x86/entry/common.c:52 (discriminator 1) arch/x86/entry/common.c:83 (discriminator 1)) entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:130) RIP: 0033:0x7f6a4d5018b7
---
v3:
* Bump net->passive instead of maybe_get_net()
* Remove msleep(1) loop
* Use rcu_access_pointer() instead of rcu_read_lock().
v2:
* Use dev_net_rcu().
* Use msleep(1) instead of cond_resched() after maybe_get_net()
* Remove cond_resched() after net_eq() check
v1: https://lore.kernel.org/netdev/[email protected]/
--- net/core/dev.c | 41 +++++++++++++++++++++++++++++++++++++---- 1 file changed, 37 insertions(+), 4 deletions(-)
net/core/dev.c +37 -4
@@ -2070,6 +2070,35 @@ static void __move_netdevice_notifier_net(struct net *src_net,__register_netdevice_notifier_net (dst_net, nb, true); } +static void rtnl_net_dev_lock (struct net_device *dev) +{ +struct net *net; + +again: +/* netns might be being dismantled. */ +rcu_read_lock (); + net =dev_net_rcu (dev); +refcount_inc (&net->passive); +rcu_read_unlock (); + +rtnl_net_lock (net); + +/* dev might have been moved to another netns. */ +if (!net_eq (net,rcu_access_pointer (dev->nd_net.net))) { +rtnl_net_unlock (net); +net_drop_ns (net); + goto again; + } +} + +static void rtnl_net_dev_unlock (struct net_device *dev) +{ +struct net *net =dev_net (dev); + +rtnl_net_unlock (net); +net_drop_ns (net); +} +int register_netdevice_notifier_dev_net (struct net_device *dev,struct notifier_block *nb,struct netdev_net_notifier *nn)
@@ -2077,6 +2106,11 @@ int register_netdevice_notifier_dev_net(struct net_device *dev,struct net *net =dev_net (dev);int err; +/* rtnl_net_lock() assumes dev is not yet published by +* register_netdevice(). +*/ +DEBUG_NET_WARN_ON_ONCE (!list_empty (&dev->dev_list)); +rtnl_net_lock (net); err =__register_netdevice_notifier_net (net, nb, false);if (!err) {
@@ -2093,13 +2127,12 @@ int unregister_netdevice_notifier_dev_net(struct net_device *dev,struct notifier_block *nb, struct netdev_net_notifier *nn) { - struct net *net = dev_net(dev); int err; -rtnl_net_lock (net); +rtnl_net_dev_lock (dev);list_del (&nn->list); - err =__unregister_netdevice_notifier_net (net, nb); -rtnl_net_unlock (net); + err =__unregister_netdevice_notifier_net (dev_net (dev), nb); +rtnl_net_dev_unlock (dev);return err; }
Signature · 1 line
2.39.5 (Apple Git-154)
Re: [PATCH v3 net 1/2] net: Fix dev_net(dev) race in unregister_netdevice_notifier_dev_net().
Quoted 47 lines · Kuniyuki Iwashima
After the cited commit,
dev_net(dev)is fetched before holding RTNL and passed to__unregister_netdevice_notifier_net().However,
dev_net(dev)might be different after holding RTNL.In the reported case [0], while removing a VF device, its netns was being dismantled and the VF was moved to
init_net.So the following sequence is basically illegal when dev was fetched without lookup:
net = dev_net(dev); rtnl_net_lock(net);Let's use a new helper
rtnl_net_dev_lock()to fix the race.It fetches
dev_net_rcu(dev), bumps itsnet->passive, and checks ifdev_net_rcu(dev)is changed afterrtnl_net_lock().Fixes 7fb1073300a2 ("net: Hold rtnl_net_lock() in (un)?register_netdevice_notifier_dev_net().")Reported-by Yael Chemla <[email protected]>Signed-off-by Kuniyuki Iwashima <[email protected]>---
v3:
* Bumpnet->passiveinstead ofmaybe_get_net()
* Remove msleep(1) loop
* Usercu_access_pointer()instead ofrcu_read_lock().v2:
* Usedev_net_rcu().
* Use msleep(1) instead ofcond_resched()aftermaybe_get_net()
* Removecond_resched()afternet_eq()checkv1: https://lore.kernel.org/netdev/[email protected]/
--- net/core/dev.c | 41 +++++++++++++++++++++++++++++++++++++---- 1 file changed, 37 insertions(+), 4 deletions(-)net/core/dev.c +0
-0
net/core/dev.c static void __move_netdevice_notifier_net(struct net *src_net, · line 2076
Quoted 7 lines
net/core/dev.c +4
-0@@ -2070,6 +2070,35 @@ static void __move_netdevice_notifier_net(struct net *src_net,__register_netdevice_notifier_net (dst_net, nb, true); } +static void rtnl_net_dev_lock (struct net_device *dev) +{ +struct net *net; +
#ifdef CONFIG_NET_NS
net/core/dev.c static void __move_netdevice_notifier_net(struct net *src_net, · line 2077
Quoted 1 line
net/core/dev.c +1
-0+again:
#endif
net/core/dev.c static void __move_netdevice_notifier_net(struct net *src_net, · line 2085
Quoted 8 lines
net/core/dev.c +8
-0+/* netns might be being dismantled. */ +rcu_read_lock (); + net =dev_net_rcu (dev); +refcount_inc (&net->passive); +rcu_read_unlock (); + +rtnl_net_lock (net); +
#ifdef CONFIG_NET_NS
net/core/dev.c static void __move_netdevice_notifier_net(struct net *src_net, · line 2091
Quoted 6 lines
net/core/dev.c +6
-0+/* dev might have been moved to another netns. */ +if (!net_eq (net,rcu_access_pointer (dev->nd_net.net))) { +rtnl_net_unlock (net); +net_drop_ns (net); + goto again; + }
#endif
Or perhaps not use net_drop_ns() and rename/export net_free() to net_passive_dec() ?
include/net/net_namespace.h +0 -0
100644
include/net/net_namespace.h +6 -1
@@ -297,7 +297,7 @@ static inline int check_net(const struct net *net) }void net_drop_ns (void *); - +void net_passive_dec (struct net *net);#else static inline struct net *get_net (struct net *net)
@@ -326,6 +326,11 @@ static inline int check_net(const struct net *net) }#define net_drop_ns NULL +static inline void net_passive_dec (struct net *net) +{ +refcount_dec (&net->passive); +} +#endif /* Returns true if the netns initialization is completed successfully */
net/core/net_namespace.c +0 -0
100644
net/core/net_namespace.c +4 -4
@@ -464,7 +464,7 @@ static void net_complete_free(void) } -static void net_free (struct net *net) +void net_passive_dec (struct net *net) {if (refcount_dec_and_test (&net->passive)) {kfree (rcu_access_pointer (net->gen));
@@ -482,7 +482,7 @@ void net_drop_ns(void *p)struct net *net = (struct net *)p;if (net) -net_free (net); +net_passive_dec (net); } struct net *copy_net_ns(unsigned long flags,
@@ -523,7 +523,7 @@ struct net *copy_net_ns(unsigned long flags,key_remove_domain (net->key_domain);#endif put_user_ns (user_ns); -net_free (net); +net_passive_dec (net); dec_ucounts:dec_net_namespaces (ucounts);return ERR_PTR (rv);
@@ -672,7 +672,7 @@ static void cleanup_net(struct work_struct *work)key_remove_domain (net->key_domain);#endif put_user_ns (net->user_ns); -net_free (net); +net_passive_dec (net); } cleanup_net_task =NULL ; }
Re: [PATCH v3 net 1/2] net: Fix dev_net(dev) race in unregister_netdevice_notifier_dev_net().
From: Eric Dumazet <[email protected]>
Date: Tue, 11 Feb 2025 10:43:30 +0100
Quoted 78 lines · Kuniyuki Iwashima
Quoted 47 lines
After the cited commit,
dev_net(dev)is fetched before holding RTNL and passed to__unregister_netdevice_notifier_net().However,
dev_net(dev)might be different after holding RTNL.In the reported case [0], while removing a VF device, its netns was being dismantled and the VF was moved to
init_net.So the following sequence is basically illegal when dev was fetched without lookup:
net = dev_net(dev); rtnl_net_lock(net);Let's use a new helper
rtnl_net_dev_lock()to fix the race.It fetches
dev_net_rcu(dev), bumps itsnet->passive, and checks ifdev_net_rcu(dev)is changed afterrtnl_net_lock().Fixes 7fb1073300a2 ("net: Hold rtnl_net_lock() in (un)?register_netdevice_notifier_dev_net().")Reported-by Yael Chemla <[email protected]>Signed-off-by Kuniyuki Iwashima <[email protected]>---
v3:
* Bumpnet->passiveinstead ofmaybe_get_net()
* Remove msleep(1) loop
* Usercu_access_pointer()instead ofrcu_read_lock().v2:
* Usedev_net_rcu().
* Use msleep(1) instead ofcond_resched()aftermaybe_get_net()
* Removecond_resched()afternet_eq()checkv1: https://lore.kernel.org/netdev/[email protected]/
--- net/core/dev.c | 41 +++++++++++++++++++++++++++++++++++++---- 1 file changed, 37 insertions(+), 4 deletions(-)net/core/dev.c +0
-0net/core/dev.c static void __move_netdevice_notifier_net(struct net *src_net, · line 2076
Quoted 7 lines
net/core/dev.c +4
-0@@ -2070,6 +2070,35 @@ static void __move_netdevice_notifier_net(struct net *src_net,__register_netdevice_notifier_net (dst_net, nb, true); } +static void rtnl_net_dev_lock (struct net_device *dev) +{ +struct net *net; +#ifdef
CONFIG_NET_NSnet/core/dev.c static void __move_netdevice_notifier_net(struct net *src_net, · line 2077
Quoted 1 line
net/core/dev.c +1
-0+again:#endif
net/core/dev.c static void __move_netdevice_notifier_net(struct net *src_net, · line 2085
Quoted 8 lines
net/core/dev.c +8
-0+/* netns might be being dismantled. */ +rcu_read_lock (); + net =dev_net_rcu (dev); +refcount_inc (&net->passive); +rcu_read_unlock (); + +rtnl_net_lock (net); +#ifdef
CONFIG_NET_NSnet/core/dev.c static void __move_netdevice_notifier_net(struct net *src_net, · line 2091
Quoted 6 lines
net/core/dev.c +6
-0+/* dev might have been moved to another netns. */ +if (!net_eq (net,rcu_access_pointer (dev->nd_net.net))) { +rtnl_net_unlock (net); +net_drop_ns (net); + goto again; + }
Quoted 4 lines
#endif
Or perhaps not use
net_drop_ns()and rename/exportnet_free()tonet_passive_dec()?
Ah, we need both guard (for dev->nd_net.net) and net_passive_dec().
Or, we can simply rtnl_net_lock(&init_net) for !CONFIG_NET_NS and keep net_drop_ns().
The former looked cleaner, so I'll do so in v4.
Thanks!
Quoted 69 lines
include/net/net_namespace.h +0
-0100644
include/net/net_namespace.h +6
-1@@ -297,7 +297,7 @@ static inline int check_net(const struct net *net) }void net_drop_ns (void *); - +void net_passive_dec (struct net *net);#else static inline struct net *get_net (struct net *net)@@ -326,6 +326,11 @@ static inline int check_net(const struct net *net) }#define net_drop_ns NULL +static inline void net_passive_dec (struct net *net) +{ +refcount_dec (&net->passive); +} +#endif /* Returns true if the netns initialization is completed successfully */ net/core/net_namespace.c +0
-0100644
net/core/net_namespace.c +4
-4@@ -464,7 +464,7 @@ static void net_complete_free(void) } -static void net_free (struct net *net) +void net_passive_dec (struct net *net) {if (refcount_dec_and_test (&net->passive)) {kfree (rcu_access_pointer (net->gen));@@ -482,7 +482,7 @@ void net_drop_ns(void *p)struct net *net = (struct net *)p;if (net) -net_free (net); +net_passive_dec (net); } struct net *copy_net_ns(unsigned long flags,@@ -523,7 +523,7 @@ struct net *copy_net_ns(unsigned long flags,key_remove_domain (net->key_domain);#endif put_user_ns (user_ns); -net_free (net); +net_passive_dec (net); dec_ucounts:dec_net_namespaces (ucounts);return ERR_PTR (rv);@@ -672,7 +672,7 @@ static void cleanup_net(struct work_struct *work)key_remove_domain (net->key_domain);#endif put_user_ns (net->user_ns); -net_free (net); +net_passive_dec (net); } cleanup_net_task =NULL ; }
kernel test robot
build botRe: [PATCH v3 net 1/2] net: Fix dev_net(dev) race in unregister_netdevice_notifier_dev_net().
In reply to Kuniyuki Iwashimakernel test robot noticed the following build errors:
Hi Kuniyuki,
kernel test robot noticed the following build errors:
[auto build test ERROR on net/main]
url: https://github.com/intel-lab-lkp/linux/commits/Kuniyuki-Iwashima/net-Fix-dev_net-dev-race-in-unregister_netdevice_notifier_dev_net/20250211-131633 base: net/main patch link: https://lore.kernel.org/r/20250211051217.12613-2-kuniyu%40amazon.com patch subject: [PATCH v3 net 1/2] net: Fix dev_net(dev) race in unregister_netdevice_notifier_dev_net(). config: sparc64-randconfig-001-20250212 (https://download.01.org/0day-ci/archive/20250212/[email protected]/config) compiler: sparc64-linux-gcc (GCC) 14.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250212/[email protected]/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
All errors (new ones prefixed by >>):
In file included from include/linux/instrumented.h:10,
from include/linux/uaccess.h:6,
from net/core/dev.c:71:
net/core/dev.c: In function 'rtnl_net_dev_lock':
>> net/core/dev.c:2087:56: error: 'possible_net_t' has no member named 'net'
2087 | if (!net_eq(net, rcu_access_pointer(dev->nd_net.net))) {
| ^
include/linux/compiler.h:57:52: note: in definition of macro '__trace_if_var'
57 | #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
| ^~~~
net/core/dev.c:2087:9: note: in expansion of macro 'if'
2087 | if (!net_eq(net, rcu_access_pointer(dev->nd_net.net))) {
| ^~
include/linux/rcupdate.h:650:31: note: in expansion of macro '__rcu_access_pointer'
650 | #define rcu_access_pointer(p) __rcu_access_pointer((p), __UNIQUE_ID(rcu), __rcu)
| ^~~~~~~~~~~~~~~~~~~~
net/core/dev.c:2087:26: note: in expansion of macro 'rcu_access_pointer'
2087 | if (!net_eq(net, rcu_access_pointer(dev->nd_net.net))) {
| ^~~~~~~~~~~~~~~~~~
>> net/core/dev.c:2087:56: error: 'possible_net_t' has no member named 'net'
2087 | if (!net_eq(net, rcu_access_pointer(dev->nd_net.net))) {
| ^
include/linux/compiler.h:57:52: note: in definition of macro '__trace_if_var'
57 | #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
| ^~~~
net/core/dev.c:2087:9: note: in expansion of macro 'if'
2087 | if (!net_eq(net, rcu_access_pointer(dev->nd_net.net))) {
| ^~
include/linux/rcupdate.h:650:31: note: in expansion of macro '__rcu_access_pointer'
650 | #define rcu_access_pointer(p) __rcu_access_pointer((p), __UNIQUE_ID(rcu), __rcu)
| ^~~~~~~~~~~~~~~~~~~~
net/core/dev.c:2087:26: note: in expansion of macro 'rcu_access_pointer'
2087 | if (!net_eq(net, rcu_access_pointer(dev->nd_net.net))) {
| ^~~~~~~~~~~~~~~~~~
>> net/core/dev.c:2087:56: error: 'possible_net_t' has no member named 'net'
2087 | if (!net_eq(net, rcu_access_pointer(dev->nd_net.net))) {
| ^
include/linux/compiler.h:57:52: note: in definition of macro '__trace_if_var'
57 | #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
| ^~~~
net/core/dev.c:2087:9: note: in expansion of macro 'if'
2087 | if (!net_eq(net, rcu_access_pointer(dev->nd_net.net))) {
| ^~
include/linux/compiler.h:55:28: note: in expansion of macro '__trace_if_var'
55 | #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
| ^~~~~~~~~~~~~~
include/linux/compiler_types.h:522:17: note: in expansion of macro 'if'
522 | if (!(condition)) \
| ^~
include/linux/compiler_types.h:530:9: note: in expansion of macro '__compiletime_assert'
530 | __compiletime_assert(condition, msg, prefix, suffix)
| ^~~~~~~~~~~~~~~~~~~~
include/linux/compiler_types.h:542:9: note: in expansion of macro '_compiletime_assert'
542 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:36:9: note: in expansion of macro 'compiletime_assert'
36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
| ^~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:36:28: note: in expansion of macro '__native_word'
36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
| ^~~~~~~~~~~~~
include/asm-generic/rwonce.h:49:9: note: in expansion of macro 'compiletime_assert_rwonce_type'
49 | compiletime_assert_rwonce_type(x); \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/rcupdate.h:531:50: note: in expansion of macro 'READ_ONCE'
531 | typeof(*p) *local = (typeof(*p) *__force)READ_ONCE(p); \
| ^~~~~~~~~
include/linux/rcupdate.h:650:31: note: in expansion of macro '__rcu_access_pointer'
650 | #define rcu_access_pointer(p) __rcu_access_pointer((p), __UNIQUE_ID(rcu), __rcu)
| ^~~~~~~~~~~~~~~~~~~~
net/core/dev.c:2087:26: note: in expansion of macro 'rcu_access_pointer'
2087 | if (!net_eq(net, rcu_access_pointer(dev->nd_net.net))) {
| ^~~~~~~~~~~~~~~~~~
>> net/core/dev.c:2087:56: error: 'possible_net_t' has no member named 'net'
2087 | if (!net_eq(net, rcu_access_pointer(dev->nd_net.net))) {
| ^
include/linux/compiler.h:57:52: note: in definition of macro '__trace_if_var'
57 | #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
| ^~~~
net/core/dev.c:2087:9: note: in expansion of macro 'if'
2087 | if (!net_eq(net, rcu_access_pointer(dev->nd_net.net))) {
| ^~
include/linux/compiler.h:55:28: note: in expansion of macro '__trace_if_var'
55 | #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
| ^~~~~~~~~~~~~~
include/linux/compiler_types.h:522:17: note: in expansion of macro 'if'
522 | if (!(condition)) \
| ^~
include/linux/compiler_types.h:530:9: note: in expansion of macro '__compiletime_assert'
530 | __compiletime_assert(condition, msg, prefix, suffix)
| ^~~~~~~~~~~~~~~~~~~~
include/linux/compiler_types.h:542:9: note: in expansion of macro '_compiletime_assert'
542 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:36:9: note: in expansion of macro 'compiletime_assert'
36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
| ^~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:36:28: note: in expansion of macro '__native_word'
36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
| ^~~~~~~~~~~~~
include/asm-generic/rwonce.h:49:9: note: in expansion of macro 'compiletime_assert_rwonce_type'
49 | compiletime_assert_rwonce_type(x); \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/rcupdate.h:531:50: note: in expansion of macro 'READ_ONCE'
531 | typeof(*p) *local = (typeof(*p) *__force)READ_ONCE(p); \
| ^~~~~~~~~
include/linux/rcupdate.h:650:31: note: in expansion of macro '__rcu_access_pointer'
650 | #define rcu_access_pointer(p) __rcu_access_pointer((p), __UNIQUE_ID(rcu), __rcu)
| ^~~~~~~~~~~~~~~~~~~~
net/core/dev.c:2087:26: note: in expansion of macro 'rcu_access_pointer'
2087 | if (!net_eq(net, rcu_access_pointer(dev->nd_net.net))) {
| ^~~~~~~~~~~~~~~~~~
>> net/core/dev.c:2087:56: error: 'possible_net_t' has no member named 'net'
2087 | if (!net_eq(net, rcu_access_pointer(dev->nd_net.net))) {
| ^
include/linux/compiler.h:57:52: note: in definition of macro '__trace_if_var'
57 | #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
| ^~~~
net/core/dev.c:2087:9: note: in expansion of macro 'if'
2087 | if (!net_eq(net, rcu_access_pointer(dev->nd_net.net))) {
| ^~
include/linux/compiler.h:55:28: note: in expansion of macro '__trace_if_var'
55 | #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
| ^~~~~~~~~~~~~~
include/linux/compiler_types.h:522:17: note: in expansion of macro 'if'
522 | if (!(condition)) \
| ^~
include/linux/compiler_types.h:530:9: note: in expansion of macro '__compiletime_assert'
530 | __compiletime_assert(condition, msg, prefix, suffix)
| ^~~~~~~~~~~~~~~~~~~~
include/linux/compiler_types.h:542:9: note: in expansion of macro '_compiletime_assert'
542 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:36:9: note: in expansion of macro 'compiletime_assert'
36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
| ^~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:36:28: note: in expansion of macro '__native_word'
36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
| ^~~~~~~~~~~~~
include/asm-generic/rwonce.h:49:9: note: in expansion of macro 'compiletime_assert_rwonce_type'
49 | compiletime_assert_rwonce_type(x); \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/rcupdate.h:531:50: note: in expansion of macro 'READ_ONCE'
531 | typeof(*p) *local = (typeof(*p) *__force)READ_ONCE(p); \
| ^~~~~~~~~
include/linux/rcupdate.h:650:31: note: in expansion of macro '__rcu_access_pointer'
650 | #define rcu_access_pointer(p) __rcu_access_pointer((p), __UNIQUE_ID(rcu), __rcu)
| ^~~~~~~~~~~~~~~~~~~~
net/core/dev.c:2087:26: note: in expansion of macro 'rcu_access_pointer'
2087 | if (!net_eq(net, rcu_access_pointer(dev->nd_net.net))) {
| ^~~~~~~~~~~~~~~~~~
>> net/core/dev.c:2087:56: error: 'possible_net_t' has no member named 'net'
2087 | if (!net_eq(net, rcu_access_pointer(dev->nd_net.net))) {
| ^
include/linux/compiler.h:57:52: note: in definition of macro '__trace_if_var'
57 | #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
| ^~~~
net/core/dev.c:2087:9: note: in expansion of macro 'if'
2087 | if (!net_eq(net, rcu_access_pointer(dev->nd_net.net))) {
| ^~
include/linux/compiler.h:55:28: note: in expansion of macro '__trace_if_var'
55 | #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
| ^~~~~~~~~~~~~~
include/linux/compiler_types.h:522:17: note: in expansion of macro 'if'
522 | if (!(condition)) \
| ^~
include/linux/compiler_types.h:530:9: note: in expansion of macro '__compiletime_assert'
530 | __compiletime_assert(condition, msg, prefix, suffix)
| ^~~~~~~~~~~~~~~~~~~~
include/linux/compiler_types.h:542:9: note: in expansion of macro '_compiletime_assert'
542 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:36:9: note: in expansion of macro 'compiletime_assert'
36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
| ^~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:36:28: note: in expansion of macro '__native_word'
36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
| ^~~~~~~~~~~~~
include/asm-generic/rwonce.h:49:9: note: in expansion of macro 'compiletime_assert_rwonce_type'
49 | compiletime_assert_rwonce_type(x); \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/rcupdate.h:531:50: note: in expansion of macro 'READ_ONCE'
531 | typeof(*p) *local = (typeof(*p) *__force)READ_ONCE(p); \
| ^~~~~~~~~
include/linux/rcupdate.h:650:31: note: in expansion of macro '__rcu_access_pointer'
650 | #define rcu_access_pointer(p) __rcu_access_pointer((p), __UNIQUE_ID(rcu), __rcu)
| ^~~~~~~~~~~~~~~~~~~~
net/core/dev.c:2087:26: note: in expansion of macro 'rcu_access_pointer'
2087 | if (!net_eq(net, rcu_access_pointer(dev->nd_net.net))) {
| ^~~~~~~~~~~~~~~~~~
>> net/core/dev.c:2087:56: error: 'possible_net_t' has no member named 'net'
2087 | if (!net_eq(net, rcu_access_pointer(dev->nd_net.net))) {
| ^
include/linux/compiler.h:57:52: note: in definition of macro '__trace_if_var'
57 | #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
| ^~~~
net/core/dev.c:2087:9: note: in expansion of macro 'if'
2087 | if (!net_eq(net, rcu_access_pointer(dev->nd_net.net))) {
| ^~
include/linux/compiler.h:55:28: note: in expansion of macro '__trace_if_var'
55 | #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
| ^~~~~~~~~~~~~~
include/linux/compiler_types.h:522:17: note: in expansion of macro 'if'
522 | if (!(condition)) \
| ^~
include/linux/compiler_types.h:530:9: note: in expansion of macro '__compiletime_assert'
530 | __compiletime_assert(condition, msg, prefix, suffix)
| ^~~~~~~~~~~~~~~~~~~~
include/linux/compiler_types.h:542:9: note: in expansion of macro '_compiletime_assert'
542 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:36:9: note: in expansion of macro 'compiletime_assert'
36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
| ^~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:49:9: note: in expansion of macro 'compiletime_assert_rwonce_type'
49 | compiletime_assert_rwonce_type(x); \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/rcupdate.h:531:50: note: in expansion of macro 'READ_ONCE'
531 | typeof(*p) *local = (typeof(*p) *__force)READ_ONCE(p); \
| ^~~~~~~~~
include/linux/rcupdate.h:650:31: note: in expansion of macro '__rcu_access_pointer'
650 | #define rcu_access_pointer(p) __rcu_access_pointer((p), __UNIQUE_ID(rcu), __rcu)
| ^~~~~~~~~~~~~~~~~~~~
net/core/dev.c:2087:26: note: in expansion of macro 'rcu_access_pointer'
2087 | if (!net_eq(net, rcu_access_pointer(dev->nd_net.net))) {
| ^~~~~~~~~~~~~~~~~~
>> net/core/dev.c:2087:56: error: 'possible_net_t' has no member named 'net'
2087 | if (!net_eq(net, rcu_access_pointer(dev->nd_net.net))) {
| ^
include/linux/compiler.h:57:52: note: in definition of macro '__trace_if_var'
57 | #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
| ^~~~
net/core/dev.c:2087:9: note: in expansion of macro 'if'
2087 | if (!net_eq(net, rcu_access_pointer(dev->nd_net.net))) {
| ^~
include/linux/compiler.h:55:28: note: in expansion of macro '__trace_if_var'
55 | #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
| ^~~~~~~~~~~~~~
include/linux/compiler_types.h:522:17: note: in expansion of macro 'if'
522 | if (!(condition)) \
| ^~
include/linux/compiler_types.h:530:9: note: in expansion of macro '__compiletime_assert'
530 | __compiletime_assert(condition, msg, prefix, suffix)
| ^~~~~~~~~~~~~~~~~~~~
include/linux/compiler_types.h:542:9: note: in expansion of macro '_compiletime_assert'
542 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:36:9: note: in expansion of macro 'compiletime_assert'
36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
| ^~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:36:28: note: in expansion of macro '__native_word'
36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
| ^~~~~~~~~~~~~
include/asm-generic/rwonce.h:49:9: note: in expansion of macro 'compiletime_assert_rwonce_type'
49 | compiletime_assert_rwonce_type(x); \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/rcupdate.h:531:50: note: in expansion of macro 'READ_ONCE'
531 | typeof(*p) *local = (typeof(*p) *__force)READ_ONCE(p); \
| ^~~~~~~~~
include/linux/rcupdate.h:650:31: note: in expansion of macro '__rcu_access_pointer'
650 | #define rcu_access_pointer(p) __rcu_access_pointer((p), __UNIQUE_ID(rcu), __rcu)
| ^~~~~~~~~~~~~~~~~~~~
net/core/dev.c:2087:26: note: in expansion of macro 'rcu_access_pointer'
2087 | if (!net_eq(net, rcu_access_pointer(dev->nd_net.net))) {
| ^~~~~~~~~~~~~~~~~~
>> net/core/dev.c:2087:56: error: 'possible_net_t' has no member named 'net'
2087 | if (!net_eq(net, rcu_access_pointer(dev->nd_net.net))) {
| ^
include/linux/compiler.h:57:52: note: in definition of macro '__trace_if_var'
57 | #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
| ^~~~
net/core/dev.c:2087:9: note: in expansion of macro 'if'
2087 | if (!net_eq(net, rcu_access_pointer(dev->nd_net.net))) {
| ^~
include/linux/compiler.h:55:28: note: in expansion of macro '__trace_if_var'
55 | #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
| ^~~~~~~~~~~~~~
include/linux/compiler_types.h:522:17: note: in expansion of macro 'if'
522 | if (!(condition)) \
| ^~
include/linux/compiler_types.h:530:9: note: in expansion of macro '__compiletime_assert'
530 | __compiletime_assert(condition, msg, prefix, suffix)
| ^~~~~~~~~~~~~~~~~~~~
include/linux/compiler_types.h:542:9: note: in expansion of macro '_compiletime_assert'
542 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:36:9: note: in expansion of macro 'compiletime_assert'
36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
| ^~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:36:28: note: in expansion of macro '__native_word'
36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
| ^~~~~~~~~~~~~
include/asm-generic/rwonce.h:49:9: note: in expansion of macro 'compiletime_assert_rwonce_type'
49 | compiletime_assert_rwonce_type(x); \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/rcupdate.h:531:50: note: in expansion of macro 'READ_ONCE'
531 | typeof(*p) *local = (typeof(*p) *__force)READ_ONCE(p); \
| ^~~~~~~~~
include/linux/rcupdate.h:650:31: note: in expansion of macro '__rcu_access_pointer'
650 | #define rcu_access_pointer(p) __rcu_access_pointer((p), __UNIQUE_ID(rcu), __rcu)
| ^~~~~~~~~~~~~~~~~~~~
net/core/dev.c:2087:26: note: in expansion of macro 'rcu_access_pointer'
2087 | if (!net_eq(net, rcu_access_pointer(dev->nd_net.net))) {
| ^~~~~~~~~~~~~~~~~~
>> net/core/dev.c:2087:56: error: 'possible_net_t' has no member named 'net'
2087 | if (!net_eq(net, rcu_access_pointer(dev->nd_net.net))) {
| ^
include/linux/compiler.h:57:52: note: in definition of macro '__trace_if_var'
57 | #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
| ^~~~
net/core/dev.c:2087:9: note: in expansion of macro 'if'
2087 | if (!net_eq(net, rcu_access_pointer(dev->nd_net.net))) {
| ^~
include/linux/compiler.h:55:28: note: in expansion of macro '__trace_if_var'
55 | #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
| ^~~~~~~~~~~~~~
include/linux/compiler_types.h:522:17: note: in expansion of macro 'if'
522 | if (!(condition)) \
| ^~
include/linux/compiler_types.h:530:9: note: in expansion of macro '__compiletime_assert'
530 | __compiletime_assert(condition, msg, prefix, suffix)
| ^~~~~~~~~~~~~~~~~~~~
include/linux/compiler_types.h:542:9: note: in expansion of macro '_compiletime_assert'
542 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:36:9: note: in expansion of macro 'compiletime_assert'
36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
| ^~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:36:28: note: in expansion of macro '__native_word'
36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
| ^~~~~~~~~~~~~
include/asm-generic/rwonce.h:49:9: note: in expansion of macro 'compiletime_assert_rwonce_type'
49 | compiletime_assert_rwonce_type(x); \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/rcupdate.h:531:50: note: in expansion of macro 'READ_ONCE'
531 | typeof(*p) *local = (typeof(*p) *__force)READ_ONCE(p); \
| ^~~~~~~~~
include/linux/rcupdate.h:650:31: note: in expansion of macro '__rcu_access_pointer'
650 | #define rcu_access_pointer(p) __rcu_access_pointer((p), __UNIQUE_ID(rcu), __rcu)
| ^~~~~~~~~~~~~~~~~~~~
net/core/dev.c:2087:26: note: in expansion of macro 'rcu_access_pointer'
2087 | if (!net_eq(net, rcu_access_pointer(dev->nd_net.net))) {
| ^~~~~~~~~~~~~~~~~~
>> net/core/dev.c:2087:56: error: 'possible_net_t' has no member named 'net'
2087 | if (!net_eq(net, rcu_access_pointer(dev->nd_net.net))) {
| ^
include/linux/compiler.h:57:52: note: in definition of macro '__trace_if_var'
57 | #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
| ^~~~
net/core/dev.c:2087:9: note: in expansion of macro 'if'
2087 | if (!net_eq(net, rcu_access_pointer(dev->nd_net.net))) {
| ^~
include/linux/compiler.h:55:28: note: in expansion of macro '__trace_if_var'
55 | #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
| ^~~~~~~~~~~~~~
include/linux/compiler_types.h:522:17: note: in expansion of macro 'if'
522 | if (!(condition)) \
| ^~
include/linux/compiler_types.h:530:9: note: in expansion of macro '__compiletime_assert'
530 | __compiletime_assert(condition, msg, prefix, suffix)
| ^~~~~~~~~~~~~~~~~~~~
include/linux/compiler_types.h:542:9: note: in expansion of macro '_compiletime_assert'
542 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:36:9: note: in expansion of macro 'compiletime_assert'
36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
| ^~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:36:28: note: in expansion of macro '__native_word'
36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
| ^~~~~~~~~~~~~
include/asm-generic/rwonce.h:49:9: note: in expansion of macro 'compiletime_assert_rwonce_type'
49 | compiletime_assert_rwonce_type(x); \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/rcupdate.h:531:50: note: in expansion of macro 'READ_ONCE'
531 | typeof(*p) *local = (typeof(*p) *__force)READ_ONCE(p); \
| ^~~~~~~~~
include/linux/rcupdate.h:650:31: note: in expansion of macro '__rcu_access_pointer'
650 | #define rcu_access_pointer(p) __rcu_access_pointer((p), __UNIQUE_ID(rcu), __rcu)
| ^~~~~~~~~~~~~~~~~~~~
net/core/dev.c:2087:26: note: in expansion of macro 'rcu_access_pointer'
2087 | if (!net_eq(net, rcu_access_pointer(dev->nd_net.net))) {
| ^~~~~~~~~~~~~~~~~~
>> net/core/dev.c:2087:56: error: 'possible_net_t' has no member named 'net'
2087 | if (!net_eq(net, rcu_access_pointer(dev->nd_net.net))) {
| ^
include/linux/compiler.h:57:52: note: in definition of macro '__trace_if_var'
57 | #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
| ^~~~
net/core/dev.c:2087:9: note: in expansion of macro 'if'
2087 | if (!net_eq(net, rcu_access_pointer(dev->nd_net.net))) {
| ^~
include/linux/compiler.h:55:28: note: in expansion of macro '__trace_if_var'
55 | #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
| ^~~~~~~~~~~~~~
include/linux/compiler_types.h:522:17: note: in expansion of macro 'if'
522 | if (!(condition)) \
| ^~
include/linux/compiler_types.h:530:9: note: in expansion of macro '__compiletime_assert'
530 | __compiletime_assert(condition, msg, prefix, suffix)
| ^~~~~~~~~~~~~~~~~~~~
include/linux/compiler_types.h:542:9: note: in expansion of macro '_compiletime_assert'
542 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:36:9: note: in expansion of macro 'compiletime_assert'
36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
| ^~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:49:9: note: in expansion of macro 'compiletime_assert_rwonce_type'
49 | compiletime_assert_rwonce_type(x); \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/rcupdate.h:531:50: note: in expansion of macro 'READ_ONCE'
531 | typeof(*p) *local = (typeof(*p) *__force)READ_ONCE(p); \
| ^~~~~~~~~
include/linux/rcupdate.h:650:31: note: in expansion of macro '__rcu_access_pointer'
650 | #define rcu_access_pointer(p) __rcu_access_pointer((p), __UNIQUE_ID(rcu), __rcu)
| ^~~~~~~~~~~~~~~~~~~~
net/core/dev.c:2087:26: note: in expansion of macro 'rcu_access_pointer'
2087 | if (!net_eq(net, rcu_access_pointer(dev->nd_net.net))) {
| ^~~~~~~~~~~~~~~~~~
>> net/core/dev.c:2087:56: error: 'possible_net_t' has no member named 'net'
2087 | if (!net_eq(net, rcu_access_pointer(dev->nd_net.net))) {
| ^
include/linux/compiler.h:57:52: note: in definition of macro '__trace_if_var'
57 | #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
| ^~~~
net/core/dev.c:2087:9: note: in expansion of macro 'if'
2087 | if (!net_eq(net, rcu_access_pointer(dev->nd_net.net))) {
| ^~
include/linux/compiler.h:57:69: note: in expansion of macro '__trace_if_value'
57 | #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
| ^~~~~~~~~~~~~~~~
include/linux/compiler.h:55:28: note: in expansion of macro '__trace_if_var'
55 | #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
| ^~~~~~~~~~~~~~
include/linux/compiler_types.h:522:17: note: in expansion of macro 'if'
522 | if (!(condition)) \
| ^~
include/linux/compiler_types.h:530:9: note: in expansion of macro '__compiletime_assert'
530 | __compiletime_assert(condition, msg, prefix, suffix)
| ^~~~~~~~~~~~~~~~~~~~
include/linux/compiler_types.h:542:9: note: in expansion of macro '_compiletime_assert'
542 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:36:9: note: in expansion of macro 'compiletime_assert'
36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
| ^~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:36:28: note: in expansion of macro '__native_word'
36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
| ^~~~~~~~~~~~~
include/asm-generic/rwonce.h:49:9: note: in expansion of macro 'compiletime_assert_rwonce_type'
49 | compiletime_assert_rwonce_type(x); \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/rcupdate.h:531:50: note: in expansion of macro 'READ_ONCE'
531 | typeof(*p) *local = (typeof(*p) *__force)READ_ONCE(p); \
| ^~~~~~~~~
include/linux/rcupdate.h:650:31: note: in expansion of macro '__rcu_access_pointer'
650 | #define rcu_access_pointer(p) __rcu_access_pointer((p), __UNIQUE_ID(rcu), __rcu)
| ^~~~~~~~~~~~~~~~~~~~
net/core/dev.c:2087:26: note: in expansion of macro 'rcu_access_pointer'
2087 | if (!net_eq(net, rcu_access_pointer(dev->nd_net.net))) {
| ^~~~~~~~~~~~~~~~~~
>> net/core/dev.c:2087:56: error: 'possible_net_t' has no member named 'net'
2087 | if (!net_eq(net, rcu_access_pointer(dev->nd_net.net))) {
| ^
include/linux/compiler.h:57:52: note: in definition of macro '__trace_if_var'
57 | #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
| ^~~~
net/core/dev.c:2087:9: note: in expansion of macro 'if'
2087 | if (!net_eq(net, rcu_access_pointer(dev->nd_net.net))) {
| ^~
include/linux/compiler.h:57:69: note: in expansion of macro '__trace_if_value'
57 | #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
| ^~~~~~~~~~~~~~~~
include/linux/compiler.h:55:28: note: in expansion of macro '__trace_if_var'
55 | #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
| ^~~~~~~~~~~~~~
include/linux/compiler_types.h:522:17: note: in expansion of macro 'if'
522 | if (!(condition)) \
| ^~
include/linux/compiler_types.h:530:9: note: in expansion of macro '__compiletime_assert'
530 | __compiletime_assert(condition, msg, prefix, suffix)
| ^~~~~~~~~~~~~~~~~~~~
include/linux/compiler_types.h:542:9: note: in expansion of macro '_compiletime_assert'
542 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:36:9: note: in expansion of macro 'compiletime_assert'
36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
| ^~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:36:28: note: in expansion of macro '__native_word'
36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
| ^~~~~~~~~~~~~
include/asm-generic/rwonce.h:49:9: note: in expansion of macro 'compiletime_assert_rwonce_type'
49 | compiletime_assert_rwonce_type(x); \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/rcupdate.h:531:50: note: in expansion of macro 'READ_ONCE'
531 | typeof(*p) *local = (typeof(*p) *__force)READ_ONCE(p); \
| ^~~~~~~~~
include/linux/rcupdate.h:650:31: note: in expansion of macro '__rcu_access_pointer'
650 | #define rcu_access_pointer(p) __rcu_access_pointer((p), __UNIQUE_ID(rcu), __rcu)
| ^~~~~~~~~~~~~~~~~~~~
net/core/dev.c:2087:26: note: in expansion of macro 'rcu_access_pointer'
2087 | if (!net_eq(net, rcu_access_pointer(dev->nd_net.net))) {
| ^~~~~~~~~~~~~~~~~~
>> net/core/dev.c:2087:56: error: 'possible_net_t' has no member named 'net'
2087 | if (!net_eq(net, rcu_access_pointer(dev->nd_net.net))) {
| ^
include/linux/compiler.h:57:52: note: in definition of macro '__trace_if_var'
57 | #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
| ^~~~
net/core/dev.c:2087:9: note: in expansion of macro 'if'
2087 | if (!net_eq(net, rcu_access_pointer(dev->nd_net.net))) {
| ^~
include/linux/compiler.h:57:69: note: in expansion of macro '__trace_if_value'
57 | #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
| ^~~~~~~~~~~~~~~~
include/linux/compiler.h:55:28: note: in expansion of macro '__trace_if_var'
55 | #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
| ^~~~~~~~~~~~~~
include/linux/compiler_types.h:522:17: note: in expansion of macro 'if'
522 | if (!(condition)) \
| ^~
include/linux/compiler_types.h:530:9: note: in expansion of macro '__compiletime_assert'
530 | __compiletime_assert(condition, msg, prefix, suffix)
| ^~~~~~~~~~~~~~~~~~~~
include/linux/compiler_types.h:542:9: note: in expansion of macro '_compiletime_assert'
542 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:36:9: note: in expansion of macro 'compiletime_assert'
36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
| ^~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:36:28: note: in expansion of macro '__native_word'
36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
| ^~~~~~~~~~~~~
include/asm-generic/rwonce.h:49:9: note: in expansion of macro 'compiletime_assert_rwonce_type'
49 | compiletime_assert_rwonce_type(x); \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/rcupdate.h:531:50: note: in expansion of macro 'READ_ONCE'
531 | typeof(*p) *local = (typeof(*p) *__force)READ_ONCE(p); \
| ^~~~~~~~~
include/linux/rcupdate.h:650:31: note: in expansion of macro '__rcu_access_pointer'
650 | #define rcu_access_pointer(p) __rcu_access_pointer((p), __UNIQUE_ID(rcu), __rcu)
| ^~~~~~~~~~~~~~~~~~~~
net/core/dev.c:2087:26: note: in expansion of macro 'rcu_access_pointer'
2087 | if (!net_eq(net, rcu_access_pointer(dev->nd_net.net))) {
| ^~~~~~~~~~~~~~~~~~
>> net/core/dev.c:2087:56: error: 'possible_net_t' has no member named 'net'
2087 | if (!net_eq(net, rcu_access_pointer(dev->nd_net.net))) {
| ^
include/linux/compiler.h:57:52: note: in definition of macro '__trace_if_var'
57 | #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
| ^~~~
net/core/dev.c:2087:9: note: in expansion of macro 'if'
2087 | if (!net_eq(net, rcu_access_pointer(dev->nd_net.net))) {
| ^~
include/linux/compiler.h:57:69: note: in expansion of macro '__trace_if_value'
57 | #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
| ^~~~~~~~~~~~~~~~
include/linux/compiler.h:55:28: note: in expansion of macro '__trace_if_var'
55 | #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
| ^~~~~~~~~~~~~~
include/linux/compiler_types.h:522:17: note: in expansion of macro 'if'
522 | if (!(condition)) \
| ^~
include/linux/compiler_types.h:530:9: note: in expansion of macro '__compiletime_assert'
530 | __compiletime_assert(condition, msg, prefix, suffix)
| ^~~~~~~~~~~~~~~~~~~~
include/linux/compiler_types.h:542:9: note: in expansion of macro '_compiletime_assert'
542 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:36:9: note: in expansion of macro 'compiletime_assert'
36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
| ^~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:36:28: note: in expansion of macro '__native_word'
36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
| ^~~~~~~~~~~~~
include/asm-generic/rwonce.h:49:9: note: in expansion of macro 'compiletime_assert_rwonce_type'
49 | compiletime_assert_rwonce_type(x); \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/rcupdate.h:531:50: note: in expansion of macro 'READ_ONCE'
531 | typeof(*p) *local = (typeof(*p) *__force)READ_ONCE(p); \
| ^~~~~~~~~
include/linux/rcupdate.h:650:31: note: in expansion of macro '__rcu_access_pointer'
650 | #define rcu_access_pointer(p) __rcu_access_pointer((p), __UNIQUE_ID(rcu), __rcu)
| ^~~~~~~~~~~~~~~~~~~~
net/core/dev.c:2087:26: note: in expansion of macro 'rcu_access_pointer'
2087 | if (!net_eq(net, rcu_access_pointer(dev->nd_net.net))) {
| ^~~~~~~~~~~~~~~~~~
>> net/core/dev.c:2087:56: error: 'possible_net_t' has no member named 'net'
2087 | if (!net_eq(net, rcu_access_pointer(dev->nd_net.net))) {
| ^
include/linux/compiler.h:57:52: note: in definition of macro '__trace_if_var'
57 | #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
| ^~~~
net/core/dev.c:2087:9: note: in expansion of macro 'if'
2087 | if (!net_eq(net, rcu_access_pointer(dev->nd_net.net))) {
| ^~
include/linux/compiler.h:57:69: note: in expansion of macro '__trace_if_value'
57 | #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
| ^~~~~~~~~~~~~~~~
include/linux/compiler.h:55:28: note: in expansion of macro '__trace_if_var'
55 | #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
| ^~~~~~~~~~~~~~
include/linux/compiler_types.h:522:17: note: in expansion of macro 'if'
522 | if (!(condition)) \
| ^~
include/linux/compiler_types.h:530:9: note: in expansion of macro '__compiletime_assert'
530 | __compiletime_assert(condition, msg, prefix, suffix)
| ^~~~~~~~~~~~~~~~~~~~
include/linux/compiler_types.h:542:9: note: in expansion of macro '_compiletime_assert'
542 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:36:9: note: in expansion of macro 'compiletime_assert'
36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
| ^~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:49:9: note: in expansion of macro 'compiletime_assert_rwonce_type'
49 | compiletime_assert_rwonce_type(x); \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/rcupdate.h:531:50: note: in expansion of macro 'READ_ONCE'
531 | typeof(*p) *local = (typeof(*p) *__force)READ_ONCE(p); \
| ^~~~~~~~~
include/linux/rcupdate.h:650:31: note: in expansion of macro '__rcu_access_pointer'
650 | #define rcu_access_pointer(p) __rcu_access_pointer((p), __UNIQUE_ID(rcu), __rcu)
| ^~~~~~~~~~~~~~~~~~~~
net/core/dev.c:2087:26: note: in expansion of macro 'rcu_access_pointer'
2087 | if (!net_eq(net, rcu_access_pointer(dev->nd_net.net))) {
| ^~~~~~~~~~~~~~~~~~
>> net/core/dev.c:2087:56: error: 'possible_net_t' has no member named 'net'
2087 | if (!net_eq(net, rcu_access_pointer(dev->nd_net.net))) {
| ^
include/linux/compiler.h:57:52: note: in definition of macro '__trace_if_var'
57 | #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
| ^~~~
net/core/dev.c:2087:9: note: in expansion of macro 'if'
2087 | if (!net_eq(net, rcu_access_pointer(dev->nd_net.net))) {
| ^~
include/asm-generic/rwonce.h:44:43: note: in expansion of macro '__unqual_scalar_typeof'
44 | #define __READ_ONCE(x) (*(const volatile __unqual_scalar_typeof(x) *)&(x))
| ^~~~~~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:50:9: note: in expansion of macro '__READ_ONCE'
50 | __READ_ONCE(x); \
| ^~~~~~~~~~~
include/linux/rcupdate.h:531:50: note: in expansion of macro 'READ_ONCE'
531 | typeof(*p) *local = (typeof(*p) *__force)READ_ONCE(p); \
| ^~~~~~~~~
include/linux/rcupdate.h:650:31: note: in expansion of macro '__rcu_access_pointer'
650 | #define rcu_access_pointer(p) __rcu_access_pointer((p), __UNIQUE_ID(rcu), __rcu)
| ^~~~~~~~~~~~~~~~~~~~
net/core/dev.c:2087:26: note: in expansion of macro 'rcu_access_pointer'
2087 | if (!net_eq(net, rcu_access_pointer(dev->nd_net.net))) {
| ^~~~~~~~~~~~~~~~~~
>> net/core/dev.c:2087:56: error: 'possible_net_t' has no member named 'net'
2087 | if (!net_eq(net, rcu_access_pointer(dev->nd_net.net))) {
| ^
include/linux/compiler.h:57:52: note: in definition of macro '__trace_if_var'
57 | #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
| ^~~~
net/core/dev.c:2087:9: note: in expansion of macro 'if'
2087 | if (!net_eq(net, rcu_access_pointer(dev->nd_net.net))) {
| ^~
include/asm-generic/rwonce.h:50:9: note: in expansion of macro '__READ_ONCE'
50 | __READ_ONCE(x); \
| ^~~~~~~~~~~
include/linux/rcupdate.h:531:50: note: in expansion of macro 'READ_ONCE'
531 | typeof(*p) *local = (typeof(*p) *__force)READ_ONCE(p); \
| ^~~~~~~~~
include/linux/rcupdate.h:650:31: note: in expansion of macro '__rcu_access_pointer'
650 | #define rcu_access_pointer(p) __rcu_access_pointer((p), __UNIQUE_ID(rcu), __rcu)
| ^~~~~~~~~~~~~~~~~~~~
net/core/dev.c:2087:26: note: in expansion of macro 'rcu_access_pointer'
2087 | if (!net_eq(net, rcu_access_pointer(dev->nd_net.net))) {
| ^~~~~~~~~~~~~~~~~~
>> net/core/dev.c:2087:56: error: 'possible_net_t' has no member named 'net'
2087 | if (!net_eq(net, rcu_access_pointer(dev->nd_net.net))) {
| ^
include/linux/compiler.h:57:52: note: in definition of macro '__trace_if_var'
57 | #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
| ^~~~
net/core/dev.c:2087:9: note: in expansion of macro 'if'
2087 | if (!net_eq(net, rcu_access_pointer(dev->nd_net.net))) {
| ^~
include/linux/rcupdate.h:650:31: note: in expansion of macro '__rcu_access_pointer'
650 | #define rcu_access_pointer(p) __rcu_access_pointer((p), __UNIQUE_ID(rcu), __rcu)
| ^~~~~~~~~~~~~~~~~~~~
net/core/dev.c:2087:26: note: in expansion of macro 'rcu_access_pointer'
2087 | if (!net_eq(net, rcu_access_pointer(dev->nd_net.net))) {
| ^~~~~~~~~~~~~~~~~~
net/core/dev.c:2087:56: error: 'possible_net_t' has no member named 'net'
2087 | if (!net_eq(net, rcu_access_pointer(dev->nd_net.net))) {
| ^
include/linux/compiler.h:57:61: note: in definition of macro '__trace_if_var'
57 | #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
| ^~~~
net/core/dev.c:2087:9: note: in expansion of macro 'if'
2087 | if (!net_eq(net, rcu_access_pointer(dev->nd_net.net))) {
| ^~
include/linux/rcupdate.h:650:31: note: in expansion of macro '__rcu_access_pointer'
650 | #define rcu_access_pointer(p) __rcu_access_pointer((p), __UNIQUE_ID(rcu), __rcu)
| ^~~~~~~~~~~~~~~~~~~~
net/core/dev.c:2087:26: note: in expansion of macro 'rcu_access_pointer'
2087 | if (!net_eq(net, rcu_access_pointer(dev->nd_net.net))) {
| ^~~~~~~~~~~~~~~~~~
net/core/dev.c:2087:56: error: 'possible_net_t' has no member named 'net'
2087 | if (!net_eq(net, rcu_access_pointer(dev->nd_net.net))) {
| ^
include/linux/compiler.h:57:61: note: in definition of macro '__trace_if_var'
57 | #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
| ^~~~
net/core/dev.c:2087:9: note: in expansion of macro 'if'
2087 | if (!net_eq(net, rcu_access_pointer(dev->nd_net.net))) {
| ^~
include/linux/rcupdate.h:650:31: note: in expansion of macro '__rcu_access_pointer'
650 | #define rcu_access_pointer(p) __rcu_access_pointer((p), __UNIQUE_ID(rcu), __rcu)
| ^~~~~~~~~~~~~~~~~~~~
net/core/dev.c:2087:26: note: in expansion of macro 'rcu_access_pointer'
2087 | if (!net_eq(net, rcu_access_pointer(dev->nd_net.net))) {
| ^~~~~~~~~~~~~~~~~~
net/core/dev.c:2087:56: error: 'possible_net_t' has no member named 'net'
2087 | if (!net_eq(net, rcu_access_pointer(dev->nd_net.net))) {
| ^
include/linux/compiler.h:57:61: note: in definition of macro '__trace_if_var'
57 | #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
| ^~~~
net/core/dev.c:2087:9: note: in expansion of macro 'if'
2087 | if (!net_eq(net, rcu_access_pointer(dev->nd_net.net))) {
| ^~
include/linux/compiler.h:55:28: note: in expansion of macro '__trace_if_var'
55 | #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
| ^~~~~~~~~~~~~~
include/linux/compiler_types.h:522:17: note: in expansion of macro 'if'
522 | if (!(condition)) \
| ^~
include/linux/compiler_types.h:530:9: note: in expansion of macro '__compiletime_assert'
530 | __compiletime_assert(condition, msg, prefix, suffix)
| ^~~~~~~~~~~~~~~~~~~~
include/linux/compiler_types.h:542:9: note: in expansion of macro '_compiletime_assert'
542 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:36:9: note: in expansion of macro 'compiletime_assert'
36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
| ^~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:36:28: note: in expansion of macro '__native_word'
36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
| ^~~~~~~~~~~~~
include/asm-generic/rwonce.h:49:9: note: in expansion of macro 'compiletime_assert_rwonce_type'
49 | compiletime_assert_rwonce_type(x); \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/rcupdate.h:531:50: note: in expansion of macro 'READ_ONCE'
531 | typeof(*p) *local = (typeof(*p) *__force)READ_ONCE(p); \
| ^~~~~~~~~
include/linux/rcupdate.h:650:31: note: in expansion of macro '__rcu_access_pointer'
650 | #define rcu_access_pointer(p) __rcu_access_pointer((p), __UNIQUE_ID(rcu), __rcu)
| ^~~~~~~~~~~~~~~~~~~~
net/core/dev.c:2087:26: note: in expansion of macro 'rcu_access_pointer'
2087 | if (!net_eq(net, rcu_access_pointer(dev->nd_net.net))) {
| ^~~~~~~~~~~~~~~~~~
net/core/dev.c:2087:56: error: 'possible_net_t' has no member named 'net'
2087 | if (!net_eq(net, rcu_access_pointer(dev->nd_net.net))) {
| ^
include/linux/compiler.h:57:61: note: in definition of macro '__trace_if_var'
57 | #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
| ^~~~
net/core/dev.c:2087:9: note: in expansion of macro 'if'
2087 | if (!net_eq(net, rcu_access_pointer(dev->nd_net.net))) {
| ^~
include/linux/compiler.h:55:28: note: in expansion of macro '__trace_if_var'
55 | #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
| ^~~~~~~~~~~~~~
include/linux/compiler_types.h:522:17: note: in expansion of macro 'if'
522 | if (!(condition)) \
| ^~ include/linux/compiler_types.h:530:9: note: in expansion of macro '__compiletime_assert'
530 | __compiletime_assert(condition, msg, prefix, suffix)
vim +2087 net/core/dev.c
2072
2073 static void rtnl_net_dev_lock(struct net_device *dev)
2074 {
2075 struct net *net;
2076
2077 again:
2078 /* netns might be being dismantled. */
2079 rcu_read_lock();
2080 net = dev_net_rcu(dev);
2081 refcount_inc(&net->passive);
2082 rcu_read_unlock();
2083
2084 rtnl_net_lock(net);
2085
2086 /* dev might have been moved to another netns. */
> 2087 if (!net_eq(net, rcu_access_pointer(dev->nd_net.net))) { 2088 rtnl_net_unlock(net);
2089 net_drop_ns(net);
2090 goto again;
2091 }
2092 }
2093
Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
kernel test robot
build botRe: [PATCH v3 net 1/2] net: Fix dev_net(dev) race in unregister_netdevice_notifier_dev_net().
In reply to Kuniyuki Iwashimakernel test robot noticed the following build errors:
Hi Kuniyuki,
kernel test robot noticed the following build errors:
[auto build test ERROR on net/main]
url: https://github.com/intel-lab-lkp/linux/commits/Kuniyuki-Iwashima/net-Fix-dev_net-dev-race-in-unregister_netdevice_notifier_dev_net/20250211-131633 base: net/main patch link: https://lore.kernel.org/r/20250211051217.12613-2-kuniyu%40amazon.com patch subject: [PATCH v3 net 1/2] net: Fix dev_net(dev) race in unregister_netdevice_notifier_dev_net(). config: s390-randconfig-002-20250212 (https://download.01.org/0day-ci/archive/20250212/[email protected]/config) compiler: clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250212/[email protected]/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
All errors (new ones prefixed by >>):
>> net/core/dev.c:2087:50: error: no member named 'net' in 'possible_net_t'
2087 | if (!net_eq(net, rcu_access_pointer(dev->nd_net.net))) {
| ~~~~~~~~~~~ ^
include/linux/rcupdate.h:650:53: note: expanded from macro 'rcu_access_pointer'
650 | #define rcu_access_pointer(p) __rcu_access_pointer((p), __UNIQUE_ID(rcu), __rcu)
| ^
include/linux/rcupdate.h:531:10: note: expanded from macro '__rcu_access_pointer'
531 | typeof(*p) *local = (typeof(*p) *__force)READ_ONCE(p); \
| ^
>> net/core/dev.c:2087:50: error: no member named 'net' in 'possible_net_t'
2087 | if (!net_eq(net, rcu_access_pointer(dev->nd_net.net))) {
| ~~~~~~~~~~~ ^
include/linux/rcupdate.h:650:53: note: expanded from macro 'rcu_access_pointer'
650 | #define rcu_access_pointer(p) __rcu_access_pointer((p), __UNIQUE_ID(rcu), __rcu)
| ^
include/linux/rcupdate.h:531:31: note: expanded from macro '__rcu_access_pointer'
531 | typeof(*p) *local = (typeof(*p) *__force)READ_ONCE(p); \
| ^
>> net/core/dev.c:2087:50: error: no member named 'net' in 'possible_net_t'
2087 | if (!net_eq(net, rcu_access_pointer(dev->nd_net.net))) {
| ~~~~~~~~~~~ ^
include/linux/rcupdate.h:650:53: note: expanded from macro 'rcu_access_pointer'
650 | #define rcu_access_pointer(p) __rcu_access_pointer((p), __UNIQUE_ID(rcu), __rcu)
| ^
include/linux/rcupdate.h:531:53: note: expanded from macro '__rcu_access_pointer'
531 | typeof(*p) *local = (typeof(*p) *__force)READ_ONCE(p); \
| ^
include/asm-generic/rwonce.h:49:33: note: expanded from macro 'READ_ONCE'
49 | compiletime_assert_rwonce_type(x); \
| ^
note: (skipping 2 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/linux/compiler_types.h:542:22: note: expanded from macro 'compiletime_assert'
542 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~
include/linux/compiler_types.h:530:23: note: expanded from macro '_compiletime_assert'
530 | __compiletime_assert(condition, msg, prefix, suffix)
| ^~~~~~~~~
include/linux/compiler_types.h:522:9: note: expanded from macro '__compiletime_assert'
522 | if (!(condition)) \
| ^~~~~~~~~
>> net/core/dev.c:2087:50: error: no member named 'net' in 'possible_net_t'
2087 | if (!net_eq(net, rcu_access_pointer(dev->nd_net.net))) {
| ~~~~~~~~~~~ ^
include/linux/rcupdate.h:650:53: note: expanded from macro 'rcu_access_pointer'
650 | #define rcu_access_pointer(p) __rcu_access_pointer((p), __UNIQUE_ID(rcu), __rcu)
| ^
include/linux/rcupdate.h:531:53: note: expanded from macro '__rcu_access_pointer'
531 | typeof(*p) *local = (typeof(*p) *__force)READ_ONCE(p); \
| ^
include/asm-generic/rwonce.h:49:33: note: expanded from macro 'READ_ONCE'
49 | compiletime_assert_rwonce_type(x); \
| ^
note: (skipping 2 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/linux/compiler_types.h:542:22: note: expanded from macro 'compiletime_assert'
542 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~
include/linux/compiler_types.h:530:23: note: expanded from macro '_compiletime_assert'
530 | __compiletime_assert(condition, msg, prefix, suffix)
| ^~~~~~~~~
include/linux/compiler_types.h:522:9: note: expanded from macro '__compiletime_assert'
522 | if (!(condition)) \
| ^~~~~~~~~
>> net/core/dev.c:2087:50: error: no member named 'net' in 'possible_net_t'
2087 | if (!net_eq(net, rcu_access_pointer(dev->nd_net.net))) {
| ~~~~~~~~~~~ ^
include/linux/rcupdate.h:650:53: note: expanded from macro 'rcu_access_pointer'
650 | #define rcu_access_pointer(p) __rcu_access_pointer((p), __UNIQUE_ID(rcu), __rcu)
| ^
include/linux/rcupdate.h:531:53: note: expanded from macro '__rcu_access_pointer'
531 | typeof(*p) *local = (typeof(*p) *__force)READ_ONCE(p); \
| ^
include/asm-generic/rwonce.h:49:33: note: expanded from macro 'READ_ONCE'
49 | compiletime_assert_rwonce_type(x); \
| ^
note: (skipping 2 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/linux/compiler_types.h:542:22: note: expanded from macro 'compiletime_assert'
542 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~
include/linux/compiler_types.h:530:23: note: expanded from macro '_compiletime_assert'
530 | __compiletime_assert(condition, msg, prefix, suffix)
| ^~~~~~~~~
include/linux/compiler_types.h:522:9: note: expanded from macro '__compiletime_assert'
522 | if (!(condition)) \
| ^~~~~~~~~
>> net/core/dev.c:2087:50: error: no member named 'net' in 'possible_net_t'
2087 | if (!net_eq(net, rcu_access_pointer(dev->nd_net.net))) {
| ~~~~~~~~~~~ ^
include/linux/rcupdate.h:650:53: note: expanded from macro 'rcu_access_pointer'
650 | #define rcu_access_pointer(p) __rcu_access_pointer((p), __UNIQUE_ID(rcu), __rcu)
| ^
include/linux/rcupdate.h:531:53: note: expanded from macro '__rcu_access_pointer'
531 | typeof(*p) *local = (typeof(*p) *__force)READ_ONCE(p); \
| ^
include/asm-generic/rwonce.h:49:33: note: expanded from macro 'READ_ONCE'
49 | compiletime_assert_rwonce_type(x); \
| ^
note: (skipping 2 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/linux/compiler_types.h:542:22: note: expanded from macro 'compiletime_assert'
542 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~
include/linux/compiler_types.h:530:23: note: expanded from macro '_compiletime_assert'
530 | __compiletime_assert(condition, msg, prefix, suffix)
| ^~~~~~~~~
include/linux/compiler_types.h:522:9: note: expanded from macro '__compiletime_assert'
522 | if (!(condition)) \
| ^~~~~~~~~
>> net/core/dev.c:2087:50: error: no member named 'net' in 'possible_net_t'
2087 | if (!net_eq(net, rcu_access_pointer(dev->nd_net.net))) {
| ~~~~~~~~~~~ ^
include/linux/rcupdate.h:650:53: note: expanded from macro 'rcu_access_pointer'
650 | #define rcu_access_pointer(p) __rcu_access_pointer((p), __UNIQUE_ID(rcu), __rcu)
| ^
include/linux/rcupdate.h:531:53: note: expanded from macro '__rcu_access_pointer'
531 | typeof(*p) *local = (typeof(*p) *__force)READ_ONCE(p); \
| ^
include/asm-generic/rwonce.h:49:33: note: expanded from macro 'READ_ONCE'
49 | compiletime_assert_rwonce_type(x); \
| ^
note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/linux/compiler_types.h:542:22: note: expanded from macro 'compiletime_assert'
542 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~
include/linux/compiler_types.h:530:23: note: expanded from macro '_compiletime_assert'
530 | __compiletime_assert(condition, msg, prefix, suffix)
| ^~~~~~~~~
include/linux/compiler_types.h:522:9: note: expanded from macro '__compiletime_assert'
522 | if (!(condition)) \
| ^~~~~~~~~
>> net/core/dev.c:2087:50: error: no member named 'net' in 'possible_net_t'
2087 | if (!net_eq(net, rcu_access_pointer(dev->nd_net.net))) {
| ~~~~~~~~~~~ ^
include/linux/rcupdate.h:650:53: note: expanded from macro 'rcu_access_pointer'
650 | #define rcu_access_pointer(p) __rcu_access_pointer((p), __UNIQUE_ID(rcu), __rcu)
| ^
include/linux/rcupdate.h:531:53: note: expanded from macro '__rcu_access_pointer'
531 | typeof(*p) *local = (typeof(*p) *__force)READ_ONCE(p); \
| ^
include/asm-generic/rwonce.h:50:14: note: expanded from macro 'READ_ONCE'
50 | __READ_ONCE(x); \
| ^
include/asm-generic/rwonce.h:44:65: note: expanded from macro '__READ_ONCE'
44 | #define __READ_ONCE(x) (*(const volatile __unqual_scalar_typeof(x) *)&(x))
| ^
include/linux/compiler_types.h:498:13: note: expanded from macro '__unqual_scalar_typeof'
498 | _Generic((x), \
| ^
>> net/core/dev.c:2087:50: error: no member named 'net' in 'possible_net_t'
2087 | if (!net_eq(net, rcu_access_pointer(dev->nd_net.net))) {
| ~~~~~~~~~~~ ^
include/linux/rcupdate.h:650:53: note: expanded from macro 'rcu_access_pointer'
650 | #define rcu_access_pointer(p) __rcu_access_pointer((p), __UNIQUE_ID(rcu), __rcu)
| ^
include/linux/rcupdate.h:531:53: note: expanded from macro '__rcu_access_pointer'
531 | typeof(*p) *local = (typeof(*p) *__force)READ_ONCE(p); \
| ^
include/asm-generic/rwonce.h:50:14: note: expanded from macro 'READ_ONCE'
50 | __READ_ONCE(x); \
| ^
include/asm-generic/rwonce.h:44:65: note: expanded from macro '__READ_ONCE'
44 | #define __READ_ONCE(x) (*(const volatile __unqual_scalar_typeof(x) *)&(x))
| ^
include/linux/compiler_types.h:505:15: note: expanded from macro '__unqual_scalar_typeof'
505 | default: (x)))
| ^
>> net/core/dev.c:2087:50: error: no member named 'net' in 'possible_net_t'
2087 | if (!net_eq(net, rcu_access_pointer(dev->nd_net.net))) {
| ~~~~~~~~~~~ ^
include/linux/rcupdate.h:650:53: note: expanded from macro 'rcu_access_pointer'
650 | #define rcu_access_pointer(p) __rcu_access_pointer((p), __UNIQUE_ID(rcu), __rcu)
| ^
include/linux/rcupdate.h:531:53: note: expanded from macro '__rcu_access_pointer'
531 | typeof(*p) *local = (typeof(*p) *__force)READ_ONCE(p); \
| ^
include/asm-generic/rwonce.h:50:14: note: expanded from macro 'READ_ONCE'
50 | __READ_ONCE(x); \
| ^
include/asm-generic/rwonce.h:44:72: note: expanded from macro '__READ_ONCE'
44 | #define __READ_ONCE(x) (*(const volatile __unqual_scalar_typeof(x) *)&(x))
| ^
>> net/core/dev.c:2087:50: error: no member named 'net' in 'possible_net_t'
2087 | if (!net_eq(net, rcu_access_pointer(dev->nd_net.net))) {
| ~~~~~~~~~~~ ^
include/linux/rcupdate.h:650:53: note: expanded from macro 'rcu_access_pointer'
650 | #define rcu_access_pointer(p) __rcu_access_pointer((p), __UNIQUE_ID(rcu), __rcu)
| ^
include/linux/rcupdate.h:533:12: note: expanded from macro '__rcu_access_pointer'
533 | ((typeof(*p) __force __kernel *)(local)); \
| ^
>> net/core/dev.c:2087:19: error: passing 'void' to parameter of incompatible type 'const struct net *'
2087 | if (!net_eq(net, rcu_access_pointer(dev->nd_net.net))) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/rcupdate.h:650:31: note: expanded from macro 'rcu_access_pointer'
650 | #define rcu_access_pointer(p) __rcu_access_pointer((p), __UNIQUE_ID(rcu), __rcu)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/rcupdate.h:529:47: note: expanded from macro '__rcu_access_pointer'
529 | #define __rcu_access_pointer(p, local, space) \
| ^
530 | ({ \
| ~~~~
531 | typeof(*p) *local = (typeof(*p) *__force)READ_ONCE(p); \
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
532 | rcu_check_sparse(p, space); \
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
533 | ((typeof(*p) __force __kernel *)(local)); \
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
534 | })
| ~~
include/net/net_namespace.h:318:54: note: passing argument to parameter 'net2' here
318 | int net_eq(const struct net *net1, const struct net *net2)
| ^
>> net/core/dev.c:2089:14: error: called object type 'void *' is not a function or function pointer
2089 | net_drop_ns(net);
| ~~~~~~~~~~~^
net/core/dev.c:2099:13: error: called object type 'void *' is not a function or function pointer
2099 | net_drop_ns(net);
| ~~~~~~~~~~~^14 errors generated.
vim +2087 net/core/dev.c
2072
2073 static void rtnl_net_dev_lock(struct net_device *dev)
2074 {
2075 struct net *net;
2076
2077 again:
2078 /* netns might be being dismantled. */
2079 rcu_read_lock();
2080 net = dev_net_rcu(dev);
2081 refcount_inc(&net->passive);
2082 rcu_read_unlock();
2083
2084 rtnl_net_lock(net);
2085
2086 /* dev might have been moved to another netns. */
> 2087 if (!net_eq(net, rcu_access_pointer(dev->nd_net.net))) {
2088 rtnl_net_unlock(net);
> 2089 net_drop_ns(net); 2090 goto again;
2091 }
2092 }
2093
Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
PATCH v3 2/2 dev: Use rtnl_net_dev_lock() in unregister_netdev().
In reply to Kuniyuki IwashimaThe following sequence is basically illegal when dev was fetched without lookup because dev_net(dev) might be different after holding rtnl_net_lock():
net = dev_net(dev); rtnl_net_lock(net);
Let's use rtnl_net_dev_lock() in unregister_netdev().
Note that there is no real bug in unregister_netdev() for now because RTNL protects the scope even if dev_net(dev) is changed before/after RTNL.
--- net/core/dev.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
net/core/dev.c +2 -4
@@ -11930,11 +11930,9 @@ EXPORT_SYMBOL(unregister_netdevice_many);*/ void unregister_netdev (struct net_device *dev) { -struct net *net =dev_net (dev); - -rtnl_net_lock (net); +rtnl_net_dev_lock (dev);unregister_netdevice (dev); -rtnl_net_unlock (net); +rtnl_net_dev_unlock (dev); }EXPORT_SYMBOL (unregister_netdev);
Signature · 1 line
2.39.5 (Apple Git-154)