genetlink: make multicast groups const, prevent abuse
authorJohannes Berg <johannes.berg@intel.com>
Tue, 19 Nov 2013 14:19:39 +0000 (15:19 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 19 Nov 2013 21:39:06 +0000 (16:39 -0500)
commit2a94fe48f32ccf7321450a2cc07f2b724a444e5b
treee5a066d8f83d8822d448421019a4503f361295f9
parent68eb55031da7c967d954e5f9415cd05f4abdb692
genetlink: make multicast groups const, prevent abuse

Register generic netlink multicast groups as an array with
the family and give them contiguous group IDs. Then instead
of passing the global group ID to the various functions that
send messages, pass the ID relative to the family - for most
families that's just 0 because the only have one group.

This avoids the list_head and ID in each group, adding a new
field for the mcast group ID offset to the family.

At the same time, this allows us to prevent abusing groups
again like the quota and dropmon code did, since we can now
check that a family only uses a group it owns.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
19 files changed:
drivers/acpi/event.c
drivers/net/team/team.c
drivers/thermal/thermal_core.c
fs/quota/netlink.c
include/linux/genl_magic_func.h
include/net/genetlink.h
net/core/drop_monitor.c
net/hsr/hsr_netlink.c
net/ieee802154/ieee802154.h
net/ieee802154/netlink.c
net/ieee802154/nl-mac.c
net/netlink/genetlink.c
net/nfc/netlink.c
net/openvswitch/datapath.c
net/openvswitch/dp_notify.c
net/wimax/op-msg.c
net/wimax/stack.c
net/wimax/wimax-internal.h
net/wireless/nl80211.c