diff options
| author | David S. Miller <davem@davemloft.net> | 2022-03-14 10:06:54 +0000 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2022-03-14 10:06:54 +0000 |
| commit | d96657dc9238f8e9bda47b377e17e7c6f90935af (patch) | |
| tree | 016666de92847148d489058102bdd5023d62869b /include/linux | |
| parent | de29aff976d3216e7f3ab41fcd7af46fa8f7eab7 (diff) | |
| parent | 1f4a5983d623d6dbda4cc7587a2d9d798e0d4035 (diff) | |
Merge branch 'macvlan-uaf'
Ziyang Xuan says:
====================
net: macvlan: fix potential UAF problem for lowerdev
Add the reference operation to lowerdev of macvlan to avoid
the potential UAF problem under the following known scenario:
Someone module puts the NETDEV_UNREGISTER event handler to a
work, and lowerdev is accessed in the work handler. But when
the work is excuted, lowerdev has been destroyed because upper
macvlan did not get reference to lowerdev correctly.
In addition, add net device refcount tracker to macvlan.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/if_macvlan.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/if_macvlan.h b/include/linux/if_macvlan.h index 10c94a3936ca..b42294739063 100644 --- a/include/linux/if_macvlan.h +++ b/include/linux/if_macvlan.h @@ -21,6 +21,7 @@ struct macvlan_dev { struct hlist_node hlist; struct macvlan_port *port; struct net_device *lowerdev; + netdevice_tracker dev_tracker; void *accel_priv; struct vlan_pcpu_stats __percpu *pcpu_stats; |
