genetlink: start to validate reserved header bytes
authorJakub Kicinski <kuba@kernel.org>
Thu, 25 Aug 2022 00:18:30 +0000 (17:18 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 29 Aug 2022 11:47:15 +0000 (12:47 +0100)
We had historically not checked that genlmsghdr.reserved
is 0 on input which prevents us from using those precious
bytes in the future.

One use case would be to extend the cmd field, which is
currently just 8 bits wide and 256 is not a lot of commands
for some core families.

To make sure that new families do the right thing by default
put the onus of opting out of validation on existing families.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Acked-by: Paul Moore <paul@paul-moore.com> (NetLabel)
Signed-off-by: David S. Miller <davem@davemloft.net>
47 files changed:
drivers/block/nbd.c
drivers/net/gtp.c
drivers/net/ieee802154/mac802154_hwsim.c
drivers/net/macsec.c
drivers/net/team/team.c
drivers/net/wireguard/netlink.c
drivers/net/wireless/mac80211_hwsim.c
drivers/target/target_core_user.c
drivers/thermal/thermal_netlink.c
drivers/vdpa/vdpa.c
fs/cifs/netlink.c
fs/dlm/netlink.c
fs/ksmbd/transport_ipc.c
include/linux/genl_magic_func.h
include/net/genetlink.h
kernel/taskstats.c
net/batman-adv/netlink.c
net/core/devlink.c
net/core/drop_monitor.c
net/ethtool/netlink.c
net/hsr/hsr_netlink.c
net/ieee802154/netlink.c
net/ieee802154/nl802154.c
net/ipv4/fou.c
net/ipv4/tcp_metrics.c
net/ipv6/ila/ila_main.c
net/ipv6/ioam6.c
net/ipv6/seg6.c
net/l2tp/l2tp_netlink.c
net/mptcp/pm_netlink.c
net/ncsi/ncsi-netlink.c
net/netfilter/ipvs/ip_vs_ctl.c
net/netlabel/netlabel_calipso.c
net/netlabel/netlabel_cipso_v4.c
net/netlabel/netlabel_mgmt.c
net/netlabel/netlabel_unlabeled.c
net/netlink/genetlink.c
net/nfc/netlink.c
net/openvswitch/conntrack.c
net/openvswitch/datapath.c
net/openvswitch/meter.c
net/psample/psample.c
net/smc/smc_netlink.c
net/smc/smc_pnet.c
net/tipc/netlink.c
net/tipc/netlink_compat.c
net/wireless/nl80211.c

index 2a709da..6cec9ce 100644 (file)
@@ -2322,6 +2322,7 @@ static struct genl_family nbd_genl_family __ro_after_init = {
        .module         = THIS_MODULE,
        .small_ops      = nbd_connect_genl_ops,
        .n_small_ops    = ARRAY_SIZE(nbd_connect_genl_ops),
+       .resv_start_op  = NBD_CMD_STATUS + 1,
        .maxattr        = NBD_ATTR_MAX,
        .policy = nbd_attr_policy,
        .mcgrps         = nbd_mcast_grps,
index a208e2b..15c7dc8 100644 (file)
@@ -1859,6 +1859,7 @@ static struct genl_family gtp_genl_family __ro_after_init = {
        .module         = THIS_MODULE,
        .small_ops      = gtp_genl_ops,
        .n_small_ops    = ARRAY_SIZE(gtp_genl_ops),
+       .resv_start_op  = GTP_CMD_ECHOREQ + 1,
        .mcgrps         = gtp_genl_mcgrps,
        .n_mcgrps       = ARRAY_SIZE(gtp_genl_mcgrps),
 };
index 38c217b..2f0544d 100644 (file)
@@ -630,6 +630,7 @@ static struct genl_family hwsim_genl_family __ro_after_init = {
        .module = THIS_MODULE,
        .small_ops = hwsim_nl_ops,
        .n_small_ops = ARRAY_SIZE(hwsim_nl_ops),
+       .resv_start_op = MAC802154_HWSIM_CMD_NEW_EDGE + 1,
        .mcgrps = hwsim_mcgrps,
        .n_mcgrps = ARRAY_SIZE(hwsim_mcgrps),
 };
index c6d271e..adf448a 100644 (file)
@@ -3404,6 +3404,7 @@ static struct genl_family macsec_fam __ro_after_init = {
        .module         = THIS_MODULE,
        .small_ops      = macsec_genl_ops,
        .n_small_ops    = ARRAY_SIZE(macsec_genl_ops),
+       .resv_start_op  = MACSEC_CMD_UPD_OFFLOAD + 1,
 };
 
 static netdev_tx_t macsec_start_xmit(struct sk_buff *skb,
index aac133a..b1e1239 100644 (file)
@@ -2840,6 +2840,7 @@ static struct genl_family team_nl_family __ro_after_init = {
        .module         = THIS_MODULE,
        .small_ops      = team_nl_ops,
        .n_small_ops    = ARRAY_SIZE(team_nl_ops),
+       .resv_start_op  = TEAM_CMD_PORT_LIST_GET + 1,
        .mcgrps         = team_nl_mcgrps,
        .n_mcgrps       = ARRAY_SIZE(team_nl_mcgrps),
 };
index d0f3b6d..0c0644e 100644 (file)
@@ -621,6 +621,7 @@ static const struct genl_ops genl_ops[] = {
 static struct genl_family genl_family __ro_after_init = {
        .ops = genl_ops,
        .n_ops = ARRAY_SIZE(genl_ops),
+       .resv_start_op = WG_CMD_SET_DEVICE + 1,
        .name = WG_GENL_NAME,
        .version = WG_GENL_VERSION,
        .maxattr = WGDEVICE_A_MAX,
index 4fb8f68..d905410 100644 (file)
@@ -5288,6 +5288,7 @@ static struct genl_family hwsim_genl_family __ro_after_init = {
        .module = THIS_MODULE,
        .small_ops = hwsim_ops,
        .n_small_ops = ARRAY_SIZE(hwsim_ops),
+       .resv_start_op = HWSIM_CMD_DEL_MAC_ADDR + 1,
        .mcgrps = hwsim_mcgrps,
        .n_mcgrps = ARRAY_SIZE(hwsim_mcgrps),
 };
index 3deaeec..2940559 100644 (file)
@@ -486,6 +486,7 @@ static struct genl_family tcmu_genl_family __ro_after_init = {
        .netnsok = true,
        .small_ops = tcmu_genl_ops,
        .n_small_ops = ARRAY_SIZE(tcmu_genl_ops),
+       .resv_start_op = TCMU_CMD_SET_FEATURES + 1,
 };
 
 #define tcmu_cmd_set_dbi_cur(cmd, index) ((cmd)->dbi_cur = (index))
index 050d243..e2d78a9 100644 (file)
@@ -693,6 +693,7 @@ static struct genl_family thermal_gnl_family __ro_after_init = {
        .policy         = thermal_genl_policy,
        .small_ops      = thermal_genl_ops,
        .n_small_ops    = ARRAY_SIZE(thermal_genl_ops),
+       .resv_start_op  = THERMAL_GENL_CMD_CDEV_GET + 1,
        .mcgrps         = thermal_genl_mcgrps,
        .n_mcgrps       = ARRAY_SIZE(thermal_genl_mcgrps),
 };
index c06c027..7badf57 100644 (file)
@@ -1183,6 +1183,7 @@ static struct genl_family vdpa_nl_family __ro_after_init = {
        .module = THIS_MODULE,
        .ops = vdpa_nl_ops,
        .n_ops = ARRAY_SIZE(vdpa_nl_ops),
+       .resv_start_op = VDPA_CMD_DEV_VSTATS_GET + 1,
 };
 
 static int vdpa_init(void)
index 291cb60..147d940 100644 (file)
@@ -51,6 +51,7 @@ struct genl_family cifs_genl_family = {
        .policy         = cifs_genl_policy,
        .ops            = cifs_genl_ops,
        .n_ops          = ARRAY_SIZE(cifs_genl_ops),
+       .resv_start_op  = CIFS_GENL_CMD_SWN_NOTIFY + 1,
        .mcgrps         = cifs_genl_mcgrps,
        .n_mcgrps       = ARRAY_SIZE(cifs_genl_mcgrps),
 };
index 67f68d4..4de4b86 100644 (file)
@@ -75,6 +75,7 @@ static struct genl_family family __ro_after_init = {
        .version        = DLM_GENL_VERSION,
        .small_ops      = dlm_nl_ops,
        .n_small_ops    = ARRAY_SIZE(dlm_nl_ops),
+       .resv_start_op  = DLM_CMD_HELLO + 1,
        .module         = THIS_MODULE,
 };
 
index 7cb0eeb..c9aca21 100644 (file)
@@ -197,6 +197,7 @@ static struct genl_family ksmbd_genl_family = {
        .module         = THIS_MODULE,
        .ops            = ksmbd_genl_ops,
        .n_ops          = ARRAY_SIZE(ksmbd_genl_ops),
+       .resv_start_op  = KSMBD_EVENT_SPNEGO_AUTHEN_RESPONSE + 1,
 };
 
 static void ksmbd_nl_init_fixup(void)
index 939b1a8..4a4b387 100644 (file)
@@ -294,6 +294,7 @@ static struct genl_family ZZZ_genl_family __ro_after_init = {
        .ops = ZZZ_genl_ops,
        .n_ops = ARRAY_SIZE(ZZZ_genl_ops),
        .mcgrps = ZZZ_genl_mcgrps,
+       .resv_start_op = 42, /* drbd is currently the only user */
        .n_mcgrps = ARRAY_SIZE(ZZZ_genl_mcgrps),
        .module = THIS_MODULE,
 };
index 56a50e1..a4827b5 100644 (file)
@@ -39,6 +39,8 @@ struct genl_info;
  *     undo operations done by pre_doit, for example release locks
  * @mcgrps: multicast groups used by this family
  * @n_mcgrps: number of multicast groups
+ * @resv_start_op: first operation for which reserved fields of the header
+ *     can be validated, new families should leave this field at zero
  * @mcgrp_offset: starting number of multicast group IDs in this family
  *     (private)
  * @ops: the operations supported by this family
@@ -58,6 +60,7 @@ struct genl_family {
        u8                      n_ops;
        u8                      n_small_ops;
        u8                      n_mcgrps;
+       u8                      resv_start_op;
        const struct nla_policy *policy;
        int                     (*pre_doit)(const struct genl_ops *ops,
                                            struct sk_buff *skb,
index f7e2463..8ce3fa0 100644 (file)
@@ -688,6 +688,7 @@ static struct genl_family family __ro_after_init = {
        .module         = THIS_MODULE,
        .ops            = taskstats_ops,
        .n_ops          = ARRAY_SIZE(taskstats_ops),
+       .resv_start_op  = CGROUPSTATS_CMD_GET + 1,
        .netnsok        = true,
 };
 
index 00875e1..a5e4a4e 100644 (file)
@@ -1493,6 +1493,7 @@ struct genl_family batadv_netlink_family __ro_after_init = {
        .module = THIS_MODULE,
        .small_ops = batadv_netlink_ops,
        .n_small_ops = ARRAY_SIZE(batadv_netlink_ops),
+       .resv_start_op = BATADV_CMD_SET_VLAN + 1,
        .mcgrps = batadv_netlink_mcgrps,
        .n_mcgrps = ARRAY_SIZE(batadv_netlink_mcgrps),
 };
index 2afbeb6..3396fdf 100644 (file)
@@ -9610,6 +9610,7 @@ static struct genl_family devlink_nl_family __ro_after_init = {
        .module         = THIS_MODULE,
        .small_ops      = devlink_nl_ops,
        .n_small_ops    = ARRAY_SIZE(devlink_nl_ops),
+       .resv_start_op  = DEVLINK_CMD_SELFTESTS_RUN + 1,
        .mcgrps         = devlink_nl_mcgrps,
        .n_mcgrps       = ARRAY_SIZE(devlink_nl_mcgrps),
 };
index 876664f..f084a4a 100644 (file)
@@ -1645,6 +1645,7 @@ static struct genl_family net_drop_monitor_family __ro_after_init = {
        .module         = THIS_MODULE,
        .small_ops      = dropmon_ops,
        .n_small_ops    = ARRAY_SIZE(dropmon_ops),
+       .resv_start_op  = NET_DM_CMD_STATS_GET + 1,
        .mcgrps         = dropmon_mcgrps,
        .n_mcgrps       = ARRAY_SIZE(dropmon_mcgrps),
 };
index e26079e..d5e77f1 100644 (file)
@@ -1033,6 +1033,7 @@ static struct genl_family ethtool_genl_family __ro_after_init = {
        .parallel_ops   = true,
        .ops            = ethtool_genl_ops,
        .n_ops          = ARRAY_SIZE(ethtool_genl_ops),
+       .resv_start_op  = ETHTOOL_MSG_MODULE_GET + 1,
        .mcgrps         = ethtool_nl_mcgrps,
        .n_mcgrps       = ARRAY_SIZE(ethtool_nl_mcgrps),
 };
index 1405c03..7174a90 100644 (file)
@@ -522,6 +522,7 @@ static struct genl_family hsr_genl_family __ro_after_init = {
        .module = THIS_MODULE,
        .small_ops = hsr_ops,
        .n_small_ops = ARRAY_SIZE(hsr_ops),
+       .resv_start_op = HSR_C_SET_NODE_LIST + 1,
        .mcgrps = hsr_mcgrps,
        .n_mcgrps = ARRAY_SIZE(hsr_mcgrps),
 };
index b07abc3..7d2de4e 100644 (file)
@@ -132,6 +132,7 @@ struct genl_family nl802154_family __ro_after_init = {
        .module         = THIS_MODULE,
        .small_ops      = ieee802154_ops,
        .n_small_ops    = ARRAY_SIZE(ieee802154_ops),
+       .resv_start_op  = IEEE802154_LLSEC_DEL_SECLEVEL + 1,
        .mcgrps         = ieee802154_mcgrps,
        .n_mcgrps       = ARRAY_SIZE(ieee802154_mcgrps),
 };
index e0b072a..38c4f3c 100644 (file)
@@ -2500,6 +2500,7 @@ static struct genl_family nl802154_fam __ro_after_init = {
        .module = THIS_MODULE,
        .ops = nl802154_ops,
        .n_ops = ARRAY_SIZE(nl802154_ops),
+       .resv_start_op = NL802154_CMD_DEL_SEC_LEVEL + 1,
        .mcgrps = nl802154_mcgrps,
        .n_mcgrps = ARRAY_SIZE(nl802154_mcgrps),
 };
index cb5bfb7..0c3c6d0 100644 (file)
@@ -928,6 +928,7 @@ static struct genl_family fou_nl_family __ro_after_init = {
        .module         = THIS_MODULE,
        .small_ops      = fou_nl_ops,
        .n_small_ops    = ARRAY_SIZE(fou_nl_ops),
+       .resv_start_op  = FOU_CMD_GET + 1,
 };
 
 size_t fou_encap_hlen(struct ip_tunnel_encap *e)
index d58e672..82f4575 100644 (file)
@@ -969,6 +969,7 @@ static struct genl_family tcp_metrics_nl_family __ro_after_init = {
        .module         = THIS_MODULE,
        .small_ops      = tcp_metrics_nl_ops,
        .n_small_ops    = ARRAY_SIZE(tcp_metrics_nl_ops),
+       .resv_start_op  = TCP_METRICS_CMD_DEL + 1,
 };
 
 static unsigned int tcpmhash_entries;
index 36c58aa..3faf625 100644 (file)
@@ -55,6 +55,7 @@ struct genl_family ila_nl_family __ro_after_init = {
        .module         = THIS_MODULE,
        .ops            = ila_nl_ops,
        .n_ops          = ARRAY_SIZE(ila_nl_ops),
+       .resv_start_op  = ILA_CMD_FLUSH + 1,
 };
 
 static __net_init int ila_init_net(struct net *net)
index 1098131..571f0e4 100644 (file)
@@ -619,6 +619,7 @@ static struct genl_family ioam6_genl_family __ro_after_init = {
        .parallel_ops   = true,
        .ops            = ioam6_genl_ops,
        .n_ops          = ARRAY_SIZE(ioam6_genl_ops),
+       .resv_start_op  = IOAM6_CMD_NS_SET_SCHEMA + 1,
        .module         = THIS_MODULE,
 };
 
index 73aaabf..5421cc7 100644 (file)
@@ -499,6 +499,7 @@ static struct genl_family seg6_genl_family __ro_after_init = {
        .parallel_ops   = true,
        .ops            = seg6_genl_ops,
        .n_ops          = ARRAY_SIZE(seg6_genl_ops),
+       .resv_start_op  = SEG6_CMD_GET_TUNSRC + 1,
        .module         = THIS_MODULE,
 };
 
index 96eb91b..a901fd1 100644 (file)
@@ -989,6 +989,7 @@ static struct genl_family l2tp_nl_family __ro_after_init = {
        .module         = THIS_MODULE,
        .small_ops      = l2tp_nl_ops,
        .n_small_ops    = ARRAY_SIZE(l2tp_nl_ops),
+       .resv_start_op  = L2TP_CMD_SESSION_GET + 1,
        .mcgrps         = l2tp_multicast_group,
        .n_mcgrps       = ARRAY_SIZE(l2tp_multicast_group),
 };
index 291b5da..a3e4ee7 100644 (file)
@@ -2280,6 +2280,7 @@ static struct genl_family mptcp_genl_family __ro_after_init = {
        .module         = THIS_MODULE,
        .small_ops      = mptcp_pm_ops,
        .n_small_ops    = ARRAY_SIZE(mptcp_pm_ops),
+       .resv_start_op  = MPTCP_PM_CMD_SUBFLOW_DESTROY + 1,
        .mcgrps         = mptcp_pm_mcgrps,
        .n_mcgrps       = ARRAY_SIZE(mptcp_pm_mcgrps),
 };
index c189b4c..d27f4ec 100644 (file)
@@ -768,6 +768,7 @@ static struct genl_family ncsi_genl_family __ro_after_init = {
        .module = THIS_MODULE,
        .small_ops = ncsi_ops,
        .n_small_ops = ARRAY_SIZE(ncsi_ops),
+       .resv_start_op = NCSI_CMD_SET_CHANNEL_MASK + 1,
 };
 
 static int __init ncsi_init_netlink(void)
index efab2b0..818b0b0 100644 (file)
@@ -4005,6 +4005,7 @@ static struct genl_family ip_vs_genl_family __ro_after_init = {
        .module         = THIS_MODULE,
        .small_ops      = ip_vs_genl_ops,
        .n_small_ops    = ARRAY_SIZE(ip_vs_genl_ops),
+       .resv_start_op  = IPVS_CMD_FLUSH + 1,
 };
 
 static int __init ip_vs_genl_register(void)
index 91a19c3..f1d5b84 100644 (file)
@@ -344,6 +344,7 @@ static struct genl_family netlbl_calipso_gnl_family __ro_after_init = {
        .module = THIS_MODULE,
        .small_ops = netlbl_calipso_ops,
        .n_small_ops = ARRAY_SIZE(netlbl_calipso_ops),
+       .resv_start_op = NLBL_CALIPSO_C_LISTALL + 1,
 };
 
 /* NetLabel Generic NETLINK Protocol Functions
index 894e6b8..fa08ee7 100644 (file)
@@ -767,6 +767,7 @@ static struct genl_family netlbl_cipsov4_gnl_family __ro_after_init = {
        .module = THIS_MODULE,
        .small_ops = netlbl_cipsov4_ops,
        .n_small_ops = ARRAY_SIZE(netlbl_cipsov4_ops),
+       .resv_start_op = NLBL_CIPSOV4_C_LISTALL + 1,
 };
 
 /*
index 032b7d7..689eaa2 100644 (file)
@@ -826,6 +826,7 @@ static struct genl_family netlbl_mgmt_gnl_family __ro_after_init = {
        .module = THIS_MODULE,
        .small_ops = netlbl_mgmt_genl_ops,
        .n_small_ops = ARRAY_SIZE(netlbl_mgmt_genl_ops),
+       .resv_start_op = NLBL_MGMT_C_VERSION + 1,
 };
 
 /*
index 0555dff..9996883 100644 (file)
@@ -1374,6 +1374,7 @@ static struct genl_family netlbl_unlabel_gnl_family __ro_after_init = {
        .module = THIS_MODULE,
        .small_ops = netlbl_unlabel_genl_ops,
        .n_small_ops = ARRAY_SIZE(netlbl_unlabel_genl_ops),
+       .resv_start_op = NLBL_UNLABEL_C_STATICLISTDEF + 1,
 };
 
 /*
index 76aed05..7c136de 100644 (file)
@@ -757,6 +757,9 @@ static int genl_family_rcv_msg(const struct genl_family *family,
        if (nlh->nlmsg_len < nlmsg_msg_size(hdrlen))
                return -EINVAL;
 
+       if (hdr->cmd >= family->resv_start_op && hdr->reserved)
+               return -EINVAL;
+
        if (genl_get_cmd(hdr->cmd, family, &op))
                return -EOPNOTSUPP;
 
@@ -1348,6 +1351,7 @@ static struct genl_family genl_ctrl __ro_after_init = {
        .module = THIS_MODULE,
        .ops = genl_ctrl_ops,
        .n_ops = ARRAY_SIZE(genl_ctrl_ops),
+       .resv_start_op = CTRL_CMD_GETPOLICY + 1,
        .mcgrps = genl_ctrl_groups,
        .n_mcgrps = ARRAY_SIZE(genl_ctrl_groups),
        .id = GENL_ID_CTRL,
index 7c62417..9d91087 100644 (file)
@@ -1783,6 +1783,7 @@ static struct genl_family nfc_genl_family __ro_after_init = {
        .module = THIS_MODULE,
        .ops = nfc_genl_ops,
        .n_ops = ARRAY_SIZE(nfc_genl_ops),
+       .resv_start_op = NFC_CMD_DEACTIVATE_TARGET + 1,
        .mcgrps = nfc_genl_mcgrps,
        .n_mcgrps = ARRAY_SIZE(nfc_genl_mcgrps),
 };
index 4e70df9..48e8f5c 100644 (file)
@@ -2283,6 +2283,7 @@ struct genl_family dp_ct_limit_genl_family __ro_after_init = {
        .parallel_ops = true,
        .small_ops = ct_limit_genl_ops,
        .n_small_ops = ARRAY_SIZE(ct_limit_genl_ops),
+       .resv_start_op = OVS_CT_LIMIT_CMD_GET + 1,
        .mcgrps = &ovs_ct_limit_multicast_group,
        .n_mcgrps = 1,
        .module = THIS_MODULE,
index e466770..8f49e23 100644 (file)
@@ -692,6 +692,7 @@ static struct genl_family dp_packet_genl_family __ro_after_init = {
        .parallel_ops = true,
        .small_ops = dp_packet_genl_ops,
        .n_small_ops = ARRAY_SIZE(dp_packet_genl_ops),
+       .resv_start_op = OVS_PACKET_CMD_EXECUTE + 1,
        .module = THIS_MODULE,
 };
 
@@ -1509,6 +1510,7 @@ static struct genl_family dp_flow_genl_family __ro_after_init = {
        .parallel_ops = true,
        .small_ops = dp_flow_genl_ops,
        .n_small_ops = ARRAY_SIZE(dp_flow_genl_ops),
+       .resv_start_op = OVS_FLOW_CMD_SET + 1,
        .mcgrps = &ovs_dp_flow_multicast_group,
        .n_mcgrps = 1,
        .module = THIS_MODULE,
@@ -2051,6 +2053,7 @@ static struct genl_family dp_datapath_genl_family __ro_after_init = {
        .parallel_ops = true,
        .small_ops = dp_datapath_genl_ops,
        .n_small_ops = ARRAY_SIZE(dp_datapath_genl_ops),
+       .resv_start_op = OVS_DP_CMD_SET + 1,
        .mcgrps = &ovs_dp_datapath_multicast_group,
        .n_mcgrps = 1,
        .module = THIS_MODULE,
index 04a060a..51111a9 100644 (file)
@@ -720,6 +720,7 @@ struct genl_family dp_meter_genl_family __ro_after_init = {
        .parallel_ops = true,
        .small_ops = dp_meter_genl_ops,
        .n_small_ops = ARRAY_SIZE(dp_meter_genl_ops),
+       .resv_start_op = OVS_METER_CMD_GET + 1,
        .mcgrps = &ovs_meter_multicast_group,
        .n_mcgrps = 1,
        .module = THIS_MODULE,
index 118d5d2..81a794e 100644 (file)
@@ -115,6 +115,7 @@ static struct genl_family psample_nl_family __ro_after_init = {
        .mcgrps         = psample_nl_mcgrps,
        .small_ops      = psample_nl_ops,
        .n_small_ops    = ARRAY_SIZE(psample_nl_ops),
+       .resv_start_op  = PSAMPLE_CMD_GET_GROUP + 1,
        .n_mcgrps       = ARRAY_SIZE(psample_nl_mcgrps),
 };
 
index c5a62f6..621c46c 100644 (file)
@@ -142,7 +142,8 @@ struct genl_family smc_gen_nl_family __ro_after_init = {
        .netnsok =      true,
        .module =       THIS_MODULE,
        .ops =          smc_gen_nl_ops,
-       .n_ops =        ARRAY_SIZE(smc_gen_nl_ops)
+       .n_ops =        ARRAY_SIZE(smc_gen_nl_ops),
+       .resv_start_op = SMC_NETLINK_DISABLE_HS_LIMITATION + 1,
 };
 
 int __init smc_nl_init(void)
index 4c3bf6d..25fb2fd 100644 (file)
@@ -715,7 +715,8 @@ static struct genl_family smc_pnet_nl_family __ro_after_init = {
        .netnsok = true,
        .module = THIS_MODULE,
        .ops = smc_pnet_ops,
-       .n_ops =  ARRAY_SIZE(smc_pnet_ops)
+       .n_ops =  ARRAY_SIZE(smc_pnet_ops),
+       .resv_start_op = SMC_PNETID_FLUSH + 1,
 };
 
 bool smc_pnet_is_ndev_pnetid(struct net *net, u8 *pnetid)
index c447cb5..e8fd257 100644 (file)
@@ -294,6 +294,7 @@ struct genl_family tipc_genl_family __ro_after_init = {
        .module         = THIS_MODULE,
        .ops            = tipc_genl_v2_ops,
        .n_ops          = ARRAY_SIZE(tipc_genl_v2_ops),
+       .resv_start_op  = TIPC_NL_ADDR_LEGACY_GET + 1,
 };
 
 int __init tipc_netlink_start(void)
index 0749df8..fc68733 100644 (file)
@@ -1357,6 +1357,7 @@ static struct genl_family tipc_genl_compat_family __ro_after_init = {
        .module         = THIS_MODULE,
        .small_ops      = tipc_genl_compat_ops,
        .n_small_ops    = ARRAY_SIZE(tipc_genl_compat_ops),
+       .resv_start_op  = TIPC_GENL_CMD + 1,
 };
 
 int __init tipc_netlink_compat_start(void)
index dad88d2..e008717 100644 (file)
@@ -17237,6 +17237,7 @@ static struct genl_family nl80211_fam __ro_after_init = {
        .n_ops = ARRAY_SIZE(nl80211_ops),
        .small_ops = nl80211_small_ops,
        .n_small_ops = ARRAY_SIZE(nl80211_small_ops),
+       .resv_start_op = NL80211_CMD_REMOVE_LINK_STA + 1,
        .mcgrps = nl80211_mcgrps,
        .n_mcgrps = ARRAY_SIZE(nl80211_mcgrps),
        .parallel_ops = true,