diff options
author | David S. Miller <davem@davemloft.net> | 2020-09-29 00:00:15 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-09-29 00:00:15 +0200 |
commit | 0ba56b89fabc139849cf27e475287b0361f550d3 (patch) | |
tree | 1b876520c6009ad68b0eb4664a87eb6878be125e /net/6lowpan | |
parent | net_sched: remove a redundant goto chain check (diff) | |
parent | net: core: add nested_level variable in net_device (diff) | |
download | linux-0ba56b89fabc139849cf27e475287b0361f550d3.tar.xz linux-0ba56b89fabc139849cf27e475287b0361f550d3.zip |
Merge branch 'net-core-fix-a-lockdep-splat-in-the-dev_addr_list'
Taehee Yoo says:
====================
net: core: fix a lockdep splat in the dev_addr_list.
This patchset is to avoid lockdep splat.
When a stacked interface graph is changed, netif_addr_lock() is called
recursively and it internally calls spin_lock_nested().
The parameter of spin_lock_nested() is 'dev->lower_level',
this is called subclass.
The problem of 'dev->lower_level' is that while 'dev->lower_level' is
being used as a subclass of spin_lock_nested(), its value can be changed.
So, spin_lock_nested() would be called recursively with the same
subclass value, the lockdep understands a deadlock.
In order to avoid this, a new variable is needed and it is going to be
used as a parameter of spin_lock_nested().
The first and second patch is a preparation patch for the third patch.
In the third patch, the problem will be fixed.
The first patch is to add __netdev_upper_dev_unlink().
An existed netdev_upper_dev_unlink() is renamed to
__netdev_upper_dev_unlink(). and netdev_upper_dev_unlink()
is added as an wrapper of this function.
The second patch is to add the netdev_nested_priv structure.
netdev_walk_all_{ upper | lower }_dev() pass both private functions
and "data" pointer to handle their own things.
At this point, the data pointer type is void *.
In order to make it easier to expand common variables and functions,
this new netdev_nested_priv structure is added.
The third patch is to add a new variable 'nested_level'
into the net_device structure.
This variable will be used as a parameter of spin_lock_nested() of
dev->addr_list_lock.
Due to this variable, it can avoid lockdep splat.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/6lowpan')
0 files changed, 0 insertions, 0 deletions