Skip to content
Commit 8f1948bd authored by Jiri Pirko's avatar Jiri Pirko Committed by Jakub Kicinski
Browse files

genetlink: hold read cb_lock during iteration of genl_fam_idr in genl_bind()



In genl_bind(), currently genl_lock and write cb_lock are taken
for iteration of genl_fam_idr and processing of static values
stored in struct genl_family. Take just read cb_lock for this task
as it is sufficient to guard the idr and the struct against
concurrent genl_register/unregister_family() calls.

This will allow to run genl command processing in genl_rcv() and
mnl_socket_setsockopt(.., NETLINK_ADD_MEMBERSHIP, ..) in parallel.

Reported-by: default avatarVikas Gupta <vikas.gupta@broadcom.com>
Signed-off-by: default avatarJiri Pirko <jiri@nvidia.com>
Link: https://lore.kernel.org/r/20220825081940.1283335-1-jiri@resnulli.us
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 0c1f77d8
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment