WSL2-Linux-Kernel/net/netlink
Patrick McHardy 6d1a3fb567 netlink: genl: fix circular locking
genetlink has a circular locking dependency when dumping the registered
families:

- dump start:
genl_rcv()            : take genl_mutex
genl_rcv_msg()        : call netlink_dump_start() while holding genl_mutex
netlink_dump_start(),
netlink_dump()        : take nlk->cb_mutex
ctrl_dumpfamily()     : try to detect this case and not take genl_mutex a
                        second time

- dump continuance:
netlink_rcv()         : call netlink_dump
netlink_dump          : take nlk->cb_mutex
ctrl_dumpfamily()     : take genl_mutex

Register genl_lock as callback mutex with netlink to fix this. This slightly
widens an already existing module unload race, the genl ops used during the
dump might go away when the module is unloaded. Thomas Graf is working on a
seperate fix for this.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-06-18 02:07:07 -07:00
..
Makefile [NETLINK]: Generic netlink family 2005-11-10 02:26:41 +01:00
af_netlink.c Audit: collect sessionid in netlink messages 2008-04-28 06:18:03 -04:00
attr.c netlink: Improve returned error codes 2008-06-03 16:36:54 -07:00
genetlink.c netlink: genl: fix circular locking 2008-06-18 02:07:07 -07:00