summaryrefslogtreecommitdiffstats
path: root/Documentation/RCU/NMI-RCU.rst
diff options
context:
space:
mode:
authorSean Tranchetti <stranche@codeaurora.org>2020-06-30 19:50:17 +0200
committerDavid S. Miller <davem@davemloft.net>2020-07-02 00:49:11 +0200
commit1e82a62fec613844da9e558f3493540a5b7a7b67 (patch)
treeef24bd75739f80865d3ed9c2aa3bfda459736b5b /Documentation/RCU/NMI-RCU.rst
parenthinic: fix passing non negative value to ERR_PTR (diff)
downloadlinux-1e82a62fec613844da9e558f3493540a5b7a7b67.tar.xz
linux-1e82a62fec613844da9e558f3493540a5b7a7b67.zip
genetlink: remove genl_bind
A potential deadlock can occur during registering or unregistering a new generic netlink family between the main nl_table_lock and the cb_lock where each thread wants the lock held by the other, as demonstrated below. 1) Thread 1 is performing a netlink_bind() operation on a socket. As part of this call, it will call netlink_lock_table(), incrementing the nl_table_users count to 1. 2) Thread 2 is registering (or unregistering) a genl_family via the genl_(un)register_family() API. The cb_lock semaphore will be taken for writing. 3) Thread 1 will call genl_bind() as part of the bind operation to handle subscribing to GENL multicast groups at the request of the user. It will attempt to take the cb_lock semaphore for reading, but it will fail and be scheduled away, waiting for Thread 2 to finish the write. 4) Thread 2 will call netlink_table_grab() during the (un)registration call. However, as Thread 1 has incremented nl_table_users, it will not be able to proceed, and both threads will be stuck waiting for the other. genl_bind() is a noop, unless a genl_family implements the mcast_bind() function to handle setting up family-specific multicast operations. Since no one in-tree uses this functionality as Cong pointed out, simply removing the genl_bind() function will remove the possibility for deadlock, as there is no attempt by Thread 1 above to take the cb_lock semaphore. Fixes: c380d9a7afff ("genetlink: pass multicast bind/unbind to families") Suggested-by: Cong Wang <xiyou.wangcong@gmail.com> Acked-by: Johannes Berg <johannes.berg@intel.com> Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: Sean Tranchetti <stranche@codeaurora.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'Documentation/RCU/NMI-RCU.rst')
0 files changed, 0 insertions, 0 deletions