Merge branch 'bridge-ioctl-fixes'
authorDavid S. Miller <davem@davemloft.net>
Thu, 5 Aug 2021 10:36:59 +0000 (11:36 +0100)
committerDavid S. Miller <davem@davemloft.net>
Thu, 5 Aug 2021 10:36:59 +0000 (11:36 +0100)
commitd15040a33883c3ab2ee2ea17e6427ce24e9f3ac0
treecdc7a2fa03144725689da62cf4f7233690965c42
parent4167a960574fcadc9067f4280951a35b8c021c68
parent9384eacd80f3da8d05fd17073eafd1f7fef80b26
Merge branch 'bridge-ioctl-fixes'

Nikolay Aleksandrov says:

====================
net: bridge: fix recent ioctl changes

These are three fixes for the recent bridge removal of ndo_do_ioctl
done by commit ad2f99aedf8f ("net: bridge: move bridge ioctls out of
.ndo_do_ioctl"). Patch 01 fixes a deadlock of the new bridge ioctl
hook lock and rtnl by taking a netdev reference and always taking the
bridge ioctl lock first then rtnl from within the bridge hook.
Patch 02 fixes old_deviceless() bridge calls device name argument, and
patch 03 checks in dev_ifsioc()'s SIOCBRADD/DELIF cases if the netdevice is
actually a bridge before interpreting its private ptr as net_bridge.

Patch 01 was tested by running old bridge-utils commands with lockdep
enabled. Patch 02 was tested again by using bridge-utils and using the
respective ioctl calls on a "up" bridge device. Patch 03 was tested by
using the addif ioctl on a non-bridge device (e.g. loopback).
====================

Signed-off-by: David S. Miller <davem@davemloft.net>