netfilter: nftables: comment indirect serialization of commit_mutex with rtnl_mutex
Subsystems (2)
Pablo Neira Ayuso
maintainerPATCH 1/1 netfilter: nftables: comment indirect serialization of commit_mutex with rtnl_mutex
Add an explicit comment in the code to describe the indirect serialization of the holders of the commit_mutex with the rtnl_mutex. Commit 90d2723c6d4c ("netfilter: nf_tables: do not hold reference on netdevice from preparation phase") already describes this, but a comment in this case if better for reference.
Reported-by Vladimir Oltean <[email protected]>
Signed-off-by Pablo Neira Ayuso <[email protected]>
--- net/netfilter/nf_tables_api.c | 4 ++++ 1 file changed, 4 insertions(+)
net/netfilter/nf_tables_api.c +4 -0
@@ -1723,6 +1723,10 @@ static struct nft_hook *nft_netdev_hook_alloc(struct net *net, }nla_strlcpy (ifname, attr,IFNAMSIZ ); +/* nf_tables_netdev_event() is called under rtnl_mutex, this is +* indirectly serializing all the other holders of the commit_mutex with +* the rtnl_mutex. +*/ dev =__dev_get_by_name (net, ifname);if (!dev) { err = -ENOENT ;
Signature · 1 line
2.20.1
Quoted 30 lines · Pablo Neira Ayuso
Add an explicit comment in the code to describe the indirect serialization of the holders of the
commit_mutexwith thertnl_mutex. Commit90d2723c6d4c("netfilter:nf_tables: do not hold reference on netdevice from preparation phase") already describes this, but a comment in this case if better for reference.Reported-by Vladimir Oltean <[email protected]>Signed-off-by Pablo Neira Ayuso <[email protected]>--- net/netfilter/nf_tables_api.c | 4 ++++ 1 file changed, 4 insertions(+)net/netfilter/nf_tables_api.c +4
-0@@ -1723,6 +1723,10 @@ static struct nft_hook *nft_netdev_hook_alloc(struct net *net, }nla_strlcpy (ifname, attr,IFNAMSIZ ); +/* nf_tables_netdev_event() is called under rtnl_mutex, this is +* indirectly serializing all the other holders of the commit_mutex with +* the rtnl_mutex. +*/ dev =__dev_get_by_name (net, ifname);if (!dev) { err = -ENOENT ;Signature · 1 line
2.20.1
Reviewed-by Vladimir Oltean <[email protected]>
Thanks!